Re: [PATCH v4 5/7] vhost-vdpa: clean iotlb map during reset for older userspace

2023-10-23 Thread Jason Wang
On Sat, Oct 21, 2023 at 5:28 PM Si-Wei Liu wrote: > > Using .compat_reset op from the previous patch, the buggy .reset > behaviour can be kept as-is on older userspace apps, which don't ack the > IOTLB_PERSIST backend feature. As this compatibility quirk is limited to > those drivers that used to

Re: [RFC] vhost: vmap virtio descriptor table kernel/kvm

2023-10-23 Thread Jason Wang
On Tue, Oct 24, 2023 at 11:17 AM Liang Chen wrote: > > The current vhost code uses 'copy_from_user' to copy descriptors from > userspace to vhost. We attempted to 'vmap' the descriptor table to > reduce the overhead associated with 'copy_from_user' during descriptor > access, because it can be

[PATCH vhost 2/2] virtio: set broken when re-enabling vq fails

2023-10-23 Thread Xuan Zhuo
In vp_modern_enable_vq_after_reset, we will do some checks to ensure that the vq is ready to re-enable. If that fails, the vq is good. If the vq_active_vp() fails, that means the vq is broken. The driver can not use that vq, this commit sets the vq to broken. Signed-off-by: Xuan Zhuo ---

[PATCH vhost 1/2] virtio_ring: remove unused code

2023-10-23 Thread Xuan Zhuo
Remove the ignored return values; 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 51d8f3299c10..af310418e66e 100644 ---

[PATCH vhost 0/2] virtio: set broken when re-enable vq fails

2023-10-23 Thread Xuan Zhuo
In vp_modern_enable_vq_after_reset, we will do some check to ensure that the vq is in reset status. If that fails, the vq is good. If the vq_active_vp() fails, that means the vq is broken. The driver will can not use that vq, this commit sets the vq to broken. Xuan Zhuo (2): virtio_ring:

[RFC] vhost: vmap virtio descriptor table kernel/kvm

2023-10-23 Thread Liang Chen
The current vhost code uses 'copy_from_user' to copy descriptors from userspace to vhost. We attempted to 'vmap' the descriptor table to reduce the overhead associated with 'copy_from_user' during descriptor access, because it can be accessed quite frequently. This change resulted in a moderate

[RFC] vmap virtio descriptor table

2023-10-23 Thread Liang Chen
The current vhost code uses 'copy_from_user' to copy descriptors from userspace to vhost. We attempted to 'vmap' the descriptor table to reduce the overhead associated with 'copy_from_user' during descriptor access, because it can be accessed quite frequently. This change resulted in a moderate

Re: [PATCH 1/2] virtio_pci: Don't make an extra copy of cpu affinity mask

2023-10-23 Thread Xuan Zhuo
On Mon, 23 Oct 2023 18:52:45 +0200, Jakub Sitnicki wrote: > On Thu, Oct 19, 2023 at 08:55 PM +08, Xuan Zhuo wrote: > > On Thu, 19 Oct 2023 12:16:24 +0200, Jakub Sitnicki > > wrote: > >> Since commit 19e226e8cc5d ("virtio: Make vp_set_vq_affinity() take a > >> mask.") it is actually not needed

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

2023-10-23 Thread Anton Yakovlev via Virtualization
Hi Takashi, On 19.10.2023 16:48, Takashi Iwai wrote: On Thu, 19 Oct 2023 03:20:19 +0200, Anton Yakovlev wrote: 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

Re: [PATCH v3] ALSA: virtio: use ack callback

2023-10-23 Thread Anton Yakovlev via Virtualization
Hi Matias, Thanks for the new patch! On 24.10.2023 00:06, Matias Ezequiel Vara Larsen wrote: This commit uses the ack() callback to determine when a buffer has been updated, then exposes it to guest. The current mechanism splits a dma buffer into descriptors that are exposed to the device.

[PATCH] vhost-vdpa: fix NULL pointer deref in _compat_vdpa_reset

2023-10-23 Thread Si-Wei Liu
As subject. There's a vhost_vdpa_reset() done earlier before vhost_dev is initialized via vhost_dev_init(), ending up with NULL pointer dereference. Fix is to check if vqs is initialized before checking backend features and resetting the device. BUG: kernel NULL pointer dereference, address:

Re: [PATCH v4 5/7] vhost-vdpa: clean iotlb map during reset for older userspace

2023-10-23 Thread Si-Wei Liu
(+ linux-next) Hi Michael, Dragos reported below oops for which I have a fix at hand (having it fully tested), ready to be posted to linux-next. Please let me know if you want me to respin the original patch series, or you would think it'd be fine to fix it on top. On 10/23/2023 11:59 AM,

Re: [PATCH v4 0/7] vdpa: decouple reset of iotlb mapping from device reset

2023-10-23 Thread Si-Wei Liu
On 10/22/2023 8:51 PM, Jason Wang wrote: Hi Si-Wei: On Sat, Oct 21, 2023 at 5:28 PM Si-Wei Liu wrote: 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

Re: [GIT PULL] virtio: last minute fixes

2023-10-23 Thread pr-tracker-bot
The pull request you sent on Mon, 23 Oct 2023 01:02:07 -0400: > https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/7c14564010fc1d0f16ca7d39b0ff948b43344209 Thank you! -- Deet-doot-dot, I am a

Re: [PATCH 1/2] virtio_pci: Don't make an extra copy of cpu affinity mask

2023-10-23 Thread Jakub Sitnicki via Virtualization
On Thu, Oct 19, 2023 at 08:55 PM +08, Xuan Zhuo wrote: > On Thu, 19 Oct 2023 12:16:24 +0200, Jakub Sitnicki > wrote: >> Since commit 19e226e8cc5d ("virtio: Make vp_set_vq_affinity() take a >> mask.") it is actually not needed to have a local copy of the cpu mask. > > > Could you give more info

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

2023-10-23 Thread Alex Williamson
On Mon, 23 Oct 2023 13:20:43 -0300 Jason Gunthorpe wrote: > On Mon, Oct 23, 2023 at 10:09:13AM -0600, Alex Williamson wrote: > > On Mon, 23 Oct 2023 12:42:57 -0300 > > Jason Gunthorpe wrote: > > > > > On Mon, Oct 23, 2023 at 09:33:23AM -0600, Alex Williamson wrote: > > > > > > > > Alex, >

Re: [PATCH v2] vsock/virtio: initialize the_virtio_vsock before using VQs

2023-10-23 Thread Stefano Garzarella
On Mon, Oct 23, 2023 at 06:36:21PM +0300, Alexandru Matei wrote: On 10/23/2023 6:13 PM, Stefano Garzarella wrote: On Mon, Oct 23, 2023 at 05:59:45PM +0300, Alexandru Matei wrote: On 10/23/2023 5:52 PM, Alexandru Matei wrote: On 10/23/2023 5:29 PM, Stefano Garzarella wrote: On Mon, Oct 23,

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

2023-10-23 Thread Alex Williamson
On Mon, 23 Oct 2023 12:42:57 -0300 Jason Gunthorpe wrote: > On Mon, Oct 23, 2023 at 09:33:23AM -0600, Alex Williamson wrote: > > > > Alex, > > > Are you fine to leave the provisioning of the VF including the control > > > of its transitional capability in the device hands as was suggested by

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

2023-10-23 Thread Alex Williamson
On Sun, 22 Oct 2023 11:20:31 +0300 Yishai Hadas wrote: > On 17/10/2023 16:42, Yishai Hadas wrote: > > This series introduce a vfio driver over virtio devices to support the > > legacy interface functionality for VFs. > > > > Background, from the virtio spec [1]. > >

Re: [PATCH v4 4/4] vduse: Add LSM hooks to check Virtio device type

2023-10-23 Thread Casey Schaufler
On 10/23/2023 12:28 AM, Maxime Coquelin wrote: > > > On 10/21/23 00:20, Casey Schaufler wrote: >> On 10/20/2023 8:58 AM, Maxime Coquelin wrote: >>> This patch introduces LSM hooks for devices creation, >>> destruction and opening operations, checking the >>> application is allowed to perform these

Re: [PATCH v2] vsock/virtio: initialize the_virtio_vsock before using VQs

2023-10-23 Thread Stefano Garzarella
On Mon, Oct 23, 2023 at 05:59:45PM +0300, Alexandru Matei wrote: On 10/23/2023 5:52 PM, Alexandru Matei wrote: On 10/23/2023 5:29 PM, Stefano Garzarella wrote: On Mon, Oct 23, 2023 at 05:08:33PM +0300, Alexandru Matei wrote: Once VQs are filled with empty buffers and we kick the host, it can

[PATCH v3] ALSA: virtio: use ack callback

2023-10-23 Thread Matias Ezequiel Vara Larsen
This commit uses the ack() callback to determine when a buffer has been updated, then exposes it to guest. The current mechanism splits a dma buffer into descriptors that are exposed to the device. This dma buffer is shared with the user application. When the device consumes a buffer, the driver

Re: [PATCH v2] vsock/virtio: initialize the_virtio_vsock before using VQs

2023-10-23 Thread Stefano Garzarella
On Mon, Oct 23, 2023 at 05:08:33PM +0300, Alexandru Matei wrote: Once VQs are filled with empty buffers and we kick the host, it can send connection requests. If 'the_virtio_vsock' is not initialized before, replies are silently dropped and do not reach the host. Fixes: 0deab087b16a

Re: [PATCH] virtio_ring: add an error code check in virtqueue_resize

2023-10-23 Thread Michael S. Tsirkin
On Mon, Oct 23, 2023 at 06:52:34PM +0800, Xuan Zhuo wrote: > On Mon, 23 Oct 2023 17:52:02 +0800, Xuan Zhuo > wrote: > > On Mon, 23 Oct 2023 17:50:46 +0800, Su Hui wrote: > > > On 2023/10/23 13:46, Xuan Zhuo wrote: > > > Well, what are the cases where it can happen practically? > > >

Re: [PATCH] virtio_ring: add an error code check in virtqueue_resize

2023-10-23 Thread Michael S. Tsirkin
On Mon, Oct 23, 2023 at 05:52:02PM +0800, Xuan Zhuo wrote: > On Mon, 23 Oct 2023 17:50:46 +0800, Su Hui wrote: > > On 2023/10/23 13:46, Xuan Zhuo wrote: > > Well, what are the cases where it can happen practically? > > >>> Device error. Such as vp_active_vq() > > >>> > > >>>

Re: [PATCH] virtio_ring: add an error code check in virtqueue_resize

2023-10-23 Thread Xuan Zhuo
On Mon, 23 Oct 2023 17:52:02 +0800, Xuan Zhuo wrote: > On Mon, 23 Oct 2023 17:50:46 +0800, Su Hui wrote: > > On 2023/10/23 13:46, Xuan Zhuo wrote: > > Well, what are the cases where it can happen practically? > > >>> Device error. Such as vp_active_vq() > > >>> > > >>>

Re: [PATCH] virtio_ring: add an error code check in virtqueue_resize

2023-10-23 Thread Xuan Zhuo
On Mon, 23 Oct 2023 17:50:46 +0800, Su Hui wrote: > On 2023/10/23 13:46, Xuan Zhuo wrote: > Well, what are the cases where it can happen practically? > >>> Device error. Such as vp_active_vq() > >>> > >>> Thanks. > >> Hmm interesting. OK. But do callers know to recover? >

Re: [PATCH v6 9/9] drm: Introduce documentation for hotspot properties

2023-10-23 Thread Pekka Paalanen
On Mon, 23 Oct 2023 09:46:13 +0200 Albert Esteve wrote: > From: Michael Banack > > To clarify the intent and reasoning behind the hotspot properties > introduce userspace documentation that goes over cursor handling > in para-virtualized environments. > > The documentation is generic enough

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

2023-10-23 Thread Dragos Tatulea via Virtualization
On Fri, 2023-10-20 at 18:01 +0200, Eugenio Perez Martin wrote: > On Wed, Oct 18, 2023 at 7:21 PM Dragos Tatulea wrote: > > > > 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

Re: [PATCH v4 3/4] vduse: Temporarily disable control queue features

2023-10-23 Thread Maxime Coquelin
On 10/23/23 05:08, Jason Wang wrote: On Fri, Oct 20, 2023 at 11:58 PM Maxime Coquelin wrote: Virtio-net driver control queue implementation is not safe when used with VDUSE. If the VDUSE application does not reply to control queue messages, it currently ends up hanging the kernel thread

Re: [PATCH v4 1/4] vduse: validate block features only with block devices

2023-10-23 Thread Maxime Coquelin
On 10/21/23 00:07, Casey Schaufler wrote: On 10/20/2023 8:58 AM, Maxime Coquelin wrote: This patch is preliminary work to enable network device type support to VDUSE. As VIRTIO_BLK_F_CONFIG_WCE shares the same value as VIRTIO_NET_F_HOST_TSO4, we need to restrict its check to Virtio-blk

Re: [PATCH v4 4/4] vduse: Add LSM hooks to check Virtio device type

2023-10-23 Thread Maxime Coquelin
On 10/21/23 00:20, Casey Schaufler wrote: On 10/20/2023 8:58 AM, Maxime Coquelin wrote: This patch introduces LSM hooks for devices creation, destruction and opening operations, checking the application is allowed to perform these operations for the Virtio device type. Why do you think

Re: [PATCH net-next v1 15/19] virtio_net: xsk: rx: introduce add_recvbuf_xsk()

2023-10-23 Thread Xuan Zhuo
On Fri, 20 Oct 2023 14:56:51 +0800, Jason Wang wrote: > On Mon, Oct 16, 2023 at 8:01 PM Xuan Zhuo wrote: > > > > Implement the logic of filling vq with XSK buffer. > > > > Signed-off-by: Xuan Zhuo > > --- > > drivers/net/virtio/main.c | 13 +++ > > drivers/net/virtio/virtio_net.h |