OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [PATCH v2 04/23] virtio: Add get_shm_region method




On Wed, Sep 2, 2020 at 3:15 PM Vivek Goyal <vgoyal@redhat.com> wrote:
Hi Gurchetan,

Now Miklos has queued, these tree virtio patches for shared memory
region in his tree as part of virtiofs dax patch series.

I am hoping this will get merged in 5.10 through his tree.

https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git/log/?h=dax

Terrific ... ! Maybe we can queue the version Miklos has in drm-misc-next to avoid merge conflicts ?!?

There's a few checkpatch --strict fixes in the blob version, but I doubt anyone cares.



Thanks
Vivek

On Wed, Sep 02, 2020 at 02:08:28PM -0700, Gurchetan Singh wrote:
> From: Sebastien Boeuf <sebastien.boeuf@intel.com>
>
> Virtio defines 'shared memory regions' that provide a continuously
> shared region between the host and guest.
>
> Provide a method to find a particular region on a device.
>
> Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
> Cc: kvm@vger.kernel.org
> Cc: virtualization@lists.linux-foundation.org
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> ---
>Â include/linux/virtio_config.h | 17 +++++++++++++++++
>Â 1 file changed, 17 insertions(+)
>
> diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
> index 8fe857e27ef32..4b8e38c5c4d8c 100644
> --- a/include/linux/virtio_config.h
> +++ b/include/linux/virtio_config.h
> @@ -11,6 +11,11 @@

>Â struct irq_affinity;

> +struct virtio_shm_region {
> +Â Â Âu64 addr;
> +Â Â Âu64 len;
> +};
> +
>Â /**
>Â Â* virtio_config_ops - operations for configuring a virtio device
>Â Â* Note: Do not assume that a transport implements all of the operations
> @@ -66,6 +71,7 @@ struct irq_affinity;
>Â Â*Â Â Â the caller can then copy.
>Â Â* @set_vq_affinity: set the affinity for a virtqueue (optional).
>Â Â* @get_vq_affinity: get the affinity for a virtqueue (optional).
> + * @get_shm_region: get a shared memory region based on the index.
>Â Â*/
>Â typedef void vq_callback_t(struct virtqueue *);
>Â struct virtio_config_ops {
> @@ -89,6 +95,8 @@ struct virtio_config_ops {
>Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â const struct cpumask *cpu_mask);
>Â Â Â Âconst struct cpumask *(*get_vq_affinity)(struct virtio_device *vdev,
>Â Â Â Â Â Â Â Â Â Â Â Âint index);
> +Â Â Âbool (*get_shm_region)(struct virtio_device *vdev,
> +Â Â Â Â Â Â Â Â Â Â Â Â Â Â struct virtio_shm_region *region, u8 id);
>Â };

>Â /* If driver didn't advertise the feature, it will never appear. */
> @@ -251,6 +259,15 @@ int virtqueue_set_affinity(struct virtqueue *vq, const struct cpumask *cpu_mask)
>Â Â Â Âreturn 0;
>Â }

> +static inline
> +bool virtio_get_shm_region(struct virtio_device *vdev,
> +Â Â Â Â Â Â Â Â Â Â Â Â struct virtio_shm_region *region, u8 id)
> +{
> +Â Â Âif (!vdev->config->get_shm_region)
> +Â Â Â Â Â Â Âreturn false;
> +Â Â Âreturn vdev->config->get_shm_region(vdev, region, id);
> +}
> +
>Â static inline bool virtio_is_little_endian(struct virtio_device *vdev)
>Â {
>Â Â Â Âreturn virtio_has_feature(vdev, VIRTIO_F_VERSION_1) ||
> --
> 2.26.2
>



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]