Re: [PATCH v2 1/3] vdpa: support exposing the config size to userspace

2022-03-15 Thread Stefano Garzarella
Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [RFC PATCH v1 3/3] af_vsock: SOCK_SEQPACKET broken buffer test

2022-03-15 Thread Stefano Garzarella
On Fri, Mar 11, 2022 at 10:58:32AM +, Krasnov Arseniy Vladimirovich wrote: Add test where sender sends two message, each with own data pattern. Reader tries to read first to broken buffer: it has three pages size, but middle page is unmapped. Then, reader tries to read second message to

Re: [PATCH v2 2/3] vdpa: change the type of nvqs to u32

2022-03-15 Thread Stefano Garzarella
insertions(+), 10 deletions(-) Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v2 3/3] vdpa: support exposing the count of vqs to userspace

2022-03-15 Thread Stefano Garzarella
since we use "num_queues" also in the spec [1]. But I'm fine also with this: Reviewed-by: Stefano Garzarella [1] https://docs.oasis-open.org/virtio/virtio/v1.1/csprd01/virtio-v1.1-csprd01.html#x1-1120003 ___ Virtualization mailing list Virt

Re: [RFC PATCH v1 2/3] af_vsock: SOCK_SEQPACKET receive timeout test

2022-03-15 Thread Stefano Garzarella
On Fri, Mar 11, 2022 at 10:55:42AM +, Krasnov Arseniy Vladimirovich wrote: Test for receive timeout check: connection is established, receiver sets timeout, but sender does nothing. Receiver's 'read()' call must return EAGAIN. Signed-off-by: Arseniy Krasnov ---

Re: [RFC PATCH v1 1/3] af_vsock: add two new tests for SOCK_SEQPACKET

2022-03-15 Thread Stefano Garzarella
Hi Arseniy, On Fri, Mar 11, 2022 at 10:52:36AM +, Krasnov Arseniy Vladimirovich wrote: This adds two tests: for receive timeout and reading to invalid buffer provided by user. I forgot to put both patches to main patchset. Arseniy Krasnov(2): af_vsock: SOCK_SEQPACKET receive timeout test

Re: [RFC PATCH v1 3/3] af_vsock: SOCK_SEQPACKET broken buffer test

2022-03-15 Thread Stefano Garzarella
On Tue, Mar 15, 2022 at 09:34:35AM +, Krasnov Arseniy Vladimirovich wrote: On 15.03.2022 11:36, Stefano Garzarella wrote: Is this the right behavior? If read() fails because the buffer is invalid, do we throw out the whole packet? I was expecting the packet not to be consumed, have you

Re: [RFC PATCH v1 3/3] af_vsock: SOCK_SEQPACKET broken buffer test

2022-03-15 Thread Stefano Garzarella
On Tue, Mar 15, 2022 at 12:43:13PM +, Krasnov Arseniy Vladimirovich wrote: On 15.03.2022 12:35, Arseniy Krasnov wrote: On 15.03.2022 11:36, Stefano Garzarella wrote: On Fri, Mar 11, 2022 at 10:58:32AM +, Krasnov Arseniy Vladimirovich wrote: Add test where sender sends two message

Re: [PATCH] vhost/vsock: reset only the h2g connections upon release

2022-03-10 Thread Stefano Garzarella
On Thu, Mar 10, 2022 at 07:41:54PM +0900, Jiyong Park wrote: Hi Stefano, On Thu, Mar 10, 2022 at 5:59 PM Stefano Garzarella wrote: Hi Jiyong, On Thu, Mar 10, 2022 at 05:18:54PM +0900, Jiyong Park wrote: >Filtering non-h2g connections out when determining orphaned connections. >Oth

Re: [PATCH] vhost/vsock: reset only the h2g connections upon release

2022-03-10 Thread Stefano Garzarella
Hi Jiyong, On Thu, Mar 10, 2022 at 05:18:54PM +0900, Jiyong Park wrote: Filtering non-h2g connections out when determining orphaned connections. Otherwise, in a nested VM configuration, destroying the nested VM (which often involves the closing of /dev/vhost-vsock if there was h2g connections

Re: [PATCH 1/2] vsock: each transport cycles only on its own sockets

2022-03-10 Thread Stefano Garzarella
On Thu, Mar 10, 2022 at 08:01:53AM -0500, Michael S. Tsirkin wrote: On Thu, Mar 10, 2022 at 09:54:24PM +0900, Jiyong Park wrote: When iterating over sockets using vsock_for_each_connected_socket, make sure that a transport filters out sockets that don't belong to the transport. There actually

Re: [PATCH v2] vsock: each transport cycles only on its own sockets

2022-03-10 Thread Stefano Garzarella
On Thu, Mar 10, 2022 at 10:28:29PM +0900, Jiyong Park wrote: When iterating over sockets using vsock_for_each_connected_socket, make sure that a transport filters out sockets that don't belong to the transport. There actually was an issue caused by this; in a nested VM configuration, destroying

Re: [PATCH v3] vsock: each transport cycles only on its own sockets

2022-03-10 Thread Stefano Garzarella
| 3 ++- net/vmw_vsock/af_vsock.c | 9 +++-- net/vmw_vsock/virtio_transport.c | 7 +-- net/vmw_vsock/vmci_transport.c | 5 - 5 files changed, 20 insertions(+), 7 deletions(-) It seems okay now, I ran my test suite and everything seems to be fine: Reviewed-by: Stefano

Re: [PATCH] vhost: handle error while adding split ranges to iotlb

2022-03-18 Thread Stefano Garzarella
start = mid + 1; } -- 2.35.1 Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [syzbot] WARNING in vhost_dev_cleanup (2)

2022-02-21 Thread Stefano Garzarella
On Fri, Feb 18, 2022 at 12:23:10PM -0600, Mike Christie wrote: On 2/18/22 11:53 AM, Mike Christie wrote: On 2/17/22 3:48 AM, Stefano Garzarella wrote: On Thu, Feb 17, 2022 at 8:50 AM Michael S. Tsirkin wrote: On Thu, Feb 17, 2022 at 03:39:48PM +0800, Jason Wang wrote: On Thu, Feb 17, 2022

Re: [syzbot] INFO: task hung in vhost_work_dev_flush

2022-02-21 Thread Stefano Garzarella
30: 65 48 8b 14 25 00 70mov%gs:0x27000,%rdx > 37: 02 00 > 39: a9 00 01 ff 00 test $0xff0100,%eax > 3e: 74 0e je 0x4e > > > --- > This report is generated by a bot. It may contain errors. > See https://goo.gl/tpsmEJ for more

Re: [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-21 Thread Stefano Garzarella
On Mon, Feb 21, 2022 at 12:49 PM Stefano Garzarella wrote: > > vhost_vsock_stop() calls vhost_dev_check_owner() to check the device > ownership. It expects current->mm to be valid. > > vhost_vsock_stop() is also called by vhost_vsock_dev_release() when > the user has not don

[PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-21 Thread Stefano Garzarella
we're releasing the device, so we should clean it anyway. Let's check the owner only when vhost_vsock_stop() is called by an ioctl. Fixes: 433fc58e6bf2 ("VSOCK: Introduce vhost_vsock.ko") Cc: sta...@vger.kernel.org Reported-by: syzbot+1e3ea63db39f2b444...@syzkaller.appspotmail.com Signed

Re: [syzbot] general protection fault in vhost_iotlb_itree_first

2022-02-21 Thread Stefano Garzarella
#syz test: https://github.com/stefano-garzarella/linux.git vsock-fix-stop On Sat, Feb 19, 2022 at 01:18:24AM -0800, syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:359303076163 tty: n_tty: do not look ahead for EOL charact.. git tree: upstream console output

Re: [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-21 Thread Stefano Garzarella
On Mon, Feb 21, 2022 at 11:33:11PM +0530, Anirudh Rayabharam wrote: On Mon, Feb 21, 2022 at 05:44:20PM +0100, Stefano Garzarella wrote: On Mon, Feb 21, 2022 at 09:44:39PM +0530, Anirudh Rayabharam wrote: > On Mon, Feb 21, 2022 at 02:59:30PM +0100, Stefano Garzarella wrote: > > On Mo

Re: [PATCH] vsock: remove vsock from connected table when connect is interrupted by a signal

2022-02-16 Thread Stefano Garzarella
eout == 0) { err = -ETIMEDOUT; -- 2.32.0 Thanks for this fix! The patch LGTM: Reviewed-by: Stefano Garzarella @Dave, @Jakub, since we need this also in stable branches, I was going to suggest adding a Fixes tag, but I'm a little confused: the issue seems to have always been there, so fr

Re: [PATCH v2] vsock: remove vsock from connected table when connect is interrupted by a signal

2022-02-17 Thread Stefano Garzarella
? TCP_CLOSING : TCP_CLOSE; sock->state = SS_UNCONNECTED; vsock_transport_cancel_pkt(vsk); + vsock_remove_connected(vsk); goto out_wait; } else if (timeout == 0) { err = -ETIMEDOUT; -- 2

Re: [PATCH] vdpa: fix use-after-free on vp_vdpa_remove

2022-03-01 Thread Stefano Garzarella
struct vp_vdpa *vp_vdpa = pci_get_drvdata(pdev); > > - vdpa_unregister_device(_vdpa->vdpa); > vp_modern_remove(_vdpa->mdev); > + vdpa_unregister_device(_vdpa->vdpa); > } > > static struct pci_driver vp_vdpa_driver = { > -- > 2.27.0

Re: [PATCH] vsock: remove vsock from connected table when connect is interrupted by a signal

2022-02-17 Thread Stefano Garzarella
On Wed, Feb 16, 2022 at 08:14:59PM -0800, Jakub Kicinski wrote: On Wed, 16 Feb 2022 17:11:22 +0100 Stefano Garzarella wrote: On Wed, Feb 16, 2022 at 08:32:22AM -0600, Seth Forshee wrote: >vsock_connect() expects that the socket could already be in the >TCP_ESTABLISHED state when the conn

Re: [PATCH] virtio: Add definition for VIRTIO_F_NOTIFICATION_DATA feature flag

2022-02-17 Thread Stefano Garzarella
that the driver can pass extra data beyond + * virtqueue identification when sending notifications + */ +#define VIRTIO_F_NOTIFICATION_DATA 38 + #endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */ -- 2.32.0 Reviewed-by: Stefano Garzarella ___ Virtualization mailing list

Re: [syzbot] WARNING in vhost_dev_cleanup (2)

2022-02-17 Thread Stefano Garzarella
On Thu, Feb 17, 2022 at 8:50 AM Michael S. Tsirkin wrote: > > On Thu, Feb 17, 2022 at 03:39:48PM +0800, Jason Wang wrote: > > On Thu, Feb 17, 2022 at 3:36 PM Michael S. Tsirkin wrote: > > > > > > On Thu, Feb 17, 2022 at 03:34:13PM +0800, Jason Wang wrote: > > > > On Thu, Feb 17, 2022 at 10:01

Re: [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-21 Thread Stefano Garzarella
On Mon, Feb 21, 2022 at 10:03:39AM -0500, Michael S. Tsirkin wrote: On Mon, Feb 21, 2022 at 12:49:16PM +0100, Stefano Garzarella wrote: vhost_vsock_stop() calls vhost_dev_check_owner() to check the device ownership. It expects current->mm to be valid. vhost_vsock_stop() is also cal

Re: [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-21 Thread Stefano Garzarella
On Mon, Feb 21, 2022 at 09:44:39PM +0530, Anirudh Rayabharam wrote: On Mon, Feb 21, 2022 at 02:59:30PM +0100, Stefano Garzarella wrote: On Mon, Feb 21, 2022 at 12:49 PM Stefano Garzarella wrote: > > vhost_vsock_stop() calls vhost_dev_check_owner() to check the device > ownership. I

Re: [syzbot] INFO: task hung in vhost_work_dev_flush

2022-02-21 Thread Stefano Garzarella
On Mon, Feb 21, 2022 at 09:23:04PM +0530, Anirudh Rayabharam wrote: On Mon, Feb 21, 2022 at 03:12:33PM +0100, Stefano Garzarella wrote: #syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ f71077a4d84b Patch sent upstream: https://lore.kernel.org/virtualization

Re: [PATCH] vhost: handle zero regions in vhost_set_memory

2022-02-21 Thread Stefano Garzarella
On Mon, Feb 21, 2022 at 12:58:51PM +0530, Anirudh Rayabharam wrote: Return early when userspace sends zero regions in the VHOST_SET_MEM_TABLE ioctl. Otherwise, this causes an erroneous entry to be added to the iotlb. This entry has a range size of 0 (due to u64 overflow). This then causes

Re: [PATCH] tools/virtio: Test virtual address range detection

2022-02-21 Thread Stefano Garzarella
On Mon, Feb 21, 2022 at 04:15:22PM +, David Woodhouse wrote: As things stand, an application which wants to use vhost with a trivial 1:1 mapping of its virtual address space is forced to jump through hoops to detect what the address range might be. The VHOST_SET_MEM_TABLE ioctl helpfully

Re: [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-22 Thread Stefano Garzarella
On Tue, Feb 22, 2022 at 08:30:17AM +0300, Dan Carpenter wrote: Hi Stefano, url: https://github.com/0day-ci/linux/commits/Stefano-Garzarella/vhost-vsock-don-t-check-owner-in-vhost_vsock_stop-while-releasing/20220221-195038 base: https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git

Re: [PATCH] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-22 Thread Stefano Garzarella
On Tue, Feb 22, 2022 at 01:06:12AM +0530, Anirudh Rayabharam wrote: On Mon, Feb 21, 2022 at 07:26:28PM +0100, Stefano Garzarella wrote: On Mon, Feb 21, 2022 at 11:33:11PM +0530, Anirudh Rayabharam wrote: > On Mon, Feb 21, 2022 at 05:44:20PM +0100, Stefano Garzarella wrote: > > On Mo

[PATCH v2] vhost/vsock: don't check owner in vhost_vsock_stop() while releasing

2022-02-22 Thread Stefano Garzarella
"VSOCK: Introduce vhost_vsock.ko") Cc: sta...@vger.kernel.org Reported-by: syzbot+1e3ea63db39f2b444...@syzkaller.appspotmail.com Reported-and-tested-by: syzbot+3140b17cb44a7b174...@syzkaller.appspotmail.com Signed-off-by: Stefano Garzarella --- v2: - initialized `ret` in vhost_vsock_stop [Dan]

Re: [syzbot] kernel BUG in vhost_get_vq_desc

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 02, 2022 at 08:29:41AM +, Lee Jones wrote: On Fri, 18 Feb 2022, Michael S. Tsirkin wrote: On Thu, Feb 17, 2022 at 05:21:20PM -0800, syzbot wrote: > syzbot has found a reproducer for the following issue on: > > HEAD commit:f71077a4d84b Merge tag 'mmc-v5.17-rc1-2' of

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

2022-03-02 Thread Stefano Garzarella
ter in vhost_dev_cleanup() the worker should be already stopped, so it shouldn't be necessary to take the mutex. But in order to prevent future issues maybe it's better to take them, so: Reviewed-by: Stefano Garzarella [1] https://syzkaller.appspot.com/bug?id=993d8b5e64393ed9e6a70f9ae4de0119c605a

Re: [syzbot] kernel BUG in vhost_get_vq_desc

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 02, 2022 at 10:18:07AM +0100, Stefano Garzarella wrote: On Wed, Mar 02, 2022 at 08:29:41AM +, Lee Jones wrote: On Fri, 18 Feb 2022, Michael S. Tsirkin wrote: On Thu, Feb 17, 2022 at 05:21:20PM -0800, syzbot wrote: syzbot has found a reproducer for the following issue

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

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 02, 2022 at 08:35:08AM -0500, Michael S. Tsirkin wrote: On Wed, Mar 02, 2022 at 10:34:46AM +0100, Stefano Garzarella wrote: On Wed, Mar 02, 2022 at 07:54:21AM +, Lee Jones wrote: > vhost_vsock_handle_tx_kick() already holds the mutex during its call > to vhost_get_v

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

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 02, 2022 at 09:50:38AM -0500, Michael S. Tsirkin wrote: On Wed, Mar 02, 2022 at 03:11:21PM +0100, Stefano Garzarella wrote: On Wed, Mar 02, 2022 at 08:35:08AM -0500, Michael S. Tsirkin wrote: > On Wed, Mar 02, 2022 at 10:34:46AM +0100, Stefano Garzarella wrote: > > On We

Re: [virtio-comment] [PATCH v5 2/2] virtio-vsock: add mergeable buffer feature bit

2022-03-02 Thread Stefano Garzarella
On Thu, Feb 24, 2022 at 10:15:47PM +, beshleman.dev...@gmail.com wrote: From: Jiang Wang Add support for mergeable buffers for virtio-vsock. Mergeable buffers allow individual large packets to be spread across multiple buffers while still using only a single packet header. This avoids

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

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 02, 2022 at 04:49:17PM +, Lee Jones wrote: On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: On Wed, Mar 02, 2022 at 05:28:31PM +0100, Stefano Garzarella wrote: > On Wed, Mar 2, 2022 at 3:57 PM Lee Jones wrote: > > > > On Wed, 02 Mar 2022, Michael S

Re: [virtio-comment] [PATCH v5 1/2] virtio-vsock: add description for datagram type

2022-03-02 Thread Stefano Garzarella
Hi Bobby, Sorry for the delay, but I saw these patches today. Please, can you keep me in CC? On Thu, Feb 24, 2022 at 10:15:46PM +, beshleman.dev...@gmail.com wrote: From: Jiang Wang Add supports for datagram type for virtio-vsock. Datagram sockets are connectionless and unreliable. To

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

2022-03-02 Thread Stefano Garzarella
On Wed, Mar 2, 2022 at 3:57 PM Lee Jones wrote: > > On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: > > > On Wed, Mar 02, 2022 at 01:56:35PM +, Lee Jones wrote: > > > On Wed, 02 Mar 2022, Michael S. Tsirkin wrote: > > > > > > > On Wed, Mar 02, 2022 at 07:54:21AM +, Lee Jones wrote: > > > >

Re: [virtio-comment] [PATCH v5 1/2] virtio-vsock: add description for datagram type

2022-03-03 Thread Stefano Garzarella
On Thu, Mar 03, 2022 at 03:29:31AM +, Bobby Eshleman wrote: On Wed, Mar 02, 2022 at 05:09:58PM +0100, Stefano Garzarella wrote: Hi Bobby, Sorry for the delay, but I saw these patches today. Please, can you keep me in CC? Hey Stefano, sorry about that. I'm not sure how I lost your CC

Re: [PATCH 1/1] vhost: Provide a kernel warning if mutex is held whilst clean-up in progress

2022-03-03 Thread Stefano Garzarella
On Thu, Mar 03, 2022 at 04:01:06PM -0500, Michael S. Tsirkin wrote: On Thu, Mar 03, 2022 at 09:14:36PM +0200, Leon Romanovsky wrote: On Thu, Mar 03, 2022 at 03:19:29PM +, Lee Jones wrote: > All workers/users should be halted before any clean-up should take place. > > Suggested-by: Michael

[PATCH net v2 0/3] vsock/virtio: enable VQs early on probe and finish the setup before using them

2022-03-23 Thread Stefano Garzarella
before using the VQs in the probe [MST] v1: https://lore.kernel.org/netdev/20220322103823.83411-1-sgarz...@redhat.com/ Stefano Garzarella (3): vsock/virtio: enable VQs early on probe vsock/virtio: initialize vdev->priv before using VQs vsock/virtio: read the negotiated features before us

[PATCH net v2 1/3] vsock/virtio: enable VQs early on probe

2022-03-23 Thread Stefano Garzarella
. Fixes: 0ea9e1d3a9e3 ("VSOCK: Introduce virtio_transport.ko") Signed-off-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 5afc194a58bb..b1962f8cd

[PATCH net v2 2/3] vsock/virtio: initialize vdev->priv before using VQs

2022-03-23 Thread Stefano Garzarella
el S. Tsirkin Signed-off-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index b1962f8cd502..fff67ad39087 100644 --- a/net/vmw_vsock/virtio_transpor

[PATCH net v2 3/3] vsock/virtio: read the negotiated features before using VQs

2022-03-23 Thread Stefano Garzarella
Complete the driver configuration, reading the negotiated features, before using the VQs and tell the device that the driver is ready in the virtio_vsock_probe(). Fixes: 53efbba12cc7 ("virtio/vsock: enable SEQPACKET for transport") Suggested-by: Michael S. Tsirkin Signed-off-b

Re: [PATCH] virtio: use virtio_device_ready() in virtio_device_restore()

2022-03-23 Thread Stefano Garzarella
On Wed, Mar 23, 2022 at 11:10:27AM +0800, Jason Wang wrote: On Tue, Mar 22, 2022 at 10:07 PM Michael S. Tsirkin wrote: On Tue, Mar 22, 2022 at 12:43:13PM +0100, Stefano Garzarella wrote: > After waking up a suspended VM, the kernel prints the following trace > for virtio drivers wh

Re: [PATCH net v2 1/3] vsock/virtio: enable VQs early on probe

2022-03-23 Thread Stefano Garzarella
On Wed, Mar 23, 2022 at 01:44:42PM +, Stefan Hajnoczi wrote: On Wed, Mar 23, 2022 at 09:49:52AM +0100, Stefano Garzarella wrote: virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after probe returns, but virtio-vsock driver uses VQs in the probe

Re: [PATCH net v2 0/3] vsock/virtio: enable VQs early on probe and finish the setup before using them

2022-03-23 Thread Stefano Garzarella
On Wed, Mar 23, 2022 at 09:22:02AM -0400, Michael S. Tsirkin wrote: On Wed, Mar 23, 2022 at 09:49:51AM +0100, Stefano Garzarella wrote: The first patch fixes a virtio-spec violation. The other two patches complete the driver configuration before using the VQs in the probe. The patch order

[PATCH net v3 0/3] vsock/virtio: enable VQs early on probe and finish the setup before using them

2022-03-23 Thread Stefano Garzarella
/20220323084954.11769-1-sgarz...@redhat.com/ v1: https://lore.kernel.org/netdev/20220322103823.83411-1-sgarz...@redhat.com/ Stefano Garzarella (3): vsock/virtio: initialize vdev->priv before using VQs vsock/virtio: read the negotiated features before using VQs vsock/virtio: enable VQs ea

[PATCH net v3 2/3] vsock/virtio: read the negotiated features before using VQs

2022-03-23 Thread Stefano Garzarella
Complete the driver configuration, reading the negotiated features, before using the VQs in the virtio_vsock_probe(). Fixes: 53efbba12cc7 ("virtio/vsock: enable SEQPACKET for transport") Suggested-by: Michael S. Tsirkin Reviewed-by: Stefan Hajnoczi Signed-off-by: Stefano Garzarella

[PATCH net v3 1/3] vsock/virtio: initialize vdev->priv before using VQs

2022-03-23 Thread Stefano Garzarella
el S. Tsirkin Signed-off-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 5afc194a58bb..3e5513934c9f 100644 --- a/net/vmw_vsock/virtio_transpor

[PATCH net v3 3/3] vsock/virtio: enable VQs early on probe

2022-03-23 Thread Stefano Garzarella
. Fixes: 0ea9e1d3a9e3 ("VSOCK: Introduce virtio_transport.ko") Signed-off-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 3954d3be9083..ba1c8cc0c

Re: [PATCH 1/3] virtio: use virtio_device_ready() in virtio_device_restore()

2022-03-24 Thread Stefano Garzarella
On Thu, Mar 24, 2022 at 06:48:05AM -0400, Michael S. Tsirkin wrote: On Thu, Mar 24, 2022 at 04:40:02PM +0800, Jason Wang wrote: From: Stefano Garzarella This avoids setting DRIVER_OK twice for those drivers that call virtio_device_ready() in the .restore Is this trying to say it's faster

Re: [PATCH 2/3] virtio: use virtio_reset_device() when possible

2022-03-24 Thread Stefano Garzarella
Reviewed-by: Stefano Garzarella ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH 1/3] virtio: use virtio_device_ready() in virtio_device_restore()

2022-03-24 Thread Stefano Garzarella
On Thu, Mar 24, 2022 at 07:07:09AM -0400, Michael S. Tsirkin wrote: On Thu, Mar 24, 2022 at 12:03:07PM +0100, Stefano Garzarella wrote: On Thu, Mar 24, 2022 at 06:48:05AM -0400, Michael S. Tsirkin wrote: > On Thu, Mar 24, 2022 at 04:40:02PM +0800, Jason Wang wrote: > > From: Stefano G

Re: [PATCH] virtio_ring: remove unnecessary to_vvq call in vring hot path

2022-03-28 Thread Stefano Garzarella
On Thu, Mar 24, 2022 at 03:33:40PM +0800, Xianting Tian wrote: It passes '_vq' to virtqueue_use_indirect(), which still calls to_vvq to get 'vq', let's directly pass 'vq'. It can avoid unnecessary call of to_vvq in hot path. It seems reasonable to me. Other tiny optimization: Add unlikely

[PATCH net] vsock/virtio: enable VQs early on probe

2022-03-22 Thread Stefano Garzarella
. Fixes: 0ea9e1d3a9e3 ("VSOCK: Introduce virtio_transport.ko") Signed-off-by: Stefano Garzarella --- net/vmw_vsock/virtio_transport.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c index 5afc194a58bb..b1962f8cd

[PATCH] virtio: use virtio_device_ready() in virtio_device_restore()

2022-03-22 Thread Stefano Garzarella
. Fixes: d50497eb4e55 ("virtio_config: introduce a new .enable_cbs method") Signed-off-by: Stefano Garzarella --- I'm not sure about the fixes tag. That one is more generic, but the following one I think introduced the issue. Fixes: 9e35276a5344 ("virtio_pci: harden MSI-X interrupts&q

Re: [PATCH net] vsock/virtio: enable VQs early on probe

2022-03-22 Thread Stefano Garzarella
On Tue, Mar 22, 2022 at 09:36:14AM -0400, Michael S. Tsirkin wrote: On Tue, Mar 22, 2022 at 11:38:23AM +0100, Stefano Garzarella wrote: virtio spec requires drivers to set DRIVER_OK before using VQs. This is set automatically after probe returns, but virtio-vsock driver uses VQs in the probe

Re: [PATCH net] vsock/virtio: enable VQs early on probe

2022-03-22 Thread Stefano Garzarella
On Tue, Mar 22, 2022 at 10:09:06AM -0400, Michael S. Tsirkin wrote: On Tue, Mar 22, 2022 at 03:05:00PM +0100, Stefano Garzarella wrote: On Tue, Mar 22, 2022 at 09:36:14AM -0400, Michael S. Tsirkin wrote: > On Tue, Mar 22, 2022 at 11:38:23AM +0100, Stefano Garzarella wrote: > > vi

Re: [PATCH 2/2] virtio_ring: add unlikely annotation for free descs check

2022-03-29 Thread Stefano Garzarella
On Mon, Mar 28, 2022 at 06:58:17PM +0800, Xianting Tian wrote: The 'if (vq->vq.num_free < descs_used)' check will almost always be false. Signed-off-by: Xianting Tian --- drivers/virtio/virtio_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Stefano Garz

Re: [PATCH 1/2] virtio_ring: remove unnecessary to_vvq call in vring hot path

2022-03-29 Thread Stefano Garzarella
+++- 1 file changed, 3 insertions(+), 5 deletions(-) Reviewed-by: Stefano Garzarella diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 962f1477b1fa..d597fc0874ec 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -205,11 +205,9

Re: [PATCH v3] vhost: cache avail index in vhost_enable_notify()

2022-02-02 Thread Stefano Garzarella
On Wed, Feb 02, 2022 at 06:24:05AM -0500, Michael S. Tsirkin wrote: On Wed, Feb 02, 2022 at 11:14:30AM +, Stefan Hajnoczi wrote: On Fri, Jan 28, 2022 at 10:41:29AM +0100, Stefano Garzarella wrote: > In vhost_enable_notify() we enable the notifications and we read > the avail index to

[PATCH v3] vhost: cache avail index in vhost_enable_notify()

2022-01-28 Thread Stefano Garzarella
vhost_enable_notify()/vhost_disable_notify() on every cycle when calling vhost_get_vq_desc(); in this case we observed a more evident improvement, with a reduction of the test execution time of about 3.7%. Signed-off-by: Stefano Garzarella --- v3 - reworded commit description [Stefan] --- drivers/vhost

[PATCH] tools/virtio: fix virtio_test execution

2022-01-18 Thread Stefano Garzarella
virtio_test hangs on __vring_new_virtqueue() because `vqs_list_lock` is not initialized. Let's initialize it in vdev_info_init(). Signed-off-by: Stefano Garzarella --- tools/virtio/virtio_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virtio/virtio_test.c b/tools/virtio

[PATCH v2] vhost: cache avail index in vhost_enable_notify()

2022-01-21 Thread Stefano Garzarella
()/vhost_disable_notify() on every cycle when calling vhost_get_vq_desc(); in this case we observed a more evident improvement, with a reduction of the test execution time of about 3.7%. Signed-off-by: Stefano Garzarella --- v2 - added performance info in the commit description [MST] --- drivers

Re: [PATCH v1] vhost: cache avail index in vhost_enable_notify()

2022-01-20 Thread Stefano Garzarella
On Fri, Jan 14, 2022 at 2:40 PM Michael S. Tsirkin wrote: > > On Fri, Jan 14, 2022 at 02:38:16PM +0100, Stefano Garzarella wrote: > > On Fri, Jan 14, 2022 at 07:45:35AM -0500, Michael S. Tsirkin wrote: > > > On Fri, Jan 14, 2022 at 10:05:08AM +0100, Ste

Re: [PATCH v1] vhost: cache avail index in vhost_enable_notify()

2022-01-25 Thread Stefano Garzarella
On Mon, Jan 24, 2022 at 11:31:49AM +, Stefan Hajnoczi wrote: On Fri, Jan 14, 2022 at 10:05:08AM +0100, Stefano Garzarella wrote: In vhost_enable_notify() we enable the notifications and we read the avail index to check if new buffers have become available in the meantime. We

Re: [PATCH v1] vhost: cache avail index in vhost_enable_notify()

2022-01-14 Thread Stefano Garzarella
On Fri, Jan 14, 2022 at 07:45:35AM -0500, Michael S. Tsirkin wrote: On Fri, Jan 14, 2022 at 10:05:08AM +0100, Stefano Garzarella wrote: In vhost_enable_notify() we enable the notifications and we read the avail index to check if new buffers have become available in the meantime. We

Re: [PATCH net-next v7 4/4] vsock/virtio: MSG_ZEROCOPY flag support

2023-09-04 Thread Stefano Garzarella
On Sun, Sep 03, 2023 at 11:13:23AM +0300, Arseniy Krasnov wrote: On 01.09.2023 15:30, Stefano Garzarella wrote: On Sun, Aug 27, 2023 at 11:54:36AM +0300, Arseniy Krasnov wrote: This adds handling of MSG_ZEROCOPY flag on transmission path: if this flag is set and zerocopy transmission

[PATCH net-next 4/5] vsock/test: use send_buf() in vsock_test.c

2023-09-15 Thread Stefano Garzarella
We have a very common pattern used in vsock_test that we can now replace with the new send_buf(). This allows us to reuse the code we already had to check the actual return value and wait for all the bytes to be sent with an appropriate timeout. Signed-off-by: Stefano Garzarella --- tools

[PATCH net-next 2/5] vsock/test: use recv_buf() in vsock_test.c

2023-09-15 Thread Stefano Garzarella
We have a very common pattern used in vsock_test that we can now replace with the new recv_buf(). This allows us to reuse the code we already had to check the actual return value and wait for all bytes to be received with an appropriate timeout. Signed-off-by: Stefano Garzarella --- tools

[PATCH net-next 3/5] vsock/test: add send_buf() utility function

2023-09-15 Thread Stefano Garzarella
Move the code of send_byte() out in a new utility function that can be used to send a generic buffer. This new function can be used when we need to send a custom buffer and not just a single 'A' byte. Signed-off-by: Stefano Garzarella --- tools/testing/vsock/util.h | 2 + tools/testing/vsock

[PATCH net-next 0/5] vsock/test: add recv_buf()/send_buf() utility functions and some improvements

2023-09-15 Thread Stefano Garzarella
appreciated :-) [1] https://lore.kernel.org/netdev/63xflnwiohdfo6m3vnrrxgv2ulplencpwug5qqacugqh7xxpu3@tsczkuqgwurb/ Stefano Garzarella (5): vsock/test: add recv_buf() utility function vsock/test: use recv_buf() in vsock_test.c vsock/test: add send_buf() utility function vsock/test: use

[PATCH net-next 1/5] vsock/test: add recv_buf() utility function

2023-09-15 Thread Stefano Garzarella
Move the code of recv_byte() out in a new utility function that can be used to receive a generic buffer. This new function can be used when we need to receive a custom buffer and not just a single 'A' byte. Signed-off-by: Stefano Garzarella --- tools/testing/vsock/util.h | 1 + tools/testing

[PATCH net-next 5/5] vsock/test: track bytes in MSG_PEEK test for SOCK_SEQPACKET

2023-09-15 Thread Stefano Garzarella
The test was a bit complicated to read. Added variables to keep track of the bytes read and to be read in each step. Also some comments. The test is unchanged. Signed-off-by: Stefano Garzarella --- tools/testing/vsock/vsock_test.c | 14 +++--- 1 file changed, 11 insertions(+), 3

Re: [PATCH net-next v7 4/4] vsock/virtio: MSG_ZEROCOPY flag support

2023-09-01 Thread Stefano Garzarella
On Sun, Aug 27, 2023 at 11:54:36AM +0300, Arseniy Krasnov wrote: This adds handling of MSG_ZEROCOPY flag on transmission path: if this flag is set and zerocopy transmission is possible (enabled in socket options and transport allows zerocopy), then non-linear skb will be created and filled with

Re: [PATCH net-next v7 2/4] vsock/virtio: support to send non-linear skb

2023-09-01 Thread Stefano Garzarella
On Sun, Aug 27, 2023 at 11:54:34AM +0300, Arseniy Krasnov wrote: For non-linear skb use its pages from fragment array as buffers in virtio tx queue. These pages are already pinned by 'get_user_pages()' during such skb creation. Signed-off-by: Arseniy Krasnov --- Changelog: v2 -> v3: * Comment

Re: [PATCH net-next v7 1/4] vsock/virtio/vhost: read data from non-linear skb

2023-09-01 Thread Stefano Garzarella
| 14 +++ include/linux/virtio_vsock.h| 1 + net/vmw_vsock/virtio_transport_common.c | 32 +++-- 3 files changed, 29 insertions(+), 18 deletions(-) Reviewed-by: Stefano Garzarella ___ Virtualization mailing l

Re: [PATCH] virtio-vsock: add VIRTIO_VSOCK_F_DGRAM feature bit

2023-09-01 Thread Stefano Garzarella
On Tue, Aug 29, 2023 at 09:29:45PM +, Bobby Eshleman wrote: This adds support for datagrams to the virtio-vsock device. virtio-vsock already supports stream and seqpacket types. The existing message types and header fields are extended to support datagrams. Semantic differences between the

Re: [RFC PATCH v2 1/2] vsock: send SIGPIPE on write to shutdowned socket

2023-08-31 Thread Stefano Garzarella
Krasnov --- net/vmw_vsock/af_vsock.c | 3 +++ 1 file changed, 3 insertions(+) Reviewed-by: Stefano Garzarella diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index 020cf17ab7e4..013b65241b65 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -1921,6 +1921,9

Re: [RFC PATCH v2 2/2] test/vsock: shutdowned socket test

2023-08-31 Thread Stefano Garzarella
| 138 +++ 1 file changed, 138 insertions(+) Reviewed-by: Stefano Garzarella diff --git a/tools/testing/vsock/vsock_test.c b/tools/testing/vsock/vsock_test.c index 90718c2fd4ea..148fc9c47c50 100644 --- a/tools/testing/vsock/vsock_test.c +++ b/tools/testing/vsock

Re: [RFC PATCH v2 0/2] vsock: handle writes to shutdowned socket

2023-08-31 Thread Stefano Garzarella
is sent only for SOCK_STREAM as discussed in v1 with Stefano Garzarella . * 0002 - use 'sig_atomic_t' instead of 'bool' for flag variables updated from signal handler. Arseniy Krasnov (2): vsock: send SIGPIPE on write to shutdowned socket test/vsock: shutdowned socket test Thanks for this se

Re: [PATCH net-next v8 4/4] vsock/virtio: MSG_ZEROCOPY flag support

2023-09-14 Thread Stefano Garzarella
On Mon, Sep 11, 2023 at 11:22:34PM +0300, Arseniy Krasnov wrote: This adds handling of MSG_ZEROCOPY flag on transmission path: 1) If this flag is set and zerocopy transmission is possible (enabled in socket options and transport allows zerocopy), then non-linear skb will be created and

Re: [PATCH net-next v8 2/4] vsock/virtio: support to send non-linear skb

2023-09-14 Thread Stefano Garzarella
'*out_sgs' in 'virtio_vsock_probe()' by always pointing to the corresponding element of 'out_bufs'. LGTM, thanks for addressing that comments! net/vmw_vsock/virtio_transport.c | 60 1 file changed, 53 insertions(+), 7 deletions(-) Reviewed-by: Stefano G

Re: [PATCH net-next v8 0/4] vsock/virtio/vhost: MSG_ZEROCOPY preparations

2023-09-14 Thread Stefano Garzarella
, Stefano Garzarella suggested to split it for three parts to simplify review and merging: 1) virtio and vhost updates (for fragged skbs) <--- this patchset 2) AF_VSOCK updates (allows to enable MSG_ZEROCOPY mode and read tx completions) and update for Documentation/. 3) Updates for tests and ut

Re: [PATCH net-next v8 0/4] vsock/virtio/vhost: MSG_ZEROCOPY preparations

2023-09-14 Thread Stefano Garzarella
On Thu, Sep 14, 2023 at 05:05:17PM +0300, Arseniy Krasnov wrote: Hello Stefano, On 14.09.2023 17:07, Stefano Garzarella wrote: Hi Arseniy, On Mon, Sep 11, 2023 at 11:22:30PM +0300, Arseniy Krasnov wrote: Hello, this patchset is first of three parts of another big patchset for MSG_ZEROCOPY

Re: [PATCH] virtio-vsock: add VIRTIO_VSOCK_F_DGRAM feature bit

2023-09-06 Thread Stefano Garzarella
On Sat, Sep 02, 2023 at 04:35:25AM -0400, Michael S. Tsirkin wrote: On Sat, Sep 02, 2023 at 04:56:42AM +, Bobby Eshleman wrote: On Fri, Sep 01, 2023 at 02:45:14PM +0200, Stefano Garzarella wrote: > On Tue, Aug 29, 2023 at 09:29:45PM +, Bobby Eshleman wrote: > > This add

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

2023-10-13 Thread Stefano Garzarella
Hi Si-Wei, On Fri, Oct 13, 2023 at 01:23:40AM -0700, Si-Wei Liu wrote: RFC only. Not tested on vdpa-sim-blk with user virtual address. I can test it, but what I should stress? Works fine with vdpa-sim-net which uses physical address to map. Can you share your tests? so I'll try to do the

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

2023-10-17 Thread Stefano Garzarella
On Fri, Oct 13, 2023 at 10:29:26AM -0700, Si-Wei Liu wrote: Hi Stefano, On 10/13/2023 2:22 AM, Stefano Garzarella wrote: Hi Si-Wei, On Fri, Oct 13, 2023 at 01:23:40AM -0700, Si-Wei Liu wrote: RFC only. Not tested on vdpa-sim-blk with user virtual address. I can test it, but what I should

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

2023-10-17 Thread Stefano Garzarella
On Thu, Oct 12, 2023 at 11:16:54AM -0400, Michael S. Tsirkin wrote: On Thu, Oct 12, 2023 at 05:10:50PM +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

Re: [syzbot] [net?] KMSAN: uninit-value in virtio_transport_recv_pkt

2023-10-27 Thread Stefano Garzarella
On Fri, Oct 27, 2023 at 10:48:39AM +0200, Eric Dumazet wrote: On Fri, Oct 27, 2023 at 10:25 AM Stefano Garzarella wrote: On Fri, Oct 27, 2023 at 01:11:24AM -0700, syzbot wrote: >Hello, > >syzbot found the following issue on: > >HEAD commit:d90b0276af8f Merge tag 'har

Re: [PATCH net] virtio/vsock: Fix uninit-value in virtio_transport_recv_pkt()

2023-10-27 Thread Stefano Garzarella
On Fri, Oct 27, 2023 at 10:01 AM Stefano Garzarella wrote: > > On Fri, Oct 27, 2023 at 12:01:54AM +0900, Shigeru Yoshida wrote: > >KMSAN reported the following uninit-value access issue: > > > >= >

Re: [PATCH net] virtio/vsock: Fix uninit-value in virtio_transport_recv_pkt()

2023-10-27 Thread Stefano Garzarella
loc = cpu_to_le32(0); + hdr->fwd_cnt = cpu_to_le32(0); if (info->msg && len > 0) { payload = skb_put(skb, len); -- 2.41.0 Reviewed-by: Stefano Garzarella Thanks, Stefano ___ Virtualization mailing list

Re: [syzbot] [net?] KMSAN: uninit-value in virtio_transport_recv_pkt

2023-10-27 Thread Stefano Garzarella
On Fri, Oct 27, 2023 at 01:11:24AM -0700, syzbot wrote: Hello, syzbot found the following issue on: HEAD commit:d90b0276af8f Merge tag 'hardening-v6.6-rc3' of git://git.k.. git tree: upstream console+strace: https://syzkaller.appspot.com/x/log.txt?x=102c8b2268 kernel config:

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

2023-10-27 Thread Stefano Garzarella
On Fri, Oct 27, 2023 at 11:27:40AM +0200, Takashi Iwai wrote: On Wed, 25 Oct 2023 11:49:19 +0200, 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

<    5   6   7   8   9   10   11   12   13   14   >