Re: [PATCH v2 04/23] virtio: Add get_shm_region method
On Thu, Sep 10, 2020 at 2:56 AM Miklos Szeredi wrote: > On Thu, Sep 10, 2020 at 2:28 AM Gurchetan Singh > wrote: > > > That sounds like an excellent plan ! > > > > I will send out blob v3 (incorporating kraxel@'s feedback) once the > topic pull request (it seems Miklos will do this?) for the shm region > patches has been merged into drm-misc-next. > > I split out the three patches into: > > git:// > git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git#virtio-shm Thanks, pull request sent. > > > Thanks, > Miklos > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 04/23] virtio: Add get_shm_region method
On Thu, Sep 10, 2020 at 2:28 AM Gurchetan Singh wrote: > That sounds like an excellent plan ! > > I will send out blob v3 (incorporating kraxel@'s feedback) once the topic > pull request (it seems Miklos will do this?) for the shm region patches has > been merged into drm-misc-next. I split out the three patches into: git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git#virtio-shm Thanks, Miklos ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 04/23] virtio: Add get_shm_region method
On Wed, Sep 9, 2020 at 9:04 AM Gerd Hoffmann wrote: > > On Wed, Sep 02, 2020 at 05:00:25PM -0700, Gurchetan Singh wrote: > > On Wed, Sep 2, 2020 at 3:15 PM Vivek Goyal 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 ?!? > > I guess it would either be merging the fuse tree into drm-misc-next, > or cherry-picking the three virtio shm patches from the fuse tree. Maybe cleanest if we'd do a separate branch for the virtio patches and pull that into both the fuse-next and the drm-misc-next trees? Thanks, Miklos ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 04/23] virtio: Add get_shm_region method
On Wed, Sep 9, 2020 at 2:28 AM Daniel Vetter wrote: > On Wed, Sep 9, 2020 at 11:27 AM Daniel Vetter wrote: > > > > On Wed, Sep 09, 2020 at 09:13:11AM +0200, Miklos Szeredi wrote: > > > On Wed, Sep 9, 2020 at 9:04 AM Gerd Hoffmann > wrote: > > > > > > > > On Wed, Sep 02, 2020 at 05:00:25PM -0700, Gurchetan Singh wrote: > > > > > On Wed, Sep 2, 2020 at 3:15 PM Vivek Goyal > 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 ?!? > > > > > > > > I guess it would either be merging the fuse tree into drm-misc-next, > > > > or cherry-picking the three virtio shm patches from the fuse tree. > > > > > > Maybe cleanest if we'd do a separate branch for the virtio patches and > > > pull that into both the fuse-next and the drm-misc-next trees? > > > > +1 > > > > If the trees are more closely related (e.g. drm and v4l or so) then > > occasionally we just merge patches into one tree with acks from all the > > other maintainers. But topic branch for the common bits feels better > here. > > > > Please send the topic pull request to drm-misc maintainers (Maarten, > > Maxime, Thomas) so they can pull it in. > That sounds like an excellent plan ! I will send out blob v3 (incorporating kraxel@'s feedback) once the topic pull request (it seems Miklos will do this?) for the shm region patches has been merged into drm-misc-next. > > Works better when I add them :-) > -Daniel > > > -- > > Daniel Vetter > > Software Engineer, Intel Corporation > > http://blog.ffwll.ch > > > > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 04/23] virtio: Add get_shm_region method
On Wed, Sep 9, 2020 at 11:27 AM Daniel Vetter wrote: > > On Wed, Sep 09, 2020 at 09:13:11AM +0200, Miklos Szeredi wrote: > > On Wed, Sep 9, 2020 at 9:04 AM Gerd Hoffmann wrote: > > > > > > On Wed, Sep 02, 2020 at 05:00:25PM -0700, Gurchetan Singh wrote: > > > > On Wed, Sep 2, 2020 at 3:15 PM Vivek Goyal 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 ?!? > > > > > > I guess it would either be merging the fuse tree into drm-misc-next, > > > or cherry-picking the three virtio shm patches from the fuse tree. > > > > Maybe cleanest if we'd do a separate branch for the virtio patches and > > pull that into both the fuse-next and the drm-misc-next trees? > > +1 > > If the trees are more closely related (e.g. drm and v4l or so) then > occasionally we just merge patches into one tree with acks from all the > other maintainers. But topic branch for the common bits feels better here. > > Please send the topic pull request to drm-misc maintainers (Maarten, > Maxime, Thomas) so they can pull it in. Works better when I add them :-) -Daniel > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 04/23] virtio: Add get_shm_region method
On Wed, Sep 09, 2020 at 09:13:11AM +0200, Miklos Szeredi wrote: > On Wed, Sep 9, 2020 at 9:04 AM Gerd Hoffmann wrote: > > > > On Wed, Sep 02, 2020 at 05:00:25PM -0700, Gurchetan Singh wrote: > > > On Wed, Sep 2, 2020 at 3:15 PM Vivek Goyal 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 ?!? > > > > I guess it would either be merging the fuse tree into drm-misc-next, > > or cherry-picking the three virtio shm patches from the fuse tree. > > Maybe cleanest if we'd do a separate branch for the virtio patches and > pull that into both the fuse-next and the drm-misc-next trees? +1 If the trees are more closely related (e.g. drm and v4l or so) then occasionally we just merge patches into one tree with acks from all the other maintainers. But topic branch for the common bits feels better here. Please send the topic pull request to drm-misc maintainers (Maarten, Maxime, Thomas) so they can pull it in. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 04/23] virtio: Add get_shm_region method
On Wed, Sep 02, 2020 at 05:00:25PM -0700, Gurchetan Singh wrote: > On Wed, Sep 2, 2020 at 3:15 PM Vivek Goyal 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 ?!? I guess it would either be merging the fuse tree into drm-misc-next, or cherry-picking the three virtio shm patches from the fuse tree. Daniel? What is the usual way to handle this? thanks, Gerd ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 04/23] virtio: Add get_shm_region method
On Wed, Sep 2, 2020 at 3:15 PM Vivek Goyal 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 > > > > 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 > > Signed-off-by: Dr. David Alan Gilbert > > Acked-by: Michael S. Tsirkin > > Cc: k...@vger.kernel.org > > Cc: virtualizat...@lists.linux-foundation.org > > Cc: "Michael S. Tsirkin" > > --- > > 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 > > > > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 04/23] virtio: Add get_shm_region method
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 Thanks Vivek On Wed, Sep 02, 2020 at 02:08:28PM -0700, Gurchetan Singh wrote: > From: Sebastien Boeuf > > 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 > Signed-off-by: Dr. David Alan Gilbert > Acked-by: Michael S. Tsirkin > Cc: k...@vger.kernel.org > Cc: virtualizat...@lists.linux-foundation.org > Cc: "Michael S. Tsirkin" > --- > 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 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v2 04/23] virtio: Add get_shm_region method
From: Sebastien Boeuf 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 Signed-off-by: Dr. David Alan Gilbert Acked-by: Michael S. Tsirkin Cc: k...@vger.kernel.org Cc: virtualizat...@lists.linux-foundation.org Cc: "Michael S. Tsirkin" --- 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 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel