Re: [syzbot] [kvm?] [net?] [virt?] general protection fault in vhost_work_queue

2023-06-05 Thread Stefano Garzarella
On Thu, Jun 01, 2023 at 11:33:09AM -0500, Mike Christie wrote: On 6/1/23 2:47 AM, Stefano Garzarella wrote: static void vhost_worker_free(struct vhost_dev *dev) { -    struct vhost_worker *worker = dev->worker; +    struct vhost_task *vtsk = READ_ONCE(dev->worker.vtsk); -    if (!worker) +   

Re: [PATCH net] virtio/vsock: fix sock refcnt bug on owner set failure

2023-06-05 Thread Stefano Garzarella
On Wed, May 31, 2023 at 03:35:30AM +, Bobby Eshleman wrote: On Thu, Jun 01, 2023 at 09:58:47AM +0200, Stefano Garzarella wrote: On Wed, May 31, 2023 at 07:47:32PM +, Bobby Eshleman wrote: > Previous to setting the owner the socket is found via > vsock_find_connected_socket(), which

Re: [PATCH] vp_vdpa: Check queue number of vdpa device from add_config

2023-06-05 Thread Jason Wang
On Fri, Jun 2, 2023 at 3:35 PM Angus Chen wrote: > > When add virtio_pci vdpa device,check the vqs number of device cap > and max_vq_pairs from add_config. > > Signed-off-by: Angus Chen > --- > drivers/vdpa/virtio_pci/vp_vdpa.c | 11 +-- > 1 file changed, 9 insertions(+), 2 deletions(-)

Re: [PATCH v2 2/3] vhost: support PACKED when setting-getting vring_base

2023-06-05 Thread Stefano Garzarella
On Fri, Jun 02, 2023 at 07:36:26AM -0400, Michael S. Tsirkin wrote: On Thu, May 18, 2023 at 09:34:25AM +0200, Stefano Garzarella wrote: I think we should do one of these things, though: - mask VIRTIO_F_RING_PACKED in the stable kernels when VHOST_GET_FEAETURES is called - backport this patch on

Re: [PATCH RFC 13/43] x86/paravirt: Use relative reference for original instruction

2023-06-05 Thread Nadav Amit via Virtualization
> On Jun 1, 2023, at 2:29 AM, Juergen Gross wrote: > > On 28.04.23 11:50, Hou Wenlong wrote: >> Similar to the alternative patching, use relative reference for original >> instruction rather than absolute one, which saves 8 bytes for one entry >> on x86_64. And it could generate

Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature

2023-06-05 Thread Michael S. Tsirkin
On Mon, Jun 05, 2023 at 01:06:44PM +0200, Stefano Garzarella wrote: > vhost-vdpa IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_BASE) > don't support packed virtqueue well yet, so let's filter the > VIRTIO_F_RING_PACKED feature for now in vhost_vdpa_get_features(). > > This way, even if the

Re: [PATCH] vduse: avoid empty string for dev name

2023-06-05 Thread Michael S. Tsirkin
On Mon, Jun 05, 2023 at 06:48:43AM -0700, 赵盛 wrote: > Fixes: c8a6153b6c59 ("vduse: Introduce VDUSE - vDPA Device in Userspace") Thanks! Just don't do the mangled text and avoid top-posting in the future. > From: "Michael S. Tsirkin" > Date: Mon, Jun 5, 2023, 21:24 > Subject: [External] Re:

Re: [PATCH 3/3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-06-05 Thread Oleg Nesterov
On 06/02, Linus Torvalds wrote: > > On Fri, Jun 2, 2023 at 1:59 PM Oleg Nesterov wrote: > > > > As I said from the very beginning, this code is fine on x86 because > > atomic ops are fully serialised on x86. > > Yes. Other architectures require __smp_mb__{before,after}_atomic for > the bit

Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature

2023-06-05 Thread Stefano Garzarella
On Mon, Jun 05, 2023 at 09:54:57AM -0400, Michael S. Tsirkin wrote: On Mon, Jun 05, 2023 at 03:30:35PM +0200, Stefano Garzarella wrote: On Mon, Jun 05, 2023 at 09:00:25AM -0400, Michael S. Tsirkin wrote: > On Mon, Jun 05, 2023 at 02:54:20PM +0200, Stefano Garzarella wrote: > > On Mon, Jun 05,

Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature

2023-06-05 Thread Stefano Garzarella
On Mon, Jun 05, 2023 at 08:41:54AM -0400, Michael S. Tsirkin wrote: On Mon, Jun 05, 2023 at 01:06:44PM +0200, Stefano Garzarella wrote: vhost-vdpa IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_BASE) don't support packed virtqueue well yet, so let's filter the VIRTIO_F_RING_PACKED feature

Re: [PATCH] vduse: avoid empty string for dev name

2023-06-05 Thread Michael S. Tsirkin
On Mon, Jun 05, 2023 at 06:17:55AM -0700, 赵盛 wrote: > Hi Yongji,  > Thanks for your feedback, I'll resubmit the patch with this change. Just send a Fixes tag in a reply no need to resubmit - I queued it already. > Sheng > From: "Yongji Xie" > Date:  Thu, Jun 1, 2023, 11:31 > Subject:  Re:

Re: [CFT][PATCH v3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-06-05 Thread Oleg Nesterov
On 06/02, Eric W. Biederman wrote: > > static int vhost_task_fn(void *data) > { > struct vhost_task *vtsk = data; > - int ret; > + bool dead = false; > + > + for (;;) { > + bool did_work; > + > + if (!dead && signal_pending(current)) { > +

Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature

2023-06-05 Thread Michael S. Tsirkin
On Mon, Jun 05, 2023 at 02:54:20PM +0200, Stefano Garzarella wrote: > On Mon, Jun 05, 2023 at 08:41:54AM -0400, Michael S. Tsirkin wrote: > > On Mon, Jun 05, 2023 at 01:06:44PM +0200, Stefano Garzarella wrote: > > > vhost-vdpa IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_BASE) > > > don't

Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature

2023-06-05 Thread Stefano Garzarella
On Mon, Jun 05, 2023 at 09:00:25AM -0400, Michael S. Tsirkin wrote: On Mon, Jun 05, 2023 at 02:54:20PM +0200, Stefano Garzarella wrote: On Mon, Jun 05, 2023 at 08:41:54AM -0400, Michael S. Tsirkin wrote: > On Mon, Jun 05, 2023 at 01:06:44PM +0200, Stefano Garzarella wrote: > > vhost-vdpa IOCTLs

Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature

2023-06-05 Thread Michael S. Tsirkin
On Mon, Jun 05, 2023 at 03:30:35PM +0200, Stefano Garzarella wrote: > On Mon, Jun 05, 2023 at 09:00:25AM -0400, Michael S. Tsirkin wrote: > > On Mon, Jun 05, 2023 at 02:54:20PM +0200, Stefano Garzarella wrote: > > > On Mon, Jun 05, 2023 at 08:41:54AM -0400, Michael S. Tsirkin wrote: > > > > On

Re: [CFT][PATCH v3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-06-05 Thread Mike Christie
On 6/5/23 10:10 AM, Oleg Nesterov wrote: > On 06/03, michael.chris...@oracle.com wrote: >> >> On 6/2/23 11:15 PM, Eric W. Biederman wrote: >> The problem is that as part of the flush the drivers/vhost/scsi.c code >> will wait for outstanding commands, because we can't free the device and >> it's

[PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature

2023-06-05 Thread Stefano Garzarella
vhost-vdpa IOCTLs (eg. VHOST_GET_VRING_BASE, VHOST_SET_VRING_BASE) don't support packed virtqueue well yet, so let's filter the VIRTIO_F_RING_PACKED feature for now in vhost_vdpa_get_features(). This way, even if the device supports it, we don't risk it being negotiated, then the VMM is unable to

Re: [PATCH 1/1] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-06-05 Thread Oleg Nesterov
On 06/01, Mike Christie wrote: > > --- a/kernel/signal.c > +++ b/kernel/signal.c > @@ -1368,7 +1368,9 @@ int zap_other_threads(struct task_struct *p) > > while_each_thread(p, t) { > task_clear_jobctl_pending(t, JOBCTL_PENDING_MASK); > - count++; > + /*

Re: [CFT][PATCH v3] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-06-05 Thread Oleg Nesterov
On 06/03, michael.chris...@oracle.com wrote: > > On 6/2/23 11:15 PM, Eric W. Biederman wrote: > The problem is that as part of the flush the drivers/vhost/scsi.c code > will wait for outstanding commands, because we can't free the device and > it's resources before the commands complete or we will

Re: [PATCH 1/1] fork, vhost: Use CLONE_THREAD to fix freezer/ps regression

2023-06-05 Thread Oleg Nesterov
On 06/02, Eric W. Biederman wrote: > > Oleg Nesterov writes: > > > Hi Mike, > > > > sorry, but somehow I can't understand this patch... > > > > I'll try to read it with a fresh head on Weekend, but for example, > > > > On 06/01, Mike Christie wrote: > >> > >> static int vhost_task_fn(void *data)

Re: [PATCH V3] virtio-fs: Improved request latencies when Virtio queue is full

2023-06-05 Thread Vivek Goyal
On Fri, Jun 02, 2023 at 03:32:26PM +0200, Peter-Jan Gootzen wrote: > When the Virtio queue is full, a work item is scheduled > to execute in 1ms that retries adding the request to the queue. > This is a large amount of time on the scale on which a > virtio-fs device can operate. When using a DPU

[PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls

2023-06-05 Thread Mike Christie
If userspace does VHOST_VSOCK_SET_GUEST_CID before VHOST_SET_OWNER we can race where: 1. thread0 calls vhost_transport_send_pkt -> vhost_work_queue 2. thread1 does VHOST_SET_OWNER which calls vhost_worker_create. 3. vhost_worker_create will set the dev->worker pointer before setting the

Re: [PATCH V3] virtio-fs: Improved request latencies when Virtio queue is full

2023-06-05 Thread Stefan Hajnoczi
On Fri, Jun 02, 2023 at 03:32:26PM +0200, Peter-Jan Gootzen wrote: > When the Virtio queue is full, a work item is scheduled > to execute in 1ms that retries adding the request to the queue. > This is a large amount of time on the scale on which a > virtio-fs device can operate. When using a DPU

Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature

2023-06-05 Thread Michael S. Tsirkin
On Mon, Jun 05, 2023 at 04:56:37PM +0200, Stefano Garzarella wrote: > On Mon, Jun 05, 2023 at 09:54:57AM -0400, Michael S. Tsirkin wrote: > > On Mon, Jun 05, 2023 at 03:30:35PM +0200, Stefano Garzarella wrote: > > > On Mon, Jun 05, 2023 at 09:00:25AM -0400, Michael S. Tsirkin wrote: > > > > On

Re: [PATCH net] virtio_net: use control_buf for coalesce params

2023-06-05 Thread Xuan Zhuo
On Mon, 5 Jun 2023 12:59:25 -0700, Brett Creeley wrote: > Commit 699b045a8e43 ("net: virtio_net: notifications coalescing > support") added coalescing command support for virtio_net. However, > the coalesce commands are using buffers on the stack, which is causing > the device to see DMA errors.

Re: [PATCH vhost v10 07/10] virtio_ring: introduce helpers for premapped

2023-06-05 Thread Xuan Zhuo
On Mon, 5 Jun 2023 01:38:48 -0400, "Michael S. Tsirkin" wrote: > On Mon, Jun 05, 2023 at 10:06:51AM +0800, Xuan Zhuo wrote: > > On Sun, 4 Jun 2023 09:45:14 -0400, "Michael S. Tsirkin" > > wrote: > > > On Fri, Jun 02, 2023 at 05:22:03PM +0800, Xuan Zhuo wrote: > > > > This patch introduces three

Re: [PATCH] vhost-vdpa: filter VIRTIO_F_RING_PACKED feature

2023-06-05 Thread Jason Wang
On Mon, Jun 5, 2023 at 10:58 PM Stefano Garzarella wrote: > > On Mon, Jun 05, 2023 at 09:54:57AM -0400, Michael S. Tsirkin wrote: > >On Mon, Jun 05, 2023 at 03:30:35PM +0200, Stefano Garzarella wrote: > >> On Mon, Jun 05, 2023 at 09:00:25AM -0400, Michael S. Tsirkin wrote: > >> > On Mon, Jun 05,

Re: [RFC PATCH net] virtio_net: Prevent napi_weight changes with VIRTIO_NET_F_NOTF_COAL support

2023-06-05 Thread Xuan Zhuo
On Mon, 5 Jun 2023 14:02:36 -0700, Brett Creeley wrote: > Commit 699b045a8e43 ("net: virtio_net: notifications coalescing > support") added support for VIRTIO_NET_F_NOTF_COAL. The get_coalesce > call made changes to report "1" in tx_max_coalesced_frames if > VIRTIO_NET_F_NOTF_COAL is not

Re: [PATCH vhost v10 10/10] virtio_net: support dma premapped

2023-06-05 Thread Xuan Zhuo
On Mon, 5 Jun 2023 01:44:28 -0400, "Michael S. Tsirkin" wrote: > On Mon, Jun 05, 2023 at 10:10:44AM +0800, Xuan Zhuo wrote: > > On Fri, 2 Jun 2023 23:31:52 -0700, Jakub Kicinski wrote: > > > On Fri, 2 Jun 2023 17:22:06 +0800 Xuan Zhuo wrote: > > > > drivers/net/virtio_net.c | 163

Re: [PATCH net] virtio_net: use control_buf for coalesce params

2023-06-05 Thread Jason Wang
On Tue, Jun 6, 2023 at 3:59 AM Brett Creeley wrote: > > Commit 699b045a8e43 ("net: virtio_net: notifications coalescing > support") added coalescing command support for virtio_net. However, > the coalesce commands are using buffers on the stack, which is causing > the device to see DMA errors.

Re: [RFC PATCH net] virtio_net: Prevent napi_weight changes with VIRTIO_NET_F_NOTF_COAL support

2023-06-05 Thread Jason Wang
On Tue, Jun 6, 2023 at 9:57 AM Xuan Zhuo wrote: > > On Mon, 5 Jun 2023 14:02:36 -0700, Brett Creeley > wrote: > > Commit 699b045a8e43 ("net: virtio_net: notifications coalescing > > support") added support for VIRTIO_NET_F_NOTF_COAL. The get_coalesce > > call made changes to report "1" in

Re: [RFC PATCH net] virtio_net: Prevent napi_weight changes with VIRTIO_NET_F_NOTF_COAL support

2023-06-05 Thread Jason Wang
On Tue, Jun 6, 2023 at 5:03 AM Brett Creeley wrote: > > Commit 699b045a8e43 ("net: virtio_net: notifications coalescing > support") added support for VIRTIO_NET_F_NOTF_COAL. The get_coalesce > call made changes to report "1" in tx_max_coalesced_frames if > VIRTIO_NET_F_NOTF_COAL is not supported