Re: [PATCH v7 09/26] virtio_ring: split: implement virtqueue_reset_vring_split()

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:35, Xuan Zhuo 写道: virtio ring supports reset. Queue reset is divided into several stages. 1. notify device queue reset 2. vring release 3. attach new vring 4. notify device queue re-enable After the first step is completed, the vring reset operation can be performed. If the new

Re: [PATCH v7 08/26] virtio_ring: extract the logic of freeing vring

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:35, Xuan Zhuo 写道: Introduce vring_free() to free the vring of vq. Prevent double free by setting vq->reset. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 25 - include/linux/virtio.h | 8 2 files changed, 28 insertions(+

Re: [PATCH v5 00/15] vDPA shadow virtqueue

2022-03-08 Thread Jason Wang
On Wed, Mar 9, 2022 at 3:30 PM Michael S. Tsirkin wrote: > On Wed, Mar 09, 2022 at 11:38:35AM +0800, Jason Wang wrote: > > > > 在 2022/3/8 下午8:16, Michael S. Tsirkin 写道: > > > On Tue, Mar 08, 2022 at 12:37:33PM +0100, Eugenio Perez Martin wrote: > > > > On Tue, Mar 8, 2022 at 11:48 AM Michael S. T

Re: [PATCH v7 05/26] virtio_ring: split: extract the logic of init vq and attach vring

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:34, Xuan Zhuo 写道: Split the logic of split assignment vq into three parts. 1. The assignment passed from the function parameter 2. The part that attaches vring to vq. -- __vring_virtqueue_attach_split() 3. The part that initializes vq to a fixed value -- __vring_virtqueue_ini

Re: [PATCH v5 00/15] vDPA shadow virtqueue

2022-03-08 Thread Michael S. Tsirkin
On Wed, Mar 09, 2022 at 11:38:35AM +0800, Jason Wang wrote: > > 在 2022/3/8 下午8:16, Michael S. Tsirkin 写道: > > On Tue, Mar 08, 2022 at 12:37:33PM +0100, Eugenio Perez Martin wrote: > > > On Tue, Mar 8, 2022 at 11:48 AM Michael S. Tsirkin > > > wrote: > > > > On Tue, Mar 08, 2022 at 04:20:53PM +08

Re: [PATCH V3 04/10] virtio_pci: harden MSI-X interrupts

2022-03-08 Thread Michael S. Tsirkin
On Wed, Mar 09, 2022 at 11:41:01AM +0800, Jason Wang wrote: > > > On Wed, Mar 9, 2022 at 12:36 AM Michael S. Tsirkin wrote: > > On Tue, Mar 08, 2022 at 03:19:16PM +, Marc Zyngier wrote: > > On Tue, 19 Oct 2021 08:01:46 +0100, > > Jason Wang wrote: > > > > > > We used to

Re: [PATCH v7 04/26] virtio_ring: split: extract the logic of creating vring

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:34, Xuan Zhuo 写道: Separate the logic of split to create vring queue. For the convenience of passing parameters, add a structure vring_split. This feature is required for subsequent virtuqueue reset vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 74 +++

Re: [PATCH v7 03/26] virtio: add helper virtqueue_get_vring_max_size()

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:34, Xuan Zhuo 写道: Record the maximum queue num supported by the device. virtio-net can display the maximum (supported by hardware) ring size in ethtool -g eth0. When the subsequent patch implements vring reset, it can judge whether the ring size passed by the driver is legal bas

Re: [PATCH v7 02/26] virtio: queue_reset: add VIRTIO_F_RING_RESET

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:34, Xuan Zhuo 写道: Added VIRTIO_F_RING_RESET, it came from here https://github.com/oasis-tcs/virtio-spec/issues/124 Nit: it's better to explain VIRTIO_F_RING_RESET a little bit here. Other than this. Acked-by: Jason Wang Signed-off-by: Xuan Zhuo --- include/uapi/linux/

Re: [PATCH v7 01/26] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:34, Xuan Zhuo 写道: Add queue_notify_data in struct virtio_pci_common_cfg, which comes from here https://github.com/oasis-tcs/virtio-spec/issues/89 For not breaks uABI, add a new struct virtio_pci_common_cfg_notify. Since I want to add queue_reset after queue_notify_data, I submit

Re: [PATCH v7 00/26] virtio pci support VIRTIO_F_RING_RESET

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:34, Xuan Zhuo 写道: The virtio spec already supports the virtio queue reset function. This patch set is to add this function to the kernel. The relevant virtio spec information is here: https://github.com/oasis-tcs/virtio-spec/issues/124 Also regarding MMIO support for queue

Re: [PATCH V3 04/10] virtio_pci: harden MSI-X interrupts

2022-03-08 Thread Jason Wang
On Wed, Mar 9, 2022 at 12:36 AM Michael S. Tsirkin wrote: > On Tue, Mar 08, 2022 at 03:19:16PM +, Marc Zyngier wrote: > > On Tue, 19 Oct 2021 08:01:46 +0100, > > Jason Wang wrote: > > > > > > We used to synchronize pending MSI-X irq handlers via > > > synchronize_irq(), this may not work for

Re: [PATCH v5 00/15] vDPA shadow virtqueue

2022-03-08 Thread Jason Wang
在 2022/3/8 下午8:16, Michael S. Tsirkin 写道: On Tue, Mar 08, 2022 at 12:37:33PM +0100, Eugenio Perez Martin wrote: On Tue, Mar 8, 2022 at 11:48 AM Michael S. Tsirkin wrote: On Tue, Mar 08, 2022 at 04:20:53PM +0800, Jason Wang wrote: Not by itself but I'm not sure we can guarantee guest will not

Re: [PATCH v1 1/2] vdpa: Add support for querying vendor statistics

2022-03-08 Thread Si-Wei Liu
On 3/8/2022 6:13 AM, Eli Cohen wrote: -Original Message- From: Si-Wei Liu Sent: Tuesday, March 8, 2022 8:16 AM To: Eli Cohen Cc: m...@redhat.com; jasow...@redhat.com; virtualization@lists.linux- foundation.org; epere...@redhat.com; amore...@redhat.com; lviv...@redhat.com; sgarz...@

Re: [PATCH v1 1/2] vdpa: Add support for querying vendor statistics

2022-03-08 Thread Jason Wang
On Tue, Mar 8, 2022 at 10:13 PM Eli Cohen wrote: > > > > -Original Message- > > From: Si-Wei Liu > > Sent: Tuesday, March 8, 2022 8:16 AM > > To: Eli Cohen > > Cc: m...@redhat.com; jasow...@redhat.com; virtualization@lists.linux- > > foundation.org; epere...@redhat.com; amore...@redhat.

Re: Re: [PATCH -next] crypto: virtio - Select new dependencies

2022-03-08 Thread zhenwei pi
On 3/9/22 05:12, Michael S. Tsirkin wrote: > On Tue, Mar 08, 2022 at 01:53:09PM -0700, Nathan Chancellor wrote: >> With ARCH=riscv defconfig, there are errors at link time: >> >>virtio_crypto_akcipher_algs.c:(.text+0x3ea): undefined reference to >> `mpi_free' >>virtio_crypto_akcipher_algs.

Re: [PATCH v1 5/5] drm/virtio: Add memory shrinker

2022-03-08 Thread Rob Clark
On Tue, Mar 8, 2022 at 5:17 AM Dmitry Osipenko wrote: > > Add memory shrinker and new madvise IOCTL to the VirtIO-GPU driver. > Userspace (BO cache manager of Mesa driver) will mark BOs as "don't need" > using the new IOCTL to let shrinker purge the marked BOs on OOM, thus > shrinker will lower me

Re: [PATCH v1 0/5] Add memory shrinker to VirtIO-GPU DRM driver

2022-03-08 Thread Rob Clark
On Tue, Mar 8, 2022 at 3:36 PM Dmitry Osipenko wrote: > > On 3/9/22 01:24, Rob Clark wrote: > > On Tue, Mar 8, 2022 at 11:28 AM Dmitry Osipenko > > wrote: > >> > >> On 3/8/22 19:29, Rob Clark wrote: > >>> On Tue, Mar 8, 2022 at 5:17 AM Dmitry Osipenko > >>> wrote: > > Hello, > > >

Re: [PATCH v1 0/5] Add memory shrinker to VirtIO-GPU DRM driver

2022-03-08 Thread Rob Clark
On Tue, Mar 8, 2022 at 11:28 AM Dmitry Osipenko wrote: > > On 3/8/22 19:29, Rob Clark wrote: > > On Tue, Mar 8, 2022 at 5:17 AM Dmitry Osipenko > > wrote: > >> > >> Hello, > >> > >> This patchset introduces memory shrinker for the VirtIO-GPU DRM driver. > >> During OOM, the shrinker will release

Re: [PATCH -next] crypto: virtio - Select new dependencies

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 01:53:09PM -0700, Nathan Chancellor wrote: > With ARCH=riscv defconfig, there are errors at link time: > > virtio_crypto_akcipher_algs.c:(.text+0x3ea): undefined reference to > `mpi_free' > virtio_crypto_akcipher_algs.c:(.text+0x48a): undefined reference to > `rsa_par

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 01:17:03PM +, Lee Jones wrote: > On Tue, 08 Mar 2022, Michael S. Tsirkin wrote: > > > On Tue, Mar 08, 2022 at 12:45:19PM +0100, Greg KH wrote: > > > On Tue, Mar 08, 2022 at 05:55:58AM -0500, Michael S. Tsirkin wrote: > > > > On Tue, Mar 08, 2022 at 10:57:42AM +0100, Gre

Re: [PATCH V3 04/10] virtio_pci: harden MSI-X interrupts

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 03:19:16PM +, Marc Zyngier wrote: > On Tue, 19 Oct 2021 08:01:46 +0100, > Jason Wang wrote: > > > > We used to synchronize pending MSI-X irq handlers via > > synchronize_irq(), this may not work for the untrusted device which > > may keep sending interrupts after reset

[mst-vhost:vhost 28/60] drivers/crypto/virtio/virtio_crypto_akcipher_algs.c:378: undefined reference to `rsa_parse_priv_key'

2022-03-08 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost head: c5f633abfd09491ae7ecbc7fcfca08332ad00a8b commit: 8a75f36b5d7a48f1c5a0b46638961c951ec6ecd9 [28/60] virtio-crypto: implement RSA algorithm config: x86_64-randconfig-a015 (https://download.01.org/0day-ci/archive/2022

Re: [PATCH v1 0/5] Add memory shrinker to VirtIO-GPU DRM driver

2022-03-08 Thread Rob Clark
On Tue, Mar 8, 2022 at 5:17 AM Dmitry Osipenko wrote: > > Hello, > > This patchset introduces memory shrinker for the VirtIO-GPU DRM driver. > During OOM, the shrinker will release BOs that are marked as "not needed" > by userspace using the new madvise IOCTL. The userspace in this case is > the M

Re: [mst-vhost:vhost 28/60] nios2-linux-ld: virtio_crypto_akcipher_algs.c:undefined reference to `rsa_parse_pub_key'

2022-03-08 Thread Michael S. Tsirkin
SA algorithm > config: nios2-randconfig-p002-20220308 > (https://download.01.org/0day-ci/archive/20220309/202203090014.ulendnaq-...@intel.com/config) > compiler: nios2-linux-gcc (GCC) 11.2.0 > reproduce (this is a W=1 build): > wget > https://raw.githubusercontent.c

[mst-vhost:vhost 28/60] nios2-linux-ld: virtio_crypto_akcipher_algs.c:undefined reference to `rsa_parse_pub_key'

2022-03-08 Thread kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost head: c5f633abfd09491ae7ecbc7fcfca08332ad00a8b commit: 8a75f36b5d7a48f1c5a0b46638961c951ec6ecd9 [28/60] virtio-crypto: implement RSA algorithm config: nios2-randconfig-p002-20220308 (https://download.01.org/0day-ci

Re: [PATCH v5 00/15] vDPA shadow virtqueue

2022-03-08 Thread Jason Wang
On Tue, Mar 8, 2022 at 6:46 PM Michael S. Tsirkin wrote: > On Tue, Mar 08, 2022 at 04:20:53PM +0800, Jason Wang wrote: > > Generally, yes. > > > So generally I support the idea of merging code gradually. And merging > with an unstable flag to enable it is a reasonable way to do it. > However we

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Lee Jones
On Tue, 08 Mar 2022, Michael S. Tsirkin wrote: > On Tue, Mar 08, 2022 at 12:45:19PM +0100, Greg KH wrote: > > On Tue, Mar 08, 2022 at 05:55:58AM -0500, Michael S. Tsirkin wrote: > > > On Tue, Mar 08, 2022 at 10:57:42AM +0100, Greg KH wrote: > > > > On Tue, Mar 08, 2022 at 09:15:27AM +, Lee Jon

Re: [PATCH v7 18/26] virtio: find_vqs() add arg sizes

2022-03-08 Thread Hans de Goede
Hi, On 3/8/22 13:35, Xuan Zhuo wrote: > find_vqs() adds a new parameter sizes to specify the size of each vq > vring. > > 0 means use the maximum size supported by the backend. > > In the split scenario, the meaning of size is the largest size, because > it may be limited by memory, the virtio c

[PATCH v7 26/26] virtio_net: support set_ringparam

2022-03-08 Thread Xuan Zhuo
Support set_ringparam based on virtio queue reset. The rx,tx_pending required to be passed must be power of 2. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 47 1 file changed, 47 insertions(+) diff --git a/drivers/net/virtio_net.c b/drivers/n

[PATCH v7 24/26] virtio_net: support rx/tx queue reset

2022-03-08 Thread Xuan Zhuo
This patch implements the reset function of the rx, tx queues. Based on this function, it is possible to modify the ring num of the queue. And quickly recycle the buffer in the queue. In the process of the queue disable, in theory, as long as virtio supports queue reset, there will be no exceptio

[PATCH v7 25/26] virtio_net: set the default max ring size by find_vqs()

2022-03-08 Thread Xuan Zhuo
Use virtio_find_vqs_ctx_size() to specify the maximum ring size of tx, rx at the same time. | rx/tx ring size --- speed == UNKNOWN or < 10G| 1024 speed < 40G | 4096 speed >= 40G | 8192 Call virtnet_update_se

[PATCH v7 23/26] virtio_net: split free_unused_bufs()

2022-03-08 Thread Xuan Zhuo
This patch separates two functions for freeing sq buf and rq buf from free_unused_bufs(). When supporting the enable/disable tx/rq queue in the future, it is necessary to support separate recovery of a sq buf or a rq buf. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 53 ++

[PATCH v7 22/26] virtio_net: get ringparam by virtqueue_get_vring_max_size()

2022-03-08 Thread Xuan Zhuo
Use virtqueue_get_vring_max_size() in virtnet_get_ringparam() to set tx,rx_max_pending. Signed-off-by: Xuan Zhuo --- drivers/net/virtio_net.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index a801ea40908f..59b1ea

[PATCH v7 21/26] virtio: add helper virtio_find_vqs_ctx_size()

2022-03-08 Thread Xuan Zhuo
Introduce helper virtio_find_vqs_ctx_size() to call find_vqs and specify the maximum size of each vq ring. Signed-off-by: Xuan Zhuo --- include/linux/virtio_config.h | 12 1 file changed, 12 insertions(+) diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h in

[PATCH v7 20/26] virtio_mmio: support the arg sizes of find_vqs()

2022-03-08 Thread Xuan Zhuo
Virtio MMIO support the new parameter sizes of find_vqs(). Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_mmio.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index 55d575f6ef2d..4d7cd8881282 100644 ---

[PATCH v7 19/26] virtio_pci: support the arg sizes of find_vqs()

2022-03-08 Thread Xuan Zhuo
Virtio PCI supports new parameter sizes of find_vqs(). Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_pci_common.c | 18 ++ drivers/virtio/virtio_pci_common.h | 1 + drivers/virtio/virtio_pci_legacy.c | 6 +- drivers/virtio/virtio_pci_modern.c | 10 +++--- 4 files c

[PATCH v7 16/26] virtio_pci: queue_reset: extract the logic of active vq for modern pci

2022-03-08 Thread Xuan Zhuo
Introduce vp_active_vq() to configure vring to backend after vq attach vring. And configure vq vector if necessary. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_pci_modern.c | 46 ++ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/drivers/virtio/

[PATCH v7 18/26] virtio: find_vqs() add arg sizes

2022-03-08 Thread Xuan Zhuo
find_vqs() adds a new parameter sizes to specify the size of each vq vring. 0 means use the maximum size supported by the backend. In the split scenario, the meaning of size is the largest size, because it may be limited by memory, the virtio core will try a smaller size. And the size is power of

[PATCH v7 17/26] virtio_pci: queue_reset: support VIRTIO_F_RING_RESET

2022-03-08 Thread Xuan Zhuo
This patch implements virtio pci support for QUEUE RESET. Performing reset on a queue is divided into these steps: 1. virtio_reset_vq() - notify the device to reset the queue 2. virtqueue_detach_unused_buf() - recycle the buffer submitted 3. virtqueue_reset_vring()- reset

[PATCH v7 15/26] virtio_pci: queue_reset: update struct virtio_pci_common_cfg and option functions

2022-03-08 Thread Xuan Zhuo
Add queue_reset in virtio_pci_common_cfg, and add related operation functions. For not breaks uABI, add a new struct virtio_pci_common_cfg_reset. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_pci_modern_dev.c | 36 ++ include/linux/virtio_pci_modern.h | 2 ++

[PATCH v7 14/26] virtio: add helper for queue reset

2022-03-08 Thread Xuan Zhuo
Add helper for virtio queue reset. * virtio_reset_vq(): reset a queue individually * virtio_enable_resetq(): enable a reset queue Signed-off-by: Xuan Zhuo --- include/linux/virtio_config.h | 40 +++ 1 file changed, 40 insertions(+) diff --git a/include/linux/vir

[PATCH v7 13/26] virtio: queue_reset: struct virtio_config_ops add callbacks for queue_reset

2022-03-08 Thread Xuan Zhuo
Performing reset on a queue is divided into four steps: 1. reset_vq() - notify the device to reset the queue 2. virtqueue_detach_unused_buf() - recycle the buffer submitted 3. virtqueue_reset_vring()- reset the vring (may re-alloc) 4. enable_reset_vq()

[PATCH v7 12/26] virtio_ring: update the document of the virtqueue_detach_unused_buf for queue reset

2022-03-08 Thread Xuan Zhuo
Added documentation for virtqueue_detach_unused_buf, allowing it to be called on queue reset. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index bbff9b

[PATCH v7 11/26] virtio_ring: introduce virtqueue_reset_vring()

2022-03-08 Thread Xuan Zhuo
Introduce virtqueue_reset_vring() to implement the reset of vring during the reset process. If num is equal to 0 or equal to the original ring num, the original vring will be used directly. The vring will not be reallocated. Otherwise, the original vring will be released, and the vring will be re-

[PATCH v7 10/26] virtio_ring: packed: implement virtqueue_reset_vring_packed()

2022-03-08 Thread Xuan Zhuo
virtio ring supports reset. Queue reset is divided into several stages. 1. notify device queue reset 2. vring release 3. attach new vring 4. notify device queue re-enable After the first step is completed, the vring reset operation can be performed. If the newly set vring num does not change, th

[PATCH v7 08/26] virtio_ring: extract the logic of freeing vring

2022-03-08 Thread Xuan Zhuo
Introduce vring_free() to free the vring of vq. Prevent double free by setting vq->reset. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 25 - include/linux/virtio.h | 8 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/drivers

[PATCH v7 09/26] virtio_ring: split: implement virtqueue_reset_vring_split()

2022-03-08 Thread Xuan Zhuo
virtio ring supports reset. Queue reset is divided into several stages. 1. notify device queue reset 2. vring release 3. attach new vring 4. notify device queue re-enable After the first step is completed, the vring reset operation can be performed. If the newly set vring num does not change, th

[PATCH v7 07/26] virtio_ring: packed: extract the logic of init vq and attach vring

2022-03-08 Thread Xuan Zhuo
Split the logic of packed assignment vq into three parts. 1. The assignment passed from the function parameter 2. The part that attaches vring to vq. -- vring_virtqueue_attach_packed() 3. The part that initializes vq to a fixed value -- vring_virtqueue_init_packed() This feature is required for s

[PATCH v7 05/26] virtio_ring: split: extract the logic of init vq and attach vring

2022-03-08 Thread Xuan Zhuo
Split the logic of split assignment vq into three parts. 1. The assignment passed from the function parameter 2. The part that attaches vring to vq. -- __vring_virtqueue_attach_split() 3. The part that initializes vq to a fixed value -- __vring_virtqueue_init_split() This feature is required f

[PATCH v7 06/26] virtio_ring: packed: extract the logic of creating vring

2022-03-08 Thread Xuan Zhuo
Separate the logic of packed to create vring queue. For the convenience of passing parameters, add a structure vring_packed. This feature is required for subsequent virtuqueue reset vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 121 ++- 1 fi

[PATCH v7 03/26] virtio: add helper virtqueue_get_vring_max_size()

2022-03-08 Thread Xuan Zhuo
Record the maximum queue num supported by the device. virtio-net can display the maximum (supported by hardware) ring size in ethtool -g eth0. When the subsequent patch implements vring reset, it can judge whether the ring size passed by the driver is legal based on this. Signed-off-by: Xuan Zhu

[PATCH v7 02/26] virtio: queue_reset: add VIRTIO_F_RING_RESET

2022-03-08 Thread Xuan Zhuo
Added VIRTIO_F_RING_RESET, it came from here https://github.com/oasis-tcs/virtio-spec/issues/124 Signed-off-by: Xuan Zhuo --- include/uapi/linux/virtio_config.h | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virt

[PATCH v7 04/26] virtio_ring: split: extract the logic of creating vring

2022-03-08 Thread Xuan Zhuo
Separate the logic of split to create vring queue. For the convenience of passing parameters, add a structure vring_split. This feature is required for subsequent virtuqueue reset vring. Signed-off-by: Xuan Zhuo --- drivers/virtio/virtio_ring.c | 74 +--- 1 file

[PATCH v7 01/26] virtio_pci: struct virtio_pci_common_cfg add queue_notify_data

2022-03-08 Thread Xuan Zhuo
Add queue_notify_data in struct virtio_pci_common_cfg, which comes from here https://github.com/oasis-tcs/virtio-spec/issues/89 For not breaks uABI, add a new struct virtio_pci_common_cfg_notify. Since I want to add queue_reset after queue_notify_data, I submitted this patch first. Signed-off-by

[PATCH v7 00/26] virtio pci support VIRTIO_F_RING_RESET

2022-03-08 Thread Xuan Zhuo
The virtio spec already supports the virtio queue reset function. This patch set is to add this function to the kernel. The relevant virtio spec information is here: https://github.com/oasis-tcs/virtio-spec/issues/124 Also regarding MMIO support for queue reset, I plan to support it after thi

Re: [PATCH v5 15/15] vdpa: Add x-svq to NetdevVhostVDPAOptions

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 09:24:05AM +0100, Eugenio Perez Martin wrote: > On Tue, Mar 8, 2022 at 9:02 AM Michael S. Tsirkin wrote: > > > > On Tue, Mar 08, 2022 at 08:32:07AM +0100, Eugenio Perez Martin wrote: > > > On Tue, Mar 8, 2022 at 8:11 AM Michael S. Tsirkin wrote: > > > > > > > > On Mon, Mar

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 12:45:19PM +0100, Greg KH wrote: > On Tue, Mar 08, 2022 at 05:55:58AM -0500, Michael S. Tsirkin wrote: > > On Tue, Mar 08, 2022 at 10:57:42AM +0100, Greg KH wrote: > > > On Tue, Mar 08, 2022 at 09:15:27AM +, Lee Jones wrote: > > > > On Tue, 08 Mar 2022, Greg KH wrote: >

Re: [PATCH v5 00/15] vDPA shadow virtqueue

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 12:37:33PM +0100, Eugenio Perez Martin wrote: > On Tue, Mar 8, 2022 at 11:48 AM Michael S. Tsirkin wrote: > > > > On Tue, Mar 08, 2022 at 04:20:53PM +0800, Jason Wang wrote: > > > > Not by itself but I'm not sure we can guarantee guest will not > > > > attempt to use the IO

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Greg KH
On Tue, Mar 08, 2022 at 05:55:58AM -0500, Michael S. Tsirkin wrote: > On Tue, Mar 08, 2022 at 10:57:42AM +0100, Greg KH wrote: > > On Tue, Mar 08, 2022 at 09:15:27AM +, Lee Jones wrote: > > > On Tue, 08 Mar 2022, Greg KH wrote: > > > > > > > On Tue, Mar 08, 2022 at 08:10:06AM +, Lee Jones

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 08:01:32AM +, Lee Jones wrote: > On Mon, 07 Mar 2022, Michael S. Tsirkin wrote: > > > On Mon, Mar 07, 2022 at 07:17:57PM +, Lee Jones wrote: > > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > > to vhost_get_vq_desc(). All we have to do h

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 08:08:25AM +, Lee Jones wrote: > On Tue, 08 Mar 2022, Jason Wang wrote: > > > On Tue, Mar 8, 2022 at 3:18 AM Lee Jones wrote: > > > > > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > > to vhost_get_vq_desc(). All we have to do here is take

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 09:57:57AM +0100, Greg KH wrote: > > > And what happens if the mutex is locked _RIGHT_ after you checked it? > > > You still have a race... > > > > No, we miss a warning that one time. Memory is still protected. > > Then don't warn on something that doesn't matter. This

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 10:57:42AM +0100, Greg KH wrote: > On Tue, Mar 08, 2022 at 09:15:27AM +, Lee Jones wrote: > > On Tue, 08 Mar 2022, Greg KH wrote: > > > > > On Tue, Mar 08, 2022 at 08:10:06AM +, Lee Jones wrote: > > > > On Mon, 07 Mar 2022, Greg KH wrote: > > > > > > > > > On Mon,

Re: [PATCH v5 00/15] vDPA shadow virtqueue

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 04:20:53PM +0800, Jason Wang wrote: > > Not by itself but I'm not sure we can guarantee guest will not > > attempt to use the IOVA addresses we are reserving down > > the road. > > The IOVA is allocated via the listeners and stored in the iova tree > per GPA range as IOVA->

Re: [PATCH v5 00/15] vDPA shadow virtqueue

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 04:20:53PM +0800, Jason Wang wrote: > Generally, yes. So generally I support the idea of merging code gradually. And merging with an unstable flag to enable it is a reasonable way to do it. However we are half a day away from soft freeze, so this will just result in the f

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Lee Jones
On Tue, 08 Mar 2022, Greg KH wrote: > On Tue, Mar 08, 2022 at 09:15:27AM +, Lee Jones wrote: > > On Tue, 08 Mar 2022, Greg KH wrote: > > > > > On Tue, Mar 08, 2022 at 08:10:06AM +, Lee Jones wrote: > > > > On Mon, 07 Mar 2022, Greg KH wrote: > > > > > > > > > On Mon, Mar 07, 2022 at 07:1

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Greg KH
On Tue, Mar 08, 2022 at 09:15:27AM +, Lee Jones wrote: > On Tue, 08 Mar 2022, Greg KH wrote: > > > On Tue, Mar 08, 2022 at 08:10:06AM +, Lee Jones wrote: > > > On Mon, 07 Mar 2022, Greg KH wrote: > > > > > > > On Mon, Mar 07, 2022 at 07:17:57PM +, Lee Jones wrote: > > > > > vhost_vsoc

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Lee Jones
On Tue, 08 Mar 2022, Greg KH wrote: > On Tue, Mar 08, 2022 at 08:10:06AM +, Lee Jones wrote: > > On Mon, 07 Mar 2022, Greg KH wrote: > > > > > On Mon, Mar 07, 2022 at 07:17:57PM +, Lee Jones wrote: > > > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > > > to vho

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Greg KH
On Tue, Mar 08, 2022 at 08:10:06AM +, Lee Jones wrote: > On Mon, 07 Mar 2022, Greg KH wrote: > > > On Mon, Mar 07, 2022 at 07:17:57PM +, Lee Jones wrote: > > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > > to vhost_get_vq_desc(). All we have to do here is take

Re: [PATCH v5 00/15] vDPA shadow virtqueue

2022-03-08 Thread Jason Wang
On Tue, Mar 8, 2022 at 3:55 PM Michael S. Tsirkin wrote: > > On Tue, Mar 08, 2022 at 03:34:17PM +0800, Jason Wang wrote: > > On Tue, Mar 8, 2022 at 3:28 PM Michael S. Tsirkin wrote: > > > > > > On Tue, Mar 08, 2022 at 03:14:35PM +0800, Jason Wang wrote: > > > > On Tue, Mar 8, 2022 at 3:11 PM Mich

Re: [PATCH v5 00/15] vDPA shadow virtqueue

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 09:15:37AM +0100, Eugenio Perez Martin wrote: > On Tue, Mar 8, 2022 at 8:55 AM Michael S. Tsirkin wrote: > > > > On Tue, Mar 08, 2022 at 03:34:17PM +0800, Jason Wang wrote: > > > On Tue, Mar 8, 2022 at 3:28 PM Michael S. Tsirkin wrote: > > > > > > > > On Tue, Mar 08, 2022

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Lee Jones
On Tue, 08 Mar 2022, Lee Jones wrote: > On Mon, 07 Mar 2022, Greg KH wrote: > > > On Mon, Mar 07, 2022 at 07:17:57PM +, Lee Jones wrote: > > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > > to vhost_get_vq_desc(). All we have to do here is take the same lock > > >

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Lee Jones
On Mon, 07 Mar 2022, Greg KH wrote: > On Mon, Mar 07, 2022 at 07:17:57PM +, Lee Jones wrote: > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > to vhost_get_vq_desc(). All we have to do here is take the same lock > > during virtqueue clean-up and we mitigate the repo

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Lee Jones
On Tue, 08 Mar 2022, Jason Wang wrote: > On Tue, Mar 8, 2022 at 3:18 AM Lee Jones wrote: > > > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > to vhost_get_vq_desc(). All we have to do here is take the same lock > > during virtqueue clean-up and we mitigate the reporte

Re: [PATCH v6 06/26] virtio_ring: packed: extrace the logic of creating vring

2022-03-08 Thread Xuan Zhuo
On Tue, 8 Mar 2022 15:28:22 +0800, Jason Wang wrote: > > 在 2022/3/8 下午3:01, Xuan Zhuo 写道: > > On Mon, 7 Mar 2022 17:17:51 -0500, "Michael S. Tsirkin" > > wrote: > >> On Thu, Feb 24, 2022 at 04:10:42PM +0800, Xuan Zhuo wrote: > >>> Separate the logic of packed to create vring queue. > >>> > >>> F

Re: [PATCH v5 15/15] vdpa: Add x-svq to NetdevVhostVDPAOptions

2022-03-08 Thread Michael S. Tsirkin
On Tue, Mar 08, 2022 at 08:32:07AM +0100, Eugenio Perez Martin wrote: > On Tue, Mar 8, 2022 at 8:11 AM Michael S. Tsirkin wrote: > > > > On Mon, Mar 07, 2022 at 04:33:34PM +0100, Eugenio Pérez wrote: > > > Finally offering the possibility to enable SVQ from the command line. > > > > > > Signed-off

Re: [PATCH 1/1] vhost: Protect the virtqueue from being cleared whilst still in use

2022-03-08 Thread Lee Jones
On Mon, 07 Mar 2022, Michael S. Tsirkin wrote: > On Mon, Mar 07, 2022 at 07:17:57PM +, Lee Jones wrote: > > vhost_vsock_handle_tx_kick() already holds the mutex during its call > > to vhost_get_vq_desc(). All we have to do here is take the same lock > > during virtqueue clean-up and we mitiga