Re: [PATCH v3] drm/virtio: add new virtio gpu capset definitions

2023-10-18 Thread Gurchetan Singh
On Tue, Oct 10, 2023 at 9:41 PM Huang Rui wrote: > On Tue, Oct 10, 2023 at 11:52:14PM +0800, Dmitry Osipenko wrote: > > On 10/10/23 18:40, Dmitry Osipenko wrote: > > > On 10/10/23 16:57, Huang Rui wrote: > > >> These definitions are used fro qemu, and qemu imports this marco in > the > > >>

[PATCH v3 4/5] vdpa/mlx5: implement .reset_map driver op

2023-10-18 Thread Si-Wei Liu
Since commit 6f5312f80183 ("vdpa/mlx5: Add support for running with virtio_vdpa"), mlx5_vdpa starts with preallocate 1:1 DMA MR at device creation time. This 1:1 DMA MR will be implicitly destroyed while the first .set_map call is invoked, in which case callers like vhost-vdpa will start to set up

[PATCH v3 2/5] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-18 Thread Si-Wei Liu
Devices with on-chip IOMMU or vendor specific IOTLB implementation may need to restore iotlb mapping to the initial or default state using the .reset_map op, as it's desirable for some parent devices to solely manipulate mappings by its own, independent of virtio device state. For instance, device

[PATCH v3 3/5] vhost-vdpa: introduce IOTLB_PERSIST backend feature bit

2023-10-18 Thread Si-Wei Liu
Userspace needs this feature flag to distinguish if vhost-vdpa iotlb in the kernel can be trusted to persist IOTLB mapping across vDPA reset. Without it, userspace has no way to tell apart if it's running on an older kernel, which could silently drop all iotlb mapping across vDPA reset, especially

[PATCH v3 1/5] vdpa: introduce .reset_map operation callback

2023-10-18 Thread Si-Wei Liu
Device specific IOMMU parent driver who wishes to see mapping to be decoupled from virtio or vdpa device life cycle (device reset) can use it to restore memory mapping in the device IOMMU to the initial or default state. The reset of mapping is done per address space basis. The reason why a

[PATCH v3 0/4] vdpa: decouple reset of iotlb mapping from device reset

2023-10-18 Thread Si-Wei Liu
In order to reduce needlessly high setup and teardown cost of iotlb mapping during live migration, it's crucial to decouple the vhost-vdpa iotlb abstraction from the virtio device life cycle, i.e. iotlb mappings should be left intact across virtio device reset [1]. For it to work, the on-chip

[PATCH v3 5/5] vdpa_sim: implement .reset_map support

2023-10-18 Thread Si-Wei Liu
In order to reduce excessive memory mapping cost in live migration and VM reboot, it is desirable to decouple the vhost-vdpa IOTLB abstraction from the virtio device life cycle, i.e. mappings can be kept intact across virtio device reset. Leverage the .reset_map callback, which is meant to destroy

Re: [virtio-comment] Re: virtio-sound: release control request clarification

2023-10-18 Thread Anton Yakovlev via Virtualization
Hi Matias, On 18.10.2023 22:30, Matias Ezequiel Vara Larsen wrote: Hello Anton, thanks for the response. I added some inline comments. On Wed, Oct 18, 2023 at 10:06:05AM +0900, Anton Yakovlev wrote: Hi Matias, On 18.10.2023 00:19, Matias Ezequiel Vara Larsen wrote: Hello, This email is

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-18 Thread Si-Wei Liu
On 10/18/2023 4:14 AM, Eugenio Perez Martin wrote: On Wed, Oct 18, 2023 at 10:44 AM Si-Wei Liu wrote: On 10/17/2023 10:27 PM, Jason Wang wrote: On Wed, Oct 18, 2023 at 12:36 PM Si-Wei Liu wrote: On 10/16/2023 7:35 PM, Jason Wang wrote: On Tue, Oct 17, 2023 at 4:30 AM Si-Wei Liu

Re: [RFC v2 PATCH] vdpa_sim: implement .reset_map support

2023-10-18 Thread Si-Wei Liu
On 10/18/2023 1:05 AM, Stefano Garzarella wrote: On Tue, Oct 17, 2023 at 10:11:33PM -0700, Si-Wei Liu wrote: RFC only. Not tested on vdpa-sim-blk with user virtual address. Works fine with vdpa-sim-net which uses physical address to map. This patch is based on top of [1]. [1]

Re: [PATCH v2] ALSA: virtio: use copy and fill_silence callbacks

2023-10-18 Thread Anton Yakovlev via Virtualization
Hi Takashi, On 19.10.2023 03:07, Takashi Iwai wrote: On Wed, 18 Oct 2023 12:48:23 +0200, Matias Ezequiel Vara Larsen wrote: This commit replaces the mmap mechanism with the copy() and fill_silence() callbacks for both capturing and playback for the virtio-sound driver. This change is required

Re: [PATCH v2] powerpc/paravirt: Improve vcpu_is_preempted

2023-10-18 Thread Michael Ellerman
Hi Srikar, Srikar Dronamraju writes: > PowerVM Hypervisor dispatches on a whole core basis. In a shared LPAR, a > CPU from a core that is CEDED or preempted may have a larger latency. In > such a scenario, its preferable to choose a different CPU to run. > > If one of the CPUs in the core is

Re: [PATCH v2 3/6] powerpc/smp: Move shared_processor static key to smp.h

2023-10-18 Thread Michael Ellerman
Srikar Dronamraju writes: > The ability to detect if the system is running in a shared processor > mode is helpful in few more generic cases not just in > paravirtualization. > For example: At boot time, different scheduler/ topology flags may be > set based on the processor mode. Hence move it

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-18 Thread Jason Wang
On Thu, Oct 19, 2023 at 7:21 AM Si-Wei Liu wrote: > > > > On 10/18/2023 4:14 AM, Eugenio Perez Martin wrote: > > On Wed, Oct 18, 2023 at 10:44 AM Si-Wei Liu wrote: > >> > >> > >> On 10/17/2023 10:27 PM, Jason Wang wrote: > >>> On Wed, Oct 18, 2023 at 12:36 PM Si-Wei Liu wrote: > > On

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-18 Thread Jason Wang
On Wed, Oct 18, 2023 at 4:49 PM Si-Wei Liu wrote: > > > > On 10/18/2023 12:00 AM, Jason Wang wrote: > >> Unfortunately, it's a must to stick to ABI. I agree it's a mess but we > >> don't have a better choice. Or we can fail the probe if userspace > >> doesn't ack this feature. > > Antoher idea we

[PATCH v4] virtio_pci: add check for common cfg size

2023-10-18 Thread Xuan Zhuo
Some buggy devices, the common cfg size may not match the features. This patch checks the common cfg size for the features(VIRTIO_F_NOTIF_CONFIG_DATA, VIRTIO_F_RING_RESET). When the common cfg size does not match the corresponding feature, we fail the probe and print error message.

Re: [PATCH net-next v1 01/19] virtio_net: rename free_old_xmit_skbs to free_old_xmit

2023-10-18 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:00 PM Xuan Zhuo wrote: > > Since free_old_xmit_skbs not only deals with skb, but also xdp frame and > subsequent added xsk, so change the name of this function to > free_old_xmit. > > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang Thanks > --- >

Re: [PATCH net-next v1 02/19] virtio_net: unify the code for recycling the xmit ptr

2023-10-18 Thread Jason Wang
On Mon, Oct 16, 2023 at 8:00 PM Xuan Zhuo wrote: > > There are two completely similar and independent implementations. This > is inconvenient for the subsequent addition of new types. So extract a > function from this piece of code and call this function uniformly to > recover old xmit ptr. > >

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-18 Thread Jason Wang
On Wed, Oct 18, 2023 at 1:27 PM Jason Wang wrote: > > On Wed, Oct 18, 2023 at 12:36 PM Si-Wei Liu wrote: > > > > > > > > On 10/16/2023 7:35 PM, Jason Wang wrote: > > > On Tue, Oct 17, 2023 at 4:30 AM Si-Wei Liu wrote: > > >> > > >> > > >> On 10/16/2023 4:28 AM, Eugenio Perez Martin wrote: > >

Re: [PATCH vhost 02/22] virtio_ring: introduce virtqueue_dma_[un]map_page_attrs

2023-10-18 Thread Xuan Zhuo
On Wed, 18 Oct 2023 03:59:03 -0400, "Michael S. Tsirkin" wrote: > On Wed, Oct 18, 2023 at 03:53:00PM +0800, Xuan Zhuo wrote: > > Hi Michael, > > > > Do you think it's appropriate to push the first two patches of this patch > > set to > > linux 6.6? > > > > Thanks. > > I generally treat

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

2023-10-18 Thread Yishai Hadas via Virtualization
On 17/10/2023 23:24, Alex Williamson wrote: On Tue, 17 Oct 2023 16:42:17 +0300 Yishai Hadas wrote: +static int virtiovf_pci_probe(struct pci_dev *pdev, + const struct pci_device_id *id) +{ + const struct vfio_device_ops *ops = _acc_vfio_pci_ops; + struct

Re: [PATCH vhost 02/22] virtio_ring: introduce virtqueue_dma_[un]map_page_attrs

2023-10-18 Thread Michael S. Tsirkin
On Wed, Oct 18, 2023 at 04:57:21PM +0800, Xuan Zhuo wrote: > On Wed, 18 Oct 2023 04:44:24 -0400, "Michael S. Tsirkin" > wrote: > > On Wed, Oct 18, 2023 at 04:00:22PM +0800, Xuan Zhuo wrote: > > > On Wed, 18 Oct 2023 03:59:03 -0400, "Michael S. Tsirkin" > > > wrote: > > > > On Wed, Oct 18, 2023

Re: [PATCH vhost 02/22] virtio_ring: introduce virtqueue_dma_[un]map_page_attrs

2023-10-18 Thread Michael S. Tsirkin
On Wed, Oct 18, 2023 at 03:53:00PM +0800, Xuan Zhuo wrote: > Hi Michael, > > Do you think it's appropriate to push the first two patches of this patch set > to > linux 6.6? > > Thanks. I see this is with the eye towards merging this gradually. However, I want the patchset to be ready first,

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-18 Thread Si-Wei Liu
On 10/17/2023 10:27 PM, Jason Wang wrote: On Wed, Oct 18, 2023 at 12:36 PM Si-Wei Liu wrote: On 10/16/2023 7:35 PM, Jason Wang wrote: On Tue, Oct 17, 2023 at 4:30 AM Si-Wei Liu wrote: On 10/16/2023 4:28 AM, Eugenio Perez Martin wrote: On Mon, Oct 16, 2023 at 8:33 AM Jason Wang wrote:

Re: [PATCH vhost 02/22] virtio_ring: introduce virtqueue_dma_[un]map_page_attrs

2023-10-18 Thread Michael S. Tsirkin
On Wed, Oct 18, 2023 at 04:00:22PM +0800, Xuan Zhuo wrote: > On Wed, 18 Oct 2023 03:59:03 -0400, "Michael S. Tsirkin" > wrote: > > On Wed, Oct 18, 2023 at 03:53:00PM +0800, Xuan Zhuo wrote: > > > Hi Michael, > > > > > > Do you think it's appropriate to push the first two patches of this patch >

Re: [PATCH vhost 02/22] virtio_ring: introduce virtqueue_dma_[un]map_page_attrs

2023-10-18 Thread Michael S. Tsirkin
On Wed, Oct 18, 2023 at 03:53:00PM +0800, Xuan Zhuo wrote: > Hi Michael, > > Do you think it's appropriate to push the first two patches of this patch set > to > linux 6.6? > > Thanks. I generally treat patchsets as a whole unless someone asks me to do otherwise. Why do you want this? -- MST

Re: [RFC v2 PATCH] vdpa_sim: implement .reset_map support

2023-10-18 Thread Stefano Garzarella
On Tue, Oct 17, 2023 at 10:11:33PM -0700, Si-Wei Liu wrote: RFC only. Not tested on vdpa-sim-blk with user virtual address. Works fine with vdpa-sim-net which uses physical address to map. This patch is based on top of [1]. [1]

Re: [PATCH 2/4] vhost-vdpa: reset vendor specific mapping to initial state in .release

2023-10-18 Thread Si-Wei Liu
On 10/18/2023 12:00 AM, Jason Wang wrote: Unfortunately, it's a must to stick to ABI. I agree it's a mess but we don't have a better choice. Or we can fail the probe if userspace doesn't ack this feature. Antoher idea we can just do the following in vhost_vdpa reset? config->reset() if

Re: [PATCH vhost 02/22] virtio_ring: introduce virtqueue_dma_[un]map_page_attrs

2023-10-18 Thread Xuan Zhuo
On Wed, 18 Oct 2023 04:44:24 -0400, "Michael S. Tsirkin" wrote: > On Wed, Oct 18, 2023 at 04:00:22PM +0800, Xuan Zhuo wrote: > > On Wed, 18 Oct 2023 03:59:03 -0400, "Michael S. Tsirkin" > > wrote: > > > On Wed, Oct 18, 2023 at 03:53:00PM +0800, Xuan Zhuo wrote: > > > > Hi Michael, > > > > > >

Re: [PATCH vhost 02/22] virtio_ring: introduce virtqueue_dma_[un]map_page_attrs

2023-10-18 Thread Xuan Zhuo
On Wed, 18 Oct 2023 05:13:44 -0400, "Michael S. Tsirkin" wrote: > On Wed, Oct 18, 2023 at 04:57:21PM +0800, Xuan Zhuo wrote: > > On Wed, 18 Oct 2023 04:44:24 -0400, "Michael S. Tsirkin" > > wrote: > > > On Wed, Oct 18, 2023 at 04:00:22PM +0800, Xuan Zhuo wrote: > > > > On Wed, 18 Oct 2023

Re: [PATCH vhost 02/22] virtio_ring: introduce virtqueue_dma_[un]map_page_attrs

2023-10-18 Thread Xuan Zhuo
Hi Michael, Do you think it's appropriate to push the first two patches of this patch set to linux 6.6? Thanks. On Wed, 11 Oct 2023 17:27:08 +0800, Xuan Zhuo wrote: > Introduce virtqueue_dma_[un]map_page_attrs() to do dma/unmap for pages. > > Signed-off-by: Xuan Zhuo > --- >

Re: [PATCH 0/2] vdpa: Add logging operatins

2023-10-18 Thread Michael S. Tsirkin
On Mon, Sep 11, 2023 at 02:56:58PM +0800, Jason Wang wrote: > Adding Eugenio and Si Wei. > > On Sat, Aug 26, 2023 at 9:24 AM Jiang Dongxu wrote: > > > > From: jiangdongxu > > > > Currently, the vdpa device supports suspend and resume operations. > > To support vdpa device live migration, we

Re: [PATCH v2 3/4] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-10-18 Thread Juergen Gross via Virtualization
On 18.10.23 13:34, Ingo Molnar wrote: * Juergen Gross wrote: On 16.10.23 16:29, Peter Zijlstra wrote: On Mon, Oct 16, 2023 at 02:39:32PM +0200, Juergen Gross wrote: Instead of stacking alternative and paravirt patching, use the new ALT_FLAG_CALL flag to switch those mixed calls to pure

[PATCH v2] ALSA: virtio: use copy and fill_silence callbacks

2023-10-18 Thread Matias Ezequiel Vara Larsen
This commit replaces the mmap mechanism with the copy() and fill_silence() callbacks for both capturing and playback for the virtio-sound driver. This change is required to prevent the updating of the content of a buffer that is already in the available ring. The current mechanism splits a dma

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

2023-10-18 Thread Alex Williamson
On Wed, 18 Oct 2023 12:01:57 +0300 Yishai Hadas wrote: > On 17/10/2023 23:24, Alex Williamson wrote: > > On Tue, 17 Oct 2023 16:42:17 +0300 > > Yishai Hadas wrote: > >> +static int virtiovf_pci_probe(struct pci_dev *pdev, > >> +const struct pci_device_id *id) > >> +{ >

Re: [virtio-comment] Re: virtio-sound: release control request clarification

2023-10-18 Thread Matias Ezequiel Vara Larsen
Hello Anton, thanks for the response. I added some inline comments. On Wed, Oct 18, 2023 at 10:06:05AM +0900, Anton Yakovlev wrote: > Hi Matias, > > > On 18.10.2023 00:19, Matias Ezequiel Vara Larsen wrote: > > Hello, > > > > This email is to clarify the VirtIO specification regarding the

Re: [PATCH v2 3/4] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-10-18 Thread Ingo Molnar
* Juergen Gross wrote: > On 16.10.23 16:29, Peter Zijlstra wrote: > > On Mon, Oct 16, 2023 at 02:39:32PM +0200, Juergen Gross wrote: > > > Instead of stacking alternative and paravirt patching, use the new > > > ALT_FLAG_CALL flag to switch those mixed calls to pure alternative > > > handling.

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

2023-10-18 Thread Parav Pandit via Virtualization
> From: Alex Williamson > Sent: Wednesday, October 18, 2023 6:22 PM > Are we realistically extending this beyond virtio-net? Maybe all the > descriptions > should be limited to what is actually supported as proposed rather than > aspirational goals. Thanks, Virtio blk would the second user

Re: [PATCH v2] ALSA: virtio: use copy and fill_silence callbacks

2023-10-18 Thread kernel test robot
Hi Matias, kernel test robot noticed the following build warnings: [auto build test WARNING on 8a749fd1a8720d4619c91c8b6e7528c0a355c0aa] url: https://github.com/intel-lab-lkp/linux/commits/Matias-Ezequiel-Vara-Larsen/ALSA-virtio-use-copy-and-fill_silence-callbacks/20231018-185108 base

Re: [PATCH vhost v3 3/4] virtio_pci: add check for common cfg size

2023-10-18 Thread Michael S. Tsirkin
On Tue, Oct 10, 2023 at 11:11:19AM +0800, Xuan Zhuo wrote: > Some buggy devices, the common cfg size may not match the features. > > This patch checks the common cfg size for the > features(VIRTIO_F_NOTIF_CONFIG_DATA, VIRTIO_F_RING_RESET). When the > common cfg size does not match the

[mst-vhost:vhost 18/35] drivers/virtio/virtio_pci_modern.c:54:17: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' {aka 'unsigned int'}

2023-10-18 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost head: 185ec99c107fe7659a9d809bc7a8e7ab3c338bf9 commit: 37c82be3988d4cc710dee436d47cd80e792cab93 [18/35] virtio_pci: add check for common cfg size config: parisc-allyesconfig

[PATCH RFC 1/1] x86/paravirt: introduce param to disable pv sched_clock

2023-10-18 Thread Dongli Zhang
As mentioned in the linux kernel development document, "sched_clock() is used for scheduling and timestamping". While there is a default native implementation, many paravirtualizations have their own implementations. About KVM, it uses kvm_sched_clock_read() and there is no way to only disable

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

2023-10-18 Thread Michael S. Tsirkin
On Wed, Oct 18, 2023 at 08:14:39PM +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. > >

Re: [PATCH vhost v4 12/16] vdpa/mlx5: Improve mr update flow

2023-10-18 Thread Dragos Tatulea via Virtualization
On Wed, 2023-10-18 at 20:14 +0300, Dragos Tatulea wrote: > The current flow for updating an mr works directly on mvdev->mr which > makes it cumbersome to handle multiple new mr structs. > > This patch makes the flow more straightforward by having > mlx5_vdpa_create_mr return a new mr which will

[PATCH vhost v4 10/16] vdpa/mlx5: Allow creation/deletion of any given mr struct

2023-10-18 Thread Dragos Tatulea via Virtualization
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. The check is done in the caller instead (mlx5_set_map). This

[PATCH vhost v4 07/16] vdpa/mlx5: Take cvq iotlb lock during refresh

2023-10-18 Thread Dragos Tatulea via Virtualization
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] https://lore.kernel.org/lkml/20230112142218.725622-4-epere...@redhat.com/ Acked-by: Jason Wang Suggested-by: Eugenio

[PATCH vhost v4 11/16] vdpa/mlx5: Move mr mutex out of mr struct

2023-10-18 Thread Dragos Tatulea via Virtualization
The mutex is named like it is supposed to protect only the mkey but in reality it is a global lock for all mr resources. Shift the mutex to it's rightful location (struct mlx5_vdpa_dev) and give it a more appropriate name. Signed-off-by: Dragos Tatulea Acked-by: Eugenio Pérez Acked-by: Jason

[PATCH vhost v4 13/16] vdpa/mlx5: Introduce mr for vq descriptor

2023-10-18 Thread Dragos Tatulea via Virtualization
Introduce the vq descriptor group and mr per ASID. Until now .set_map on ASID 1 was only updating the cvq iotlb. From now on it also creates a mkey for it. The current patch doesn't use it but follow-up patches will add hardware support for mapping the vq descriptors. Acked-by: Jason Wang

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

2023-10-18 Thread Dragos Tatulea via Virtualization
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. The first part adds the vdpa core changes from Si-Wei [0]. The second part

[PATCH vhost v4 01/16] vdpa/mlx5: Expose descriptor group mkey hw capability

2023-10-18 Thread Dragos Tatulea via Virtualization
Necessary for improved live migration flow. Actual support will be added in a downstream patch. Signed-off-by: Dragos Tatulea Reviewed-by: Gal Pressman --- include/linux/mlx5/mlx5_ifc.h | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/mlx5/mlx5_ifc.h

[PATCH vhost v4 02/16] vdpa: introduce dedicated descriptor group for virtqueue

2023-10-18 Thread Dragos Tatulea via Virtualization
From: Si-Wei Liu In some cases, the access to the virtqueue's descriptor area, device and driver areas (precluding indirect descriptor table in guest memory) may have to be confined to a different address space than where its buffers reside. Without loss of simplicity and generality with already

[PATCH vhost v4 16/16] vdpa/mlx5: Update cvq iotlb mapping on ASID change

2023-10-18 Thread Dragos Tatulea via Virtualization
For the following sequence: - cvq group is in ASID 0 - .set_map(1, cvq_iotlb) - .set_group_asid(cvq_group, 1) ... the cvq mapping from ASID 0 will be used. This is not always correct behaviour. This patch adds support for the above mentioned flow by saving the iotlb on each .set_map and updating

[PATCH vhost v4 12/16] vdpa/mlx5: Improve mr update flow

2023-10-18 Thread Dragos Tatulea via Virtualization
The current flow for updating an mr works directly on mvdev->mr which makes it cumbersome to handle multiple new mr structs. This patch makes the flow more straightforward by having mlx5_vdpa_create_mr return a new mr which will update the old mr (if any). The old mr will be deleted and unlinked

[PATCH vhost v4 14/16] vdpa/mlx5: Enable hw support for vq descriptor mapping

2023-10-18 Thread Dragos Tatulea via Virtualization
Vq descriptor mappings are supported in hardware by filling in an additional mkey which contains the descriptor mappings to the hw vq. A previous patch in this series added support for hw mkey (mr) creation for ASID 1. This patch fills in both the vq data and vq descriptor mkeys based on group

[PATCH vhost v4 04/16] vhost-vdpa: uAPI to get dedicated descriptor group id

2023-10-18 Thread Dragos Tatulea via Virtualization
From: Si-Wei Liu With _F_DESC_ASID backend feature, the device can now support the VHOST_VDPA_GET_VRING_DESC_GROUP ioctl, and it may expose the descriptor table (including avail and used ring) in a different group than the buffers it contains. This new uAPI will fetch the group ID of the

[PATCH vhost v4 06/16] vdpa/mlx5: Decouple cvq iotlb handling from hw mapping code

2023-10-18 Thread Dragos Tatulea via Virtualization
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. As cvq handling is just a prune_iotlb + dup_iotlb cycle, put it

[PATCH vhost v4 08/16] vdpa/mlx5: Collapse "dvq" mr add/delete functions

2023-10-18 Thread Dragos Tatulea via Virtualization
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. Acked-by: Jason Wang Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea ---

[PATCH vhost v4 09/16] vdpa/mlx5: Rename mr destroy functions

2023-10-18 Thread Dragos Tatulea via Virtualization
Make mlx5_destroy_mr symmetric to mlx5_create_mr. Acked-by: Jason Wang Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea --- drivers/vdpa/mlx5/core/mlx5_vdpa.h | 4 ++-- drivers/vdpa/mlx5/core/mr.c| 6 +++--- drivers/vdpa/mlx5/net/mlx5_vnet.c | 12 ++-- 3 files changed,

[PATCH vhost v4 05/16] vdpa/mlx5: Create helper function for dma mappings

2023-10-18 Thread Dragos Tatulea via Virtualization
Necessary for upcoming cvq separation from mr allocation. Acked-by: Jason Wang Signed-off-by: Dragos Tatulea --- drivers/vdpa/mlx5/core/mlx5_vdpa.h | 1 + drivers/vdpa/mlx5/core/mr.c| 5 + drivers/vdpa/mlx5/net/mlx5_vnet.c | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-)

[PATCH vhost v4 03/16] vhost-vdpa: introduce descriptor group backend feature

2023-10-18 Thread Dragos Tatulea via Virtualization
From: Si-Wei Liu Userspace knows if the device has dedicated descriptor group or not by checking this feature bit. It's only exposed if the vdpa driver backend implements the .get_vq_desc_group() operation callback. Userspace trying to negotiate this feature when it or the dependent

[PATCH vhost v4 15/16] vdpa/mlx5: Make iotlb helper functions more generic

2023-10-18 Thread Dragos Tatulea via Virtualization
They will be used in a follow-up patch. For dup_iotlb, avoid the src == dst case. This is an error. Acked-by: Jason Wang Acked-by: Eugenio Pérez Signed-off-by: Dragos Tatulea --- drivers/vdpa/mlx5/core/mr.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff

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

2023-10-18 Thread Alex Williamson
On Wed, 18 Oct 2023 13:33:33 -0300 Jason Gunthorpe wrote: > On Tue, Oct 17, 2023 at 02:24:48PM -0600, Alex Williamson wrote: > > On Tue, 17 Oct 2023 16:42:17 +0300 > > Yishai Hadas wrote: > > > +static int virtiovf_pci_probe(struct pci_dev *pdev, > > > + const struct