Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Michael S. Tsirkin
On Mon, Sep 25, 2023 at 09:40:59PM -0300, Jason Gunthorpe wrote: > On Mon, Sep 25, 2023 at 03:44:11PM -0400, Michael S. Tsirkin wrote: > > > VDPA is very different from this. You might call them both mediation, > > > sure, but then you need another word to describe the additional > > > changes

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Michael S. Tsirkin
On Mon, Sep 25, 2023 at 09:40:59PM -0300, Jason Gunthorpe wrote: > On Mon, Sep 25, 2023 at 03:44:11PM -0400, Michael S. Tsirkin wrote: > > > VDPA is very different from this. You might call them both mediation, > > > sure, but then you need another word to describe the additional > > > changes

RE: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Parav Pandit via Virtualization
> From: Jason Wang > Sent: Tuesday, September 26, 2023 10:08 AM > Right, so if we'd consider migration from virtio to vDPA, it needs to be > designed > in a way that allows more involvement from hypervisor other than coupling it > with a specific interface (like admin virtqueues). It is not

RE: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Parav Pandit via Virtualization
> From: Jason Wang > Sent: Tuesday, September 26, 2023 10:07 AM > > If you can't find a way to make legacy drivers work, use modern. > Understood. This vfio series make the legacy drivers work. Thanks. > That's it. > > Thanks ___

Re: [PATCH 09/16] vdpa/mlx5: Allow creation/deletion of any given mr struct

2023-09-25 Thread Jason Wang
On Tue, Sep 12, 2023 at 9:02 PM Dragos Tatulea wrote: > > This patch adapts the mr creation/deletion code to be able to work with > any given mr struct pointer. All the APIs are adapted to take an extra > parameter for the mr. > > mlx5_vdpa_create/delete_mr doesn't need a ASID parameter anymore.

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Jason Wang
On Mon, Sep 25, 2023 at 8:26 PM Jason Gunthorpe wrote: > > On Mon, Sep 25, 2023 at 10:34:54AM +0800, Jason Wang wrote: > > > > Cloud vendors will similarly use DPUs to create a PCI functions that > > > meet the cloud vendor's internal specification. > > > > This can only work if: > > > > 1) the

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Jason Wang
On Tue, Sep 26, 2023 at 11:45 AM Parav Pandit wrote: > > > > > From: Michael S. Tsirkin > > Sent: Tuesday, September 26, 2023 12:06 AM > > > One can thinkably do that wait in hardware, though. Just defer completion > > until > > read is done. > > > Once OASIS does such new interface and if some

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Jason Wang
On Tue, Sep 26, 2023 at 12:01 PM Parav Pandit wrote: > > > > > From: Jason Wang > > Sent: Tuesday, September 26, 2023 8:03 AM > > > > It's the implementation details in legacy. The device needs to make sure > > (reset) > > the driver can work (is done before get_status return). > It is part of

RE: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Parav Pandit via Virtualization
> From: Jason Wang > Sent: Tuesday, September 26, 2023 8:03 AM > > It's the implementation details in legacy. The device needs to make sure > (reset) > the driver can work (is done before get_status return). It is part of the 0.9.5 and 1.x specification as I quoted those text above.

RE: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Parav Pandit via Virtualization
> From: Michael S. Tsirkin > Sent: Tuesday, September 26, 2023 12:06 AM > One can thinkably do that wait in hardware, though. Just defer completion > until > read is done. > Once OASIS does such new interface and if some hw vendor _actually_ wants to do such complex hw, may be vfio driver

Re: [PATCH 08/16] vdpa/mlx5: Rename mr destroy functions

2023-09-25 Thread Jason Wang
On Tue, Sep 12, 2023 at 9:02 PM Dragos Tatulea wrote: > > Make mlx5_destroy_mr symmetric to mlx5_create_mr. > > Signed-off-by: Dragos Tatulea Acked-by: Jason Wang Thanks > --- > drivers/vdpa/mlx5/core/mlx5_vdpa.h | 4 ++-- > drivers/vdpa/mlx5/core/mr.c| 6 +++--- >

Re: [PATCH 07/16] vdpa/mlx5: Collapse "dvq" mr add/delete functions

2023-09-25 Thread Jason Wang
On Tue, Sep 12, 2023 at 9:02 PM Dragos Tatulea wrote: > > Now that the cvq code is out of mlx5_vdpa_create/destroy_mr, the "dvq" > functions can be folded into their callers. > > Having "dvq" in the naming will no longer be accurate in the downstream > patches. > > Signed-off-by: Dragos Tatulea

Re: [PATCH 06/16] vdpa/mlx5: Take cvq iotlb lock during refresh

2023-09-25 Thread Jason Wang
On Tue, Sep 12, 2023 at 9:02 PM Dragos Tatulea wrote: > > The reslock is taken while refresh is called but iommu_lock is more > specific to this resource. So take the iommu_lock during cvq iotlb > refresh. > > Based on Eugenio's patch [0]. > > [0]

Re: [PATCH 05/16] vdpa/mlx5: Decouple cvq iotlb handling from hw mapping code

2023-09-25 Thread Jason Wang
On Tue, Sep 12, 2023 at 9:02 PM Dragos Tatulea wrote: > > The handling of the cvq iotlb is currently coupled with the creation > and destruction of the hardware mkeys (mr). > > This patch moves cvq iotlb handling into its own function and shifts it > to a scope that is not related to mr handling.

Re: [PATCH 04/16] vdpa/mlx5: Create helper function for dma mappings

2023-09-25 Thread Jason Wang
On Tue, Sep 12, 2023 at 9:02 PM Dragos Tatulea wrote: > > Necessary for upcoming cvq separation from mr allocation. > > Signed-off-by: Dragos Tatulea Acked-by: Jason Wang Thanks > --- > drivers/vdpa/mlx5/core/mlx5_vdpa.h | 1 + > drivers/vdpa/mlx5/core/mr.c| 5 + >

Re: [PATCH] vringh: don't use vringh_kiov_advance() in vringh_iov_xfer()

2023-09-25 Thread Jason Wang
On Mon, Sep 25, 2023 at 6:31 PM Stefano Garzarella wrote: > > In the while loop of vringh_iov_xfer(), `partlen` could be 0 if one of > the `iov` has 0 lenght. > In this case, we should skip the iov and go to the next one. > But calling vringh_kiov_advance() with 0 lenght does not cause the >

Re: [RFC 3/7] vhost: Add 3 new uapi to support iommufd

2023-09-25 Thread Jason Wang
On Sun, Sep 24, 2023 at 1:05 AM Cindy Lu wrote: > > VHOST_VDPA_SET_IOMMU_FD: bind the device to iommufd device > > VDPA_DEVICE_ATTACH_IOMMUFD_AS: Attach a vdpa device to an iommufd > address space specified by IOAS id. > > VDPA_DEVICE_DETACH_IOMMUFD_AS: Detach a vdpa device > from the iommufd

Re: [RFC 1/7] vhost/iommufd: Add the functions support iommufd

2023-09-25 Thread Jason Wang
On Sun, Sep 24, 2023 at 1:05 AM Cindy Lu wrote: > > Add a new file vhost/iommufd.c to support the function of > iommufd, This file contains iommufd function of emulated device and > the physical device. > > Signed-off-by: Cindy Lu > --- > drivers/vhost/iommufd.c | 151

Re: [RFC 5/7] vdpa: Add new vdpa_config_ops

2023-09-25 Thread Jason Wang
On Sun, Sep 24, 2023 at 1:06 AM Cindy Lu wrote: > > Add new vdpa_config_ops to support iommufd > > Signed-off-by: Cindy Lu > --- > include/linux/vdpa.h | 34 +- > 1 file changed, 33 insertions(+), 1 deletion(-) > > diff --git a/include/linux/vdpa.h

Re: [RFC 0/7] vdpa: Add support for iommufd

2023-09-25 Thread Jason Wang
On Sun, Sep 24, 2023 at 1:05 AM Cindy Lu wrote: > > Hi All > Really apologize for the delay, this is the draft RFC for > iommufd support for vdpa, This code provides the basic function > for iommufd support > > The code was tested and passed in device vdpa_sim_net > The qemu code is >

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Zhu, Lingshan
On 9/26/2023 2:36 AM, Michael S. Tsirkin wrote: On Mon, Sep 25, 2023 at 08:26:33AM +, Parav Pandit wrote: From: Jason Wang Sent: Monday, September 25, 2023 8:00 AM On Fri, Sep 22, 2023 at 8:25 PM Parav Pandit wrote: From: Jason Gunthorpe Sent: Friday, September 22, 2023 5:53 PM

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Jason Wang
On Mon, Sep 25, 2023 at 4:26 PM Parav Pandit wrote: > > > > > From: Jason Wang > > Sent: Monday, September 25, 2023 8:00 AM > > > > On Fri, Sep 22, 2023 at 8:25 PM Parav Pandit wrote: > > > > > > > > > > From: Jason Gunthorpe > > > > Sent: Friday, September 22, 2023 5:53 PM > > > > > > > > > >

Re: [PATCH V3] io_uring: fix IO hang in io_wq_put_and_exit from do_exit()

2023-09-25 Thread Ming Lei
On Mon, Sep 25, 2023 at 05:17:10PM -0400, Stefan Hajnoczi wrote: > On Fri, Sep 15, 2023 at 03:04:05PM +0800, Jason Wang wrote: > > On Fri, Sep 8, 2023 at 11:25 PM Ming Lei wrote: > > > > > > On Fri, Sep 08, 2023 at 08:44:45AM -0600, Jens Axboe wrote: > > > > On 9/8/23 8:34 AM, Ming Lei wrote: > >

Re: [PATCH V3] io_uring: fix IO hang in io_wq_put_and_exit from do_exit()

2023-09-25 Thread Stefan Hajnoczi
On Fri, Sep 15, 2023 at 03:04:05PM +0800, Jason Wang wrote: > On Fri, Sep 8, 2023 at 11:25 PM Ming Lei wrote: > > > > On Fri, Sep 08, 2023 at 08:44:45AM -0600, Jens Axboe wrote: > > > On 9/8/23 8:34 AM, Ming Lei wrote: > > > > On Fri, Sep 08, 2023 at 07:49:53AM -0600, Jens Axboe wrote: > > > >>

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Michael S. Tsirkin
On Mon, Sep 25, 2023 at 03:53:18PM -0300, Jason Gunthorpe wrote: > On Mon, Sep 25, 2023 at 02:16:30PM -0400, Michael S. Tsirkin wrote: > > > I do want to understand if there's a use-case that vdpa does not address > > simply because it might be worth while to extend it to do so, and a > > bunch

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Michael S. Tsirkin
On Mon, Sep 25, 2023 at 09:26:07AM -0300, Jason Gunthorpe wrote: > > > So, as I keep saying, in this scenario the goal is no mediation in the > > > hypervisor. > > > > That's pretty fine, but I don't think trapping + relying is not > > mediation. Does it really matter what happens after trapping?

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Michael S. Tsirkin
On Mon, Sep 25, 2023 at 08:26:33AM +, Parav Pandit wrote: > > > > From: Jason Wang > > Sent: Monday, September 25, 2023 8:00 AM > > > > On Fri, Sep 22, 2023 at 8:25 PM Parav Pandit wrote: > > > > > > > > > > From: Jason Gunthorpe > > > > Sent: Friday, September 22, 2023 5:53 PM > > > > >

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Michael S. Tsirkin
On Fri, Sep 22, 2023 at 01:19:28PM -0300, Jason Gunthorpe wrote: > On Fri, Sep 22, 2023 at 11:39:19AM -0400, Michael S. Tsirkin wrote: > > On Fri, Sep 22, 2023 at 09:25:01AM -0300, Jason Gunthorpe wrote: > > > On Fri, Sep 22, 2023 at 11:02:50AM +0800, Jason Wang wrote: > > > > On Fri, Sep 22, 2023

Re: [PATCH 1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by

2023-09-25 Thread Alex Deucher
On Mon, Sep 25, 2023 at 1:52 PM Kees Cook wrote: > > On Mon, Sep 25, 2023 at 08:30:30AM +0200, Christian König wrote: > > Am 22.09.23 um 19:41 schrieb Alex Deucher: > > > On Fri, Sep 22, 2023 at 1:32 PM Kees Cook wrote: > > > > Prepare for the coming implementation by GCC and Clang of the > > >

Re: [PATCH 1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by

2023-09-25 Thread Kees Cook
On Mon, Sep 25, 2023 at 08:30:30AM +0200, Christian König wrote: > Am 22.09.23 um 19:41 schrieb Alex Deucher: > > On Fri, Sep 22, 2023 at 1:32 PM Kees Cook wrote: > > > Prepare for the coming implementation by GCC and Clang of the __counted_by > > > attribute. Flexible array members annotated

Re: [PATCH 3/9] drm/i915/selftests: Annotate struct perf_series with __counted_by

2023-09-25 Thread Kees Cook
On Mon, Sep 25, 2023 at 12:08:36PM +0200, Andrzej Hajda wrote: > > > On 22.09.2023 19:32, Kees Cook wrote: > > Prepare for the coming implementation by GCC and Clang of the __counted_by > > attribute. Flexible array members annotated with __counted_by can have > > their accesses bounds-checked

Re: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Michael S. Tsirkin
On Fri, Sep 22, 2023 at 01:22:33PM -0300, Jason Gunthorpe wrote: > On Fri, Sep 22, 2023 at 11:40:58AM -0400, Michael S. Tsirkin wrote: > > On Fri, Sep 22, 2023 at 12:15:34PM -0300, Jason Gunthorpe wrote: > > > On Fri, Sep 22, 2023 at 11:13:18AM -0400, Michael S. Tsirkin wrote: > > > > On Fri, Sep

Re: [PATCH v2 1/2] iommu/virtio: Make use of ops->iotlb_sync_map

2023-09-25 Thread Robin Murphy
On 2023-09-25 14:29, Jason Gunthorpe wrote: On Mon, Sep 25, 2023 at 02:07:50PM +0100, Robin Murphy wrote: On 2023-09-23 00:33, Jason Gunthorpe wrote: On Fri, Sep 22, 2023 at 07:07:40PM +0100, Robin Murphy wrote: virtio isn't setting ops->pgsize_bitmap for the sake of direct mappings either;

[PATCH v2] MAINTAINERS: Add myself as mlx5_vdpa driver

2023-09-25 Thread Dragos Tatulea via Virtualization
As Eli Cohen moved to other work, I'll be the contact point for mlx5_vdpa. Acked-by: Jason Wang Signed-off-by: Dragos Tatulea --- Changes since v1: - Fix alphabetical sorting. - Make naming consistent with other MELLANOX entries. --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+)

[PATCH] crypto: virtio-crypto: call finalize with bh disabled

2023-09-25 Thread Gonglei (Arei) via Virtualization
Doing ipsec produces a spinlock recursion warning. This is due to not disabling BH during crypto completion function. Fixes: 59ca6c93387d3 ("virtio-crypto: implement RSA algorithm") Reported-by: Halil Pasic Signed-off-by: Gonglei --- drivers/crypto/virtio/virtio_crypto_akcipher_algs.c | 3 ++-

Re: virtio-sound linux driver conformance to spec

2023-09-25 Thread Matias Ezequiel Vara Larsen
On Mon, Sep 25, 2023 at 10:04:33AM +0900, Anton Yakovlev wrote: > Hello Matias, > > On 20.09.2023 22:18, Matias Ezequiel Vara Larsen wrote: > > On Tue, Sep 19, 2023 at 11:52:27AM -0400, Michael S. Tsirkin wrote: > > > On Tue, Sep 19, 2023 at 04:18:57PM +0200, Matias Ezequiel Vara Larsen > > >

Re: [PATCH 1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by

2023-09-25 Thread Alex Deucher
On Mon, Sep 25, 2023 at 10:07 AM Alex Deucher wrote: > > On Mon, Sep 25, 2023 at 2:30 AM Christian König > wrote: > > > > Am 22.09.23 um 19:41 schrieb Alex Deucher: > > > On Fri, Sep 22, 2023 at 1:32 PM Kees Cook wrote: > > >> Prepare for the coming implementation by GCC and Clang of the > >

Re: [PATCH 1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by

2023-09-25 Thread Alex Deucher
On Mon, Sep 25, 2023 at 2:30 AM Christian König wrote: > > Am 22.09.23 um 19:41 schrieb Alex Deucher: > > On Fri, Sep 22, 2023 at 1:32 PM Kees Cook wrote: > >> Prepare for the coming implementation by GCC and Clang of the __counted_by > >> attribute. Flexible array members annotated with

Re: [PATCH v2 1/2] iommu/virtio: Make use of ops->iotlb_sync_map

2023-09-25 Thread Jason Gunthorpe
On Mon, Sep 25, 2023 at 02:07:50PM +0100, Robin Murphy wrote: > On 2023-09-23 00:33, Jason Gunthorpe wrote: > > On Fri, Sep 22, 2023 at 07:07:40PM +0100, Robin Murphy wrote: > > > > > virtio isn't setting ops->pgsize_bitmap for the sake of direct mappings > > > either; it sets it once it's

Re: [PATCH v2 1/2] iommu/virtio: Make use of ops->iotlb_sync_map

2023-09-25 Thread Robin Murphy
On 2023-09-23 00:33, Jason Gunthorpe wrote: On Fri, Sep 22, 2023 at 07:07:40PM +0100, Robin Murphy wrote: virtio isn't setting ops->pgsize_bitmap for the sake of direct mappings either; it sets it once it's discovered any instance, since apparently it's assuming that all instances must support

Re: [PATCH v2 1/2] iommu/virtio: Make use of ops->iotlb_sync_map

2023-09-25 Thread Jason Gunthorpe
On Mon, Sep 25, 2023 at 10:48:21AM +0800, Baolu Lu wrote: > On 9/23/23 7:33 AM, Jason Gunthorpe wrote: > > On Fri, Sep 22, 2023 at 07:07:40PM +0100, Robin Murphy wrote: > > > > > virtio isn't setting ops->pgsize_bitmap for the sake of direct mappings > > > either; it sets it once it's discovered

Re: [PATCH] virtio_console: Annotate struct port_buffer with __counted_by

2023-09-25 Thread Amit Shah
On Fri, 2023-09-22 at 10:51 -0700, Kees Cook wrote: > Prepare for the coming implementation by GCC and Clang of the __counted_by > attribute. Flexible array members annotated with __counted_by can have > their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS > (for array

[PATCH] vringh: don't use vringh_kiov_advance() in vringh_iov_xfer()

2023-09-25 Thread Stefano Garzarella
In the while loop of vringh_iov_xfer(), `partlen` could be 0 if one of the `iov` has 0 lenght. In this case, we should skip the iov and go to the next one. But calling vringh_kiov_advance() with 0 lenght does not cause the advancement, since it returns immediately if asked to advance by 0 bytes.

RE: [PATCH vfio 11/11] vfio/virtio: Introduce a vfio driver over virtio devices

2023-09-25 Thread Parav Pandit via Virtualization
> From: Jason Wang > Sent: Monday, September 25, 2023 8:00 AM > > On Fri, Sep 22, 2023 at 8:25 PM Parav Pandit wrote: > > > > > > > From: Jason Gunthorpe > > > Sent: Friday, September 22, 2023 5:53 PM > > > > > > > > And what's more, using MMIO BAR0 then it can work for legacy. > > > > > >

Re: [PATCH 00/16] vdpa: Add support for vq descriptor mappings

2023-09-25 Thread Dragos Tatulea via Virtualization
On Tue, 2023-09-12 at 16:01 +0300, Dragos Tatulea wrote: > This patch series adds support for vq descriptor table mappings which > are used to improve vdpa live migration downtime. The improvement comes > from using smaller mappings which take less time to create and destroy > in hw. > Gentle

Re: [PATCH 1/9] drm/amd/pm: Annotate struct smu10_voltage_dependency_table with __counted_by

2023-09-25 Thread Christian König via Virtualization
Am 22.09.23 um 19:41 schrieb Alex Deucher: On Fri, Sep 22, 2023 at 1:32 PM Kees Cook wrote: Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via