Re: [PATCH V4 1/7] vDPA/ifcvf: get_vendor_id returns a device specific vendor id

2021-03-16 Thread Jason Wang
在 2021/3/15 下午3:44, Zhu Lingshan 写道: In this commit, ifcvf_get_vendor_id() will return a device specific vendor id of the probed pci device than a hard code. Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 5 - 1 file changed, 4

Re: [PATCH V4 4/7] vDPA/ifcvf: remove the version number string

2021-03-16 Thread Jason Wang
在 2021/3/15 下午3:44, Zhu Lingshan 写道: This commit removes the version number string, using kernel version is enough. Signed-off-by: Zhu Lingshan Reviewed-by: Leon Romanovsky Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git

Re: [PATCH V4 3/7] vDPA/ifcvf: rename original IFCVF dev ids to N3000 ids

2021-03-16 Thread Jason Wang
在 2021/3/15 下午3:44, Zhu Lingshan 写道: IFCVF driver probes multiple types of devices now, to distinguish the original device driven by IFCVF from others, it is renamed as "N3000". Signed-off-by: Zhu Lingshan Acked-by: Jason Wang If you want to have a general driver, you probaby need to

Re: [PATCH V4 2/7] vDPA/ifcvf: enable Intel C5000X-PL virtio-net for vDPA

2021-03-16 Thread Jason Wang
在 2021/3/15 下午3:44, Zhu Lingshan 写道: This commit enabled Intel FPGA SmartNIC C5000X-PL virtio-net for vDPA Signed-off-by: Zhu Lingshan Acked-by: Jason Wang --- drivers/vdpa/ifcvf/ifcvf_base.h | 5 + drivers/vdpa/ifcvf/ifcvf_main.c | 5 + 2 files changed, 10 insertions(+)

Re: [RFC v2 13/13] vhost: Use VRING_AVAIL_F_NO_INTERRUPT at device call on shadow virtqueue

2021-03-16 Thread Jason Wang
在 2021/3/16 上午3:48, Eugenio Pérez 写道: Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.c | 28 +++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c index

Re: [RFC PATCH v6 00/22] virtio/vsock: introduce SOCK_SEQPACKET support

2021-03-16 Thread Stefano Garzarella
On Tue, Mar 16, 2021 at 06:37:31AM +0300, Arseny Krasnov wrote: On 15.03.2021 18:22, Arseny Krasnov wrote: On 15.03.2021 14:40, Stefano Garzarella wrote: Hi Arseny, On Sun, Mar 07, 2021 at 08:57:19PM +0300, Arseny Krasnov wrote: This patchset implements support of SOCK_SEQPACKET for

Re: [RFC v2 05/13] vhost: Route guest->host notification through shadow virtqueue

2021-03-16 Thread Jason Wang
在 2021/3/16 上午3:48, Eugenio Pérez 写道: Shadow virtqueue notifications forwarding is disabled when vhost_dev stops, so code flow follows usual cleanup. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 7 ++ include/hw/virtio/vhost.h | 4 +

Re: [RFC v2 11/13] vhost: Shadow virtqueue buffers forwarding

2021-03-16 Thread Jason Wang
在 2021/3/16 上午3:48, Eugenio Pérez 写道: Initial version of shadow virtqueue that actually forward buffers. It reuses the VirtQueue code for the device part. The driver part is based on Linux's virtio_ring driver, but with stripped functionality and optimizations so it's easier to review. These

Re: [RFC v2 10/13] vhost: add vhost_kernel_set_vring_enable

2021-03-16 Thread Jason Wang
在 2021/3/16 上午3:48, Eugenio Pérez 写道: This method is already present in vhost-user. This commit adapts it to vhost-net, so SVQ can use. vhost_kernel_set_enable stops the device, so qemu can ask for its status (next available idx the device was going to consume). When SVQ starts it can resume

Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants

2021-03-16 Thread Cornelia Huck
On Tue, 16 Mar 2021 06:35:11 +0300 Arseny Krasnov wrote: > On 15.03.2021 18:53, Cornelia Huck wrote: > > On Mon, 15 Mar 2021 11:35:41 +0300 > > Arseny Krasnov wrote: > > > >> This replaces constants defined in "bit X set to Y" manner > >> with enums from Linux kernel uapi headers. > >> --- >

Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants

2021-03-16 Thread Stefano Garzarella
On Tue, Mar 16, 2021 at 06:35:11AM +0300, Arseny Krasnov wrote: On 15.03.2021 18:53, Cornelia Huck wrote: On Mon, 15 Mar 2021 11:35:41 +0300 Arseny Krasnov wrote: This replaces constants defined in "bit X set to Y" manner with enums from Linux kernel uapi headers. --- virtio-vsock.tex | 29

Re: [RFC v2 00/13] vDPA software assisted live migration

2021-03-16 Thread Jason Wang
在 2021/3/16 上午3:48, Eugenio Pérez 写道: This series enable shadow virtqueue for vhost-net devices. This is a new method of vhost devices migration: Instead of relay on vhost device's dirty logging capability, SW assisted LM intercepts dataplane, forwarding the descriptors between VM and device.

Re: [RFC v2 08/13] virtio: Add vhost_shadow_vq_get_vring_addr

2021-03-16 Thread Jason Wang
在 2021/3/16 上午3:48, Eugenio Pérez 写道: It reports the shadow virtqueue address from qemu virtual address space Note that to be used by vDPA, we can't use qemu VA directly here. Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.h | 2 ++

Re: [RFC v2 12/13] vhost: Check for device VRING_USED_F_NO_NOTIFY at shadow virtqueue kick

2021-03-16 Thread Jason Wang
在 2021/3/16 上午3:48, Eugenio Pérez 写道: Signed-off-by: Eugenio Pérez --- hw/virtio/vhost-shadow-virtqueue.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/hw/virtio/vhost-shadow-virtqueue.c b/hw/virtio/vhost-shadow-virtqueue.c index 68ed0f2740..7df98fc43f

Re: [PATCH 14/17] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-16 Thread Robin Murphy
On 2021-03-15 08:33, Christoph Hellwig wrote: On Fri, Mar 12, 2021 at 04:18:24PM +, Robin Murphy wrote: Let me know what you think of the version here: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/iommu-cleanup I'll happily switch the patch to you as the author if

Re: [virtio-comment] Re: [RFC PATCH v1 0/1] virtio-vsock: introduce SEQPACKET description

2021-03-16 Thread Michael S. Tsirkin
On Mon, Feb 22, 2021 at 11:16:54AM +0100, Stefano Garzarella wrote: > On Thu, Feb 18, 2021 at 09:07:12AM +0300, Arseny Krasnov wrote: > > This patchset adds description of SOCK_SEQPACKET socket's type > > of virtio vsock. > > > > Here is implementation: > > https://lkml.org/lkml/2021/2/18/24 > >

Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants

2021-03-16 Thread Cornelia Huck
On Tue, 16 Mar 2021 09:23:39 -0400 "Michael S. Tsirkin" wrote: > On Tue, Mar 16, 2021 at 09:11:40AM +0100, Cornelia Huck wrote: > > On Tue, 16 Mar 2021 06:35:11 +0300 > > Arseny Krasnov wrote: > > > > > On 15.03.2021 18:53, Cornelia Huck wrote: > > > > On Mon, 15 Mar 2021 11:35:41 +0300 >

Re: [virtio-comment] [RFC PATCH v1 1/1] virtio-vsock: add SOCK_SEQPACKET description

2021-03-16 Thread Michael S. Tsirkin
On Thu, Feb 18, 2021 at 09:08:23AM +0300, Arseny Krasnov wrote: > Signed-off-by: Arseny Krasnov > --- > virtio-vsock.tex | 40 +--- > 1 file changed, 37 insertions(+), 3 deletions(-) > > diff --git a/virtio-vsock.tex b/virtio-vsock.tex > index

Re: [virtio-comment] Re: [RFC PATCH v1 0/1] virtio-vsock: introduce SEQPACKET description

2021-03-16 Thread Stefano Garzarella
On Tue, Mar 16, 2021 at 09:50:48AM -0400, Michael S. Tsirkin wrote: On Mon, Feb 22, 2021 at 11:16:54AM +0100, Stefano Garzarella wrote: On Thu, Feb 18, 2021 at 09:07:12AM +0300, Arseny Krasnov wrote: > This patchset adds description of SOCK_SEQPACKET socket's type > of virtio vsock. > > Here is

Re: [MASSMAIL KLMS] [virtio-comment] Re: [RFC PATCH v1] virtio-vsock: use enums instead of hardcoded constants

2021-03-16 Thread Michael S. Tsirkin
On Tue, Mar 16, 2021 at 09:11:40AM +0100, Cornelia Huck wrote: > On Tue, 16 Mar 2021 06:35:11 +0300 > Arseny Krasnov wrote: > > > On 15.03.2021 18:53, Cornelia Huck wrote: > > > On Mon, 15 Mar 2021 11:35:41 +0300 > > > Arseny Krasnov wrote: > > > > > >> This replaces constants defined in "bit

Re: [RFC v2 04/13] vhost: Add x-vhost-enable-shadow-vq qmp

2021-03-16 Thread Eric Blake
On 3/15/21 2:48 PM, Eugenio Pérez wrote: > Command to enable shadow virtqueue looks like: > > { "execute": "x-vhost-enable-shadow-vq", "arguments": { "name": "dev0", > "enable": true } } > > Signed-off-by: Eugenio Pérez > --- > qapi/net.json | 22 ++ >

[PATCH 02/18] iommu/fsl_pamu: remove fsl_pamu_get_domain_attr

2021-03-16 Thread Christoph Hellwig
None of the values returned by this function are ever queried. Also remove the DOMAIN_ATTR_FSL_PAMUV1 enum value that is not otherwise used. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 30 -- include/linux/iommu.h

[PATCH 05/18] iommu/fsl_pamu: remove support for multiple windows

2021-03-16 Thread Christoph Hellwig
The only domains allocated forces use of a single window. Remove all the code related to multiple window support, as well as the need for qman_portal to force a single window. Remove the now unused DOMAIN_ATTR_WINDOWS iommu_attr. Signed-off-by: Christoph Hellwig Acked-by: Li Yang ---

[PATCH 07/18] iommu/fsl_pamu: replace DOMAIN_ATTR_FSL_PAMU_STASH with a direct call

2021-03-16 Thread Christoph Hellwig
Add a fsl_pamu_configure_l1_stash API that qman_portal can call directly instead of indirecting through the iommu attr API. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- arch/powerpc/include/asm/fsl_pamu_stash.h | 12 +++- drivers/iommu/fsl_pamu_domain.c | 16

[PATCH 09/18] iommu/fsl_pamu: merge handle_attach_device into fsl_pamu_attach_device

2021-03-16 Thread Christoph Hellwig
No good reason to split this functionality over two functions. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 59 +++-- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c

[PATCH 15/18] iommu: remove iommu_set_cmd_line_dma_api and iommu_cmd_line_dma_api

2021-03-16 Thread Christoph Hellwig
Don't obsfucate the trivial bit flag check. Signed-off-by: Christoph Hellwig --- drivers/iommu/iommu.c | 23 +-- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 58d1d11a8d5c10..052cef11ae30df 100644 ---

[PATCH 08/18] iommu/fsl_pamu: merge pamu_set_liodn and map_liodn

2021-03-16 Thread Christoph Hellwig
Merge the two fuctions that configure the ppaace into a single coherent function. I somehow doubt we need the two pamu_config_ppaace calls, but keep the existing behavior just to be on the safe side. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 65

[PATCH 13/18] iommu: remove DOMAIN_ATTR_GEOMETRY

2021-03-16 Thread Christoph Hellwig
The geometry information can be trivially queried from the iommu_domain struture. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/iommu.c | 20 +++- drivers/vfio/vfio_iommu_type1.c | 26 -- drivers/vhost/vdpa.c|

[PATCH 01/18] iommu: remove the unused domain_window_disable method

2021-03-16 Thread Christoph Hellwig
domain_window_disable is wired up by fsl_pamu, but never actually called. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 48 - include/linux/iommu.h | 2 -- 2 files changed, 50 deletions(-) diff --git

[PATCH 17/18] iommu: remove DOMAIN_ATTR_IO_PGTABLE_CFG

2021-03-16 Thread Christoph Hellwig
Use an explicit set_pgtable_quirks method instead that just passes the actual quirk bitmask instead. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/gpu/drm/msm/adreno/adreno_gpu.c | 5 +- drivers/iommu/arm/arm-smmu/arm-smmu.c | 64 +

cleanup unused or almost unused IOMMU APIs and the FSL PAMU driver v2

2021-03-16 Thread Christoph Hellwig
Hi all, there are a bunch of IOMMU APIs that are entirely unused, or only used as a private communication channel between the FSL PAMU driver and it's only consumer, the qbman portal driver. So this series drops a huge chunk of entirely unused FSL PAMU functionality, then drops all kinds of

[PATCH 04/18] iommu/fsl_pamu: merge iommu_alloc_dma_domain into fsl_pamu_domain_alloc

2021-03-16 Thread Christoph Hellwig
Keep the functionality to allocate the domain together. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 34 ++--- 1 file changed, 10 insertions(+), 24 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c

[PATCH 11/18] iommu/fsl_pamu: remove the snoop_id field

2021-03-16 Thread Christoph Hellwig
The snoop_id is always set to ~(u32)0. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 5 ++--- drivers/iommu/fsl_pamu_domain.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c

[PATCH 16/18] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-16 Thread Christoph Hellwig
From: Robin Murphy Instead make the global iommu_dma_strict paramete in iommu.c canonical by exporting helpers to get and set it and use those directly in the drivers. This make sure that the iommu.strict parameter also works for the AMD and Intel IOMMU drivers on x86. As those default to lazy

[PATCH 2/3] ACPI: Add driver for the VIOT table

2021-03-16 Thread Jean-Philippe Brucker
The ACPI Virtual I/O Translation Table describes topology of para-virtual platforms. For now it describes the relation between virtio-iommu and the endpoints it manages. Supporting that requires three steps: (1) acpi_viot_init(): parse the VIOT table, build a list of endpoints and vIOMMUs.

[PATCH 1/3] ACPICA: iASL: Add definitions for the VIOT table

2021-03-16 Thread Jean-Philippe Brucker
Just here for reference, don't merge! The actual commits will be pulled from the next ACPICA release. I squashed the three relevant commits: ACPICA commit fc4e33319c1ee08f20f5c44853dd8426643f6dfd ACPICA commit 2197e354fb5dcafaddd2016ffeb0620e5bc3d5e2 ACPICA commit

[PATCH 0/3] Add support for ACPI VIOT

2021-03-16 Thread Jean-Philippe Brucker
Add a driver for the ACPI VIOT table, which enables virtio-iommu on non-devicetree platforms, including x86. This series depends on the ACPICA changes of patch 1, which will be included in next release [1] and pulled into Linux. The Virtual I/O Translation table (VIOT) describes the topology of

[PATCH 3/3] iommu/virtio: Enable x86 support

2021-03-16 Thread Jean-Philippe Brucker
With the VIOT support in place, x86 platforms can now use the virtio-iommu. The arm64 Kconfig selects IOMMU_DMA, while x86 IOMMU drivers select it themselves. Signed-off-by: Jean-Philippe Brucker --- drivers/iommu/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git

[PATCH 03/18] iommu/fsl_pamu: remove support for setting DOMAIN_ATTR_GEOMETRY

2021-03-16 Thread Christoph Hellwig
The default geometry is the same as the one set by qman_port given that FSL_PAMU depends on having 64-bit physical and thus DMA addresses. Remove the support to update the geometry and remove the now pointless geom_size field. Signed-off-by: Christoph Hellwig Acked-by: Li Yang ---

[PATCH 06/18] iommu/fsl_pamu: remove ->domain_window_enable

2021-03-16 Thread Christoph Hellwig
The only thing that fsl_pamu_window_enable does for the current caller is to fill in the prot value in the only dma_window structure, and to propagate a few values from the iommu_domain_geometry struture into the dma_window. Remove the dma_window entirely, hardcode the prot value and otherwise

[PATCH 10/18] iommu/fsl_pamu: enable the liodn when attaching a device

2021-03-16 Thread Christoph Hellwig
Instead of a separate call to enable all devices from the list, just enablde the liodn one the device is attached to the iommu domain. This also remove the DOMAIN_ATTR_FSL_PAMU_ENABLE iommu_attr. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/fsl_pamu_domain.c | 47

[PATCH 12/18] iommu: remove DOMAIN_ATTR_PAGING

2021-03-16 Thread Christoph Hellwig
DOMAIN_ATTR_PAGING is never used. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/iommu.c | 5 - include/linux/iommu.h | 1 - 2 files changed, 6 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index b212bf0261820b..9a4cda390993e6 100644 ---

[PATCH 14/18] iommu: remove DOMAIN_ATTR_NESTING

2021-03-16 Thread Christoph Hellwig
Use an explicit enable_nesting method instead. Signed-off-by: Christoph Hellwig Acked-by: Li Yang --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 43 - drivers/iommu/arm/arm-smmu/arm-smmu.c | 30 +++--- drivers/iommu/intel/iommu.c | 31

[PATCH 18/18] iommu: remove iommu_domain_{get,set}_attr

2021-03-16 Thread Christoph Hellwig
Remove the now unused iommu attr infrastructure. Signed-off-by: Christoph Hellwig --- drivers/iommu/iommu.c | 26 -- include/linux/iommu.h | 36 2 files changed, 62 deletions(-) diff --git a/drivers/iommu/iommu.c

Re: [RFC v2 11/13] vhost: Shadow virtqueue buffers forwarding

2021-03-16 Thread Jason Wang
在 2021/3/17 上午12:05, Eugenio Perez Martin 写道: On Tue, Mar 16, 2021 at 9:15 AM Jason Wang wrote: 在 2021/3/16 上午3:48, Eugenio Pérez 写道: Initial version of shadow virtqueue that actually forward buffers. It reuses the VirtQueue code for the device part. The driver part is based on Linux's

Re: [RFC v2 05/13] vhost: Route guest->host notification through shadow virtqueue

2021-03-16 Thread Jason Wang
在 2021/3/16 下午6:31, Eugenio Perez Martin 写道: On Tue, Mar 16, 2021 at 8:18 AM Jason Wang wrote: 在 2021/3/16 上午3:48, Eugenio Pérez 写道: Shadow virtqueue notifications forwarding is disabled when vhost_dev stops, so code flow follows usual cleanup. Signed-off-by: Eugenio Pérez ---

Re: [RFC v2 10/13] vhost: add vhost_kernel_set_vring_enable

2021-03-16 Thread Jason Wang
在 2021/3/16 下午6:43, Eugenio Perez Martin 写道: On Tue, Mar 16, 2021 at 8:30 AM Jason Wang wrote: 在 2021/3/16 上午3:48, Eugenio Pérez 写道: This method is already present in vhost-user. This commit adapts it to vhost-net, so SVQ can use. vhost_kernel_set_enable stops the device, so qemu can ask

Re: [PATCH V4 5/7] vDPA/ifcvf: fetch device feature bits when probe

2021-03-16 Thread Jason Wang
在 2021/3/15 下午3:44, Zhu Lingshan 写道: This commit would read and store device feature bits when probe. rename ifcvf_get_features() to ifcvf_get_hw_features(), it reads and stores features of the probed device. new ifcvf_get_features() simply returns stored feature bits. Signed-off-by: Zhu

Re: [PATCH V4 6/7] vDPA/ifcvf: verify mandatory feature bits for vDPA

2021-03-16 Thread Jason Wang
在 2021/3/15 下午3:45, Zhu Lingshan 写道: vDPA requres VIRTIO_F_ACCESS_PLATFORM as a must, this commit examines this when set features. Signed-off-by: Zhu Lingshan --- drivers/vdpa/ifcvf/ifcvf_base.c | 12 drivers/vdpa/ifcvf/ifcvf_base.h | 1 + drivers/vdpa/ifcvf/ifcvf_main.c |

Re: [PATCH V4 7/7] vDPA/ifcvf: deduce VIRTIO device ID from pdev ids

2021-03-16 Thread Jason Wang
在 2021/3/15 下午3:45, Zhu Lingshan 写道: static u32 ifcvf_vdpa_get_device_id(struct vdpa_device *vdpa_dev) { - return VIRTIO_ID_NET; + struct ifcvf_hw *vf = vdpa_to_vf(vdpa_dev); + u32 ret = -EOPNOTSUPP; + + if (ifcvf_probed_virtio_net(vf)) + ret =

Re: [PATCH] virtiofs: fix memory leak in virtio_fs_probe()

2021-03-16 Thread Vivek Goyal
On Tue, Mar 16, 2021 at 05:02:34PM +, Luis Henriques wrote: > When accidentally passing twice the same tag to qemu, kmemleak ended up > reporting a memory leak in virtiofs. Also, looking at the log I saw the > following error (that's when I realised the duplicated tag): > > virtiofs: probe

[RFC PATCH] virtio-vsock: add description for datagram type

2021-03-16 Thread jiang.wang
Add supports for datagram type for virtio-vsock. Datagram sockets are connectionless and unreliable. To avoid contention with stream and other sockets, add two more virtqueues and a new feature bit to identify if those two new queues exist or not. Also add descriptions for resouce management of