Re: [PATCH] tools/virtio: pipe assertion in vring_test.c

2024-05-27 Thread Michael S. Tsirkin
On Mon, May 27, 2024 at 04:13:31PM +0900, ysk...@gmail.com wrote: > From: Yunseong Kim > > The virtio_device need to fail checking when create the geust/host pipe. typo > > Signed-off-by: Yunseong Kim I guess ... > --- > tools/virtio/vringh_test.c | 4 ++-- > 1 file changed, 2

Re: [RFC PATCH 0/5] vsock/virtio: Add support for multi-devices

2024-05-23 Thread Michael S. Tsirkin
On Fri, May 17, 2024 at 10:46:02PM +0800, Xuewei Niu wrote: > include/linux/virtio_vsock.h| 2 +- > include/net/af_vsock.h | 25 ++- > include/uapi/linux/virtio_vsock.h | 1 + > include/uapi/linux/vm_sockets.h | 14 ++ > net/vmw_vsock/af_vsock.c

[GIT PULL v2] virtio: features, fixes, cleanups

2024-05-23 Thread Michael S. Tsirkin
with suspend is improved - vhost-scsi now handles signals better/faster. Fixes, cleanups all over the place. Signed-off-by: Michael S. Tsirkin Christophe JAILLET (1): vhost-vdpa: Remove usage of the deprecated ida_simple_xx

Re: [GIT PULL] virtio: features, fixes, cleanups

2024-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2024 at 06:03:08AM -0400, Michael S. Tsirkin wrote: > Things to note here: Sorry Linus, author of one of the patchsets I merged wants to drop it now. I could revert but it seems cleaner to do that, re-test and re-post. Will drop a duplicate as long as I do it. > - t

Re: [GIT PULL] virtio: features, fixes, cleanups

2024-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2024 at 06:22:45PM +0800, Xuan Zhuo wrote: > On Wed, 22 May 2024 06:03:01 -0400, "Michael S. Tsirkin" > wrote: > > Things to note here: > > > > - the new Marvell OCTEON DPU driver is not here: latest v4 keeps causing > > build failures on

[GIT PULL] virtio: features, fixes, cleanups

2024-05-22 Thread Michael S. Tsirkin
. - virtio-net now supports premapped mode by default, opening the door for all kind of zero copy tricks. Fixes, cleanups all over the place. Signed-off-by: Michael S. Tsirkin Christophe JAILLET (1): vhost-vdpa: Remove usage

Re: [PATCH] vhost: use pr_err for vq_err

2024-05-16 Thread Michael S. Tsirkin
On Thu, May 16, 2024 at 03:46:29PM +0800, Peng Fan (OSS) wrote: > From: Peng Fan > > Use pr_err to print out error message without enabling DEBUG. This could > make people catch error easier. > > Signed-off-by: Peng Fan This isn't appropriate: pr_err must not be triggerable by userspace. If

Re: [PATCH net-next] virtio_net: Fix error code in __virtnet_get_hw_stats()

2024-05-15 Thread Michael S. Tsirkin
On Wed, May 15, 2024 at 04:50:48PM +0200, Dan Carpenter wrote: > On Sun, May 12, 2024 at 12:01:55PM -0400, Michael S. Tsirkin wrote: > > On Fri, May 10, 2024 at 03:50:45PM +0300, Dan Carpenter wrote: > > > The virtnet_send_command_reply() function returns true on success or >

[PATCH] vhost/vsock: always initialize seqpacket_allow

2024-05-15 Thread Michael S. Tsirkin
...@syzkaller.appspotmail.com Reported-by: Jeongjun Park Fixes: ced7b713711f ("vhost/vsock: support SEQPACKET for transport"). Cc: Arseny Krasnov Cc: David S. Miller Cc: Stefan Hajnoczi Signed-off-by: Michael S. Tsirkin Acked-by: Arseniy Krasnov Tested-by: Arseniy Krasnov --- Reposting now it's been tested.

Re: [PATCH net-next] virtio_net: Fix error code in __virtnet_get_hw_stats()

2024-05-12 Thread Michael S. Tsirkin
On Fri, May 10, 2024 at 03:50:45PM +0300, Dan Carpenter wrote: > The virtnet_send_command_reply() function returns true on success or > false on failure. The "ok" variable is true/false depending on whether > it succeeds or not. It's up to the caller to translate the true/false > into -EINVAL on

Re: [PATCH next] vhost_task: after freeing vhost_task it should not be accessed in vhost_task_fn

2024-05-01 Thread Michael S. Tsirkin
On Wed, May 01, 2024 at 10:57:38AM -0500, Mike Christie wrote: > On 5/1/24 2:50 AM, Hillf Danton wrote: > > On Wed, 1 May 2024 02:01:20 -0400 Michael S. Tsirkin > >> > >> and then it failed testing. > >> > > So did my patch [1] but then the r

Re: [syzbot] [net?] [virt?] [kvm?] KASAN: slab-use-after-free Read in vhost_task_fn

2024-05-01 Thread Michael S. Tsirkin
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git f138e94c1f0dbeae721917694fb2203446a68ea9

Re: [PATCH next] vhost_task: after freeing vhost_task it should not be accessed in vhost_task_fn

2024-05-01 Thread Michael S. Tsirkin
On Wed, May 01, 2024 at 10:57:38AM -0500, Mike Christie wrote: > On 5/1/24 2:50 AM, Hillf Danton wrote: > > On Wed, 1 May 2024 02:01:20 -0400 Michael S. Tsirkin > >> > >> and then it failed testing. > >> > > So did my patch [1] but then the r

Re: EEVDF/vhost regression (bisected to 86bfbb7ce4f6 sched/fair: Add lag based placement)

2024-05-01 Thread Michael S. Tsirkin
On Wed, May 01, 2024 at 12:51:51PM +0200, Peter Zijlstra wrote: > On Tue, Apr 30, 2024 at 12:50:05PM +0200, Tobias Huschle wrote: > > It took me a while, but I was able to figure out why EEVDF behaves > > different then CFS does. I'm still waiting for some official confirmation > > of my

Re: [PATCH next] vhost_task: after freeing vhost_task it should not be accessed in vhost_task_fn

2024-05-01 Thread Michael S. Tsirkin
On Wed, May 01, 2024 at 08:15:44AM +0800, Hillf Danton wrote: > On Tue, Apr 30, 2024 at 11:23:04AM -0500, Mike Christie wrote: > > On 4/30/24 8:05 AM, Edward Adam Davis wrote: > > > static int vhost_task_fn(void *data) > > > { > > > struct vhost_task *vtsk = data; > > > @@ -51,7 +51,7 @@

Re: [PATCH next] vhost_task: after freeing vhost_task it should not be accessed in vhost_task_fn

2024-04-30 Thread Michael S. Tsirkin
On Tue, Apr 30, 2024 at 08:01:11PM -0500, Mike Christie wrote: > On 4/30/24 7:15 PM, Hillf Danton wrote: > > On Tue, Apr 30, 2024 at 11:23:04AM -0500, Mike Christie wrote: > >> On 4/30/24 8:05 AM, Edward Adam Davis wrote: > >>> static int vhost_task_fn(void *data) > >>> { > >>> struct

Re: [PATCH] virtio_net: Warn if insufficient queue length for transmitting

2024-04-30 Thread Michael S. Tsirkin
On Tue, Apr 30, 2024 at 03:35:09PM -0400, Darius Rad wrote: > The transmit queue is stopped when the number of free queue entries is less > than 2+MAX_SKB_FRAGS, in start_xmit(). If the queue length (QUEUE_NUM_MAX) > is less than then this, transmission will immediately trigger a netdev >

Re: [PATCH next] vhost_task: after freeing vhost_task it should not be accessed in vhost_task_fn

2024-04-30 Thread Michael S. Tsirkin
On Tue, Apr 30, 2024 at 11:23:04AM -0500, Mike Christie wrote: > On 4/30/24 8:05 AM, Edward Adam Davis wrote: > > static int vhost_task_fn(void *data) > > { > > struct vhost_task *vtsk = data; > > @@ -51,7 +51,7 @@ static int vhost_task_fn(void *data) > > schedule(); > >

Re: [PATCH v2 0/4] vhost: Cleanup

2024-04-29 Thread Michael S. Tsirkin
On Mon, Apr 29, 2024 at 08:13:56PM +1000, Gavin Shan wrote: > This is suggested by Michael S. Tsirkin according to [1] and the goal > is to apply smp_rmb() inside vhost_get_avail_idx() if needed. With it, > the caller of the function needn't to worry about memory barriers. Since >

Re: [PATCH v2 4/4] vhost: Reformat vhost_{get, put}_user()

2024-04-29 Thread Michael S. Tsirkin
On Mon, Apr 29, 2024 at 08:14:00PM +1000, Gavin Shan wrote: > Reformat the macros to use tab as the terminator for each line so > that it looks clean. > > No functional change intended. > > Signed-off-by: Gavin Shan Just messes up history for no real gain. > --- > drivers/vhost/vhost.c | 60

Re: [PATCH v2 3/4] vhost: Improve vhost_get_avail_head()

2024-04-29 Thread Michael S. Tsirkin
On Mon, Apr 29, 2024 at 08:13:59PM +1000, Gavin Shan wrote: > Improve vhost_get_avail_head() so that the head or errno is returned. > With it, the relevant sanity checks are squeezed to vhost_get_avail_head() > and vhost_get_vq_desc() is further simplified. > > No functional change intended. > >

Re: [PATCH v2 2/4] vhost: Drop variable last_avail_idx in vhost_get_vq_desc()

2024-04-29 Thread Michael S. Tsirkin
On Mon, Apr 29, 2024 at 08:13:58PM +1000, Gavin Shan wrote: > The local variable @last_avail_idx is equivalent to vq->last_avail_idx. > So the code can be simplified a bit by dropping the local variable > @last_avail_idx. > > No functional change intended. > > Signed-off-by: Gavin Shan > --- >

Re: [PATCH v2 1/4] vhost: Improve vhost_get_avail_idx() with smp_rmb()

2024-04-29 Thread Michael S. Tsirkin
On Mon, Apr 29, 2024 at 08:13:57PM +1000, Gavin Shan wrote: > From: "Michael S. Tsirkin" > > All the callers of vhost_get_avail_idx() are concerned to the memory *with* the memory barrier > barrier, imposed by smp_rmb() to ensure the order of the available > ring entr

Re: [PATCH 0/4] vhost: Cleanup

2024-04-29 Thread Michael S. Tsirkin
On Tue, Apr 23, 2024 at 01:24:03PM +1000, Gavin Shan wrote: > This is suggested by Michael S. Tsirkin according to [1] and the goal > is to apply smp_rmb() inside vhost_get_avail_idx() if needed. With it, > the caller of the function needn't to worry about memory barriers. Since >

Re: 回复: [PATCH v5] vp_vdpa: don't allocate unused msix vectors

2024-04-25 Thread Michael S. Tsirkin
On Tue, Apr 23, 2024 at 08:42:57AM +, Angus Chen wrote: > Hi mst. > > > -Original Message- > > From: Michael S. Tsirkin > > Sent: Tuesday, April 23, 2024 4:35 PM > > To: Gavin Liu > > Cc: jasow...@redhat.com; Angus Chen ; >

[GIT PULL] virtio: bugfix

2024-04-25 Thread Michael S. Tsirkin
to 98a821546b3919a10a58faa12ebe5e9a55cd638e: vDPA: code clean for vhost_vdpa uapi (2024-04-22 17:07:13 -0400) virtio: bugfix enum renames for vdpa uapi - we better do this now before the names have been in any releases. Signed-off-by: Michael S. Tsirkin

Re: [PATCH v5 3/5] vduse: Add function to get/free the pages for reconnection

2024-04-25 Thread Michael S. Tsirkin
On Thu, Apr 25, 2024 at 09:35:58AM +0800, Jason Wang wrote: > On Wed, Apr 24, 2024 at 5:51 PM Michael S. Tsirkin wrote: > > > > On Wed, Apr 24, 2024 at 08:44:10AM +0800, Jason Wang wrote: > > > On Tue, Apr 23, 2024 at 4:42 PM Michael S. Tsirkin > > > wrote: >

Re: [PATCH v5 3/5] vduse: Add function to get/free the pages for reconnection

2024-04-24 Thread Michael S. Tsirkin
On Wed, Apr 24, 2024 at 08:44:10AM +0800, Jason Wang wrote: > On Tue, Apr 23, 2024 at 4:42 PM Michael S. Tsirkin wrote: > > > > On Tue, Apr 23, 2024 at 11:09:59AM +0800, Jason Wang wrote: > > > On Tue, Apr 23, 2024 at 4:05 AM Michael S. Tsirkin > > > wrote: >

Re: [PATCH v3 2/4] virtio_balloon: introduce oom-kill invocations

2024-04-23 Thread Michael S. Tsirkin
On Tue, Apr 23, 2024 at 11:41:07AM +0800, zhenwei pi wrote: > When the guest OS runs under critical memory pressure, the guest > starts to kill processes. A guest monitor agent may scan 'oom_kill' > from /proc/vmstat, and reports the OOM KILL event. However, the agent > may be killed and we will

Re: [PATCH v5 3/5] vduse: Add function to get/free the pages for reconnection

2024-04-23 Thread Michael S. Tsirkin
On Tue, Apr 23, 2024 at 11:09:59AM +0800, Jason Wang wrote: > On Tue, Apr 23, 2024 at 4:05 AM Michael S. Tsirkin wrote: > > > > On Thu, Apr 18, 2024 at 08:57:51AM +0800, Jason Wang wrote: > > > On Wed, Apr 17, 2024 at 5:29 PM Michael S. Tsirkin > > > wrote: >

Re: 回复: [PATCH v5] vp_vdpa: don't allocate unused msix vectors

2024-04-23 Thread Michael S. Tsirkin
why would it trigger? virtio PMD in poll mode presumably suppresses interrupts after all. > > > - Original Message - > From: Michael S. Tsirkin m...@redhat.com > Sent: April 22, 2024 20:09 > To: Gavin Liu gavin@jaguarmicro.com > Cc: jasow...@redhat.com; Angus Chen

Re: [PATCH 0/3] Improve memory statistics for virtio balloon

2024-04-22 Thread Michael S. Tsirkin
On Thu, Apr 18, 2024 at 02:25:59PM +0800, zhenwei pi wrote: > RFC -> v1: > - several text changes: oom-kill -> oom-kills, SCAN_ASYNC -> ASYN_SCAN. > - move vm events codes into '#ifdef CONFIG_VM_EVENT_COUNTERS' > > RFC version: > Link: >

Re: [PATCH v3 3/3] vhost: Improve vhost_get_avail_idx() with smp_rmb()

2024-04-22 Thread Michael S. Tsirkin
On Mon, Apr 08, 2024 at 02:15:24PM +1000, Gavin Shan wrote: > Hi Michael, > > On 3/30/24 19:02, Gavin Shan wrote: > > On 3/28/24 19:31, Michael S. Tsirkin wrote: > > > On Thu, Mar 28, 2024 at 10:21:49AM +1000, Gavin Shan wrote: > > > > All the callers of

Re: [PATCH v2 0/6] virtiofs: fix the warning for ITER_KVEC dio

2024-04-22 Thread Michael S. Tsirkin
On Tue, Apr 09, 2024 at 09:48:08AM +0800, Hou Tao wrote: > Hi, > > On 4/8/2024 3:45 PM, Michael S. Tsirkin wrote: > > On Wed, Feb 28, 2024 at 10:41:20PM +0800, Hou Tao wrote: > >> From: Hou Tao > >> > >> Hi, > >> > >> The p

Re: [PATCH v5 3/5] vduse: Add function to get/free the pages for reconnection

2024-04-22 Thread Michael S. Tsirkin
On Thu, Apr 18, 2024 at 08:57:51AM +0800, Jason Wang wrote: > On Wed, Apr 17, 2024 at 5:29 PM Michael S. Tsirkin wrote: > > > > On Fri, Apr 12, 2024 at 09:28:23PM +0800, Cindy Lu wrote: > > > Add the function vduse_alloc_reconnnect_info_mem > > > an

Re: [PATCH virt] virt: fix uninit-value in vhost_vsock_dev_open

2024-04-22 Thread Michael S. Tsirkin
will leak old VIRTIO_VSOCK_F_SEQPACKET bit value. And I am pretty sure the Fixes tag is wrong. So I wrote this, but I actually don't have a set for seqpacket to test this. Arseny could you help test maybe? Thanks! commit bcc17a060d93b198d8a17a9b87b593f41337ee28 Author: Michael S. Tsirkin Date:

Re: [syzbot] [virt?] [net?] KMSAN: uninit-value in vsock_assign_transport (2)

2024-04-22 Thread Michael S. Tsirkin
On Fri, Apr 19, 2024 at 02:39:20AM -0700, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit:8cd26fd90c1a Merge tag 'for-6.9-rc4-tag' of git://git.kern.. > git tree: upstream > console+strace: https://syzkaller.appspot.com/x/log.txt?x=102d27cd18 >

Re: [PATCH v5] vp_vdpa: don't allocate unused msix vectors

2024-04-22 Thread Michael S. Tsirkin
On Wed, Apr 10, 2024 at 11:30:20AM +0800, lyx634449800 wrote: > From: Yuxue Liu > > When there is a ctlq and it doesn't require interrupt > callbacks,the original method of calculating vectors > wastes hardware msi or msix resources as well as system > IRQ resources. > > When conducting

Re: [PATCH v2 1/4] virtio_balloon: separate vm events into a function

2024-04-22 Thread Michael S. Tsirkin
On Mon, Apr 22, 2024 at 03:42:51PM +0800, zhenwei pi wrote: > All the VM events related statistics have dependence on > 'CONFIG_VM_EVENT_COUNTERS', once any stack variable is required by any > VM events in future, we would have codes like: > #ifdef CONFIG_VM_EVENT_COUNTERS > unsigned long

Re: [PATCH virt] virt: fix uninit-value in vhost_vsock_dev_open

2024-04-20 Thread Michael S. Tsirkin
On Sat, Apr 20, 2024 at 05:57:50PM +0900, Jeongjun Park wrote: > Change vhost_vsock_dev_open() to use kvzalloc() instead of kvmalloc() > to avoid uninit state. > > Reported-by: syzbot+6c21aeb59d0e82eb2...@syzkaller.appspotmail.com > Fixes: dcda9b04713c ("mm, tree wide: replace __GFP_REPEAT by >

Re: [PATCH 1/1] virtio: Add support for the virtio suspend feature

2024-04-18 Thread Michael S. Tsirkin
On Thu, Apr 18, 2024 at 03:14:37PM +0800, Zhu, Lingshan wrote: > > > On 4/17/2024 4:54 PM, David Stevens wrote: > > Add support for the VIRTIO_F_SUSPEND feature. When this feature is > > negotiated, power management can use it to suspend virtio devices > > instead of resorting to resetting the

Re: [PATCH v5 3/5] vduse: Add function to get/free the pages for reconnection

2024-04-17 Thread Michael S. Tsirkin
On Fri, Apr 12, 2024 at 09:28:23PM +0800, Cindy Lu wrote: > Add the function vduse_alloc_reconnnect_info_mem > and vduse_alloc_reconnnect_info_mem > These functions allow vduse to allocate and free memory for reconnection > information. The amount of memory allocated is vq_num pages. > Each VQS

Re: [PATCH] vhost-vdpa: Remove usage of the deprecated ida_simple_xx() API

2024-04-14 Thread Michael S. Tsirkin
On Sun, Apr 14, 2024 at 10:59:06AM +0200, Christophe JAILLET wrote: > Le 14/04/2024 à 10:35, Michael S. Tsirkin a écrit : > > On Mon, Jan 15, 2024 at 09:35:50PM +0100, Christophe JAILLET wrote: > > > ida_alloc() and ida_free() should be preferred to the deprecated &g

Re: [PATCH] vhost-vdpa: Remove usage of the deprecated ida_simple_xx() API

2024-04-14 Thread Michael S. Tsirkin
On Mon, Jan 15, 2024 at 09:35:50PM +0100, Christophe JAILLET wrote: > ida_alloc() and ida_free() should be preferred to the deprecated > ida_simple_get() and ida_simple_remove(). > > Note that the upper limit of ida_simple_get() is exclusive, buInputt the one > of What's buInputt? But? >

[GIT PULL] virtio: bugfixes

2024-04-14 Thread Michael S. Tsirkin
. - i2c-virtio didn't set the driver owner so it did not get refcounted correctly. Signed-off-by: Michael S. Tsirkin Gavin Shan (2): vhost: Add smp_rmb() in vhost_vq_avail_empty() vhost: Add smp_rmb() in vhost_enable_notify

Re: [PATCH v4] vp_vdpa: don't allocate unused msix vectors

2024-04-09 Thread Michael S. Tsirkin
Good and clear subject, I like it. On Tue, Apr 09, 2024 at 04:58:18PM +0800, lyx634449800 wrote: > From: Yuxue Liu > > When there is a ctlq and it doesn't require interrupt > callbacks,the original method of calculating vectors > wastes hardware msi or msix resources as well as system > IRQ

Re: [PATCH] drivers/virtio: delayed configuration descriptor flags

2024-04-09 Thread Michael S. Tsirkin
On Tue, Apr 09, 2024 at 01:02:52AM +0800, ni.liqiang wrote: > In our testing of the virtio hardware accelerator, we found that > configuring the flags of the descriptor after addr and len, > as implemented in DPDK, seems to be more friendly to the hardware. > > In our Virtio hardware

Re: [PATCH v3] vp_vdpa: fix the method of calculating vectors

2024-04-08 Thread Michael S. Tsirkin
better subject: vp_vdpa: don't allocate unused msix vectors to make it clear it's not a bugfix. more comments below, but most importantly this looks like it adds a bug. On Tue, Apr 09, 2024 at 09:49:35AM +0800, lyx634449800 wrote: > When there is a ctlq and it doesn't require interrupt >

Re: [PATCH v3] Documentation: Add reconnect process for VDUSE

2024-04-08 Thread Michael S. Tsirkin
On Mon, Apr 08, 2024 at 08:39:21PM +0800, Cindy Lu wrote: > On Mon, Apr 8, 2024 at 3:40 PM Michael S. Tsirkin wrote: > > > > On Thu, Apr 04, 2024 at 01:56:31PM +0800, Cindy Lu wrote: > > > Add a document explaining the reconnect process, including what the > > >

Re: [PATCH v2 0/6] virtiofs: fix the warning for ITER_KVEC dio

2024-04-08 Thread Michael S. Tsirkin
On Wed, Feb 28, 2024 at 10:41:20PM +0800, Hou Tao wrote: > From: Hou Tao > > Hi, > > The patch set aims to fix the warning related to an abnormal size > parameter of kmalloc() in virtiofs. The warning occurred when attempting > to insert a 10MB sized kernel module kept in a virtiofs with cache

Re: [PATCH v3] Documentation: Add reconnect process for VDUSE

2024-04-08 Thread Michael S. Tsirkin
On Thu, Apr 04, 2024 at 01:56:31PM +0800, Cindy Lu wrote: > Add a document explaining the reconnect process, including what the > Userspace App needs to do and how it works with the kernel. > > Signed-off-by: Cindy Lu > --- > Documentation/userspace-api/vduse.rst | 41

Re: [PATCH v3 3/3] vhost: Improve vhost_get_avail_idx() with smp_rmb()

2024-04-08 Thread Michael S. Tsirkin
On Mon, Apr 08, 2024 at 02:15:24PM +1000, Gavin Shan wrote: > Hi Michael, > > On 3/30/24 19:02, Gavin Shan wrote: > > On 3/28/24 19:31, Michael S. Tsirkin wrote: > > > On Thu, Mar 28, 2024 at 10:21:49AM +1000, Gavin Shan wrote: > > > > All the callers of

Re: [PATCH v3 3/3] vhost: Improve vhost_get_avail_idx() with smp_rmb()

2024-04-08 Thread Michael S. Tsirkin
On Mon, Apr 08, 2024 at 02:15:24PM +1000, Gavin Shan wrote: > Hi Michael, > > On 3/30/24 19:02, Gavin Shan wrote: > > On 3/28/24 19:31, Michael S. Tsirkin wrote: > > > On Thu, Mar 28, 2024 at 10:21:49AM +1000, Gavin Shan wrote: > > > > All the callers of

[PATCH] vhost-vdpa: change ioctl # for VDPA_GET_VRING_SIZE

2024-04-02 Thread Michael S. Tsirkin
. To fix, sort the entries and renumber the ioctl - not too late since it wasn't in any released kernels yet. Cc: Arnaldo Carvalho de Melo Reported-by: Namhyung Kim Fixes: 1496c47065f9 ("vhost-vdpa: uapi to support reporting per vq size") Cc: "Zhu Lingshan" Signed-off-by: Michael S.

Re: [syzbot] [virtualization?] bpf boot error: WARNING: refcount bug in __free_pages_ok

2024-03-31 Thread Michael S. Tsirkin
On Sat, Mar 30, 2024 at 08:37:19AM -0700, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit:6dae957c8eef bpf: fix possible file descriptor leaks in ve.. > git tree: bpf > console output: https://syzkaller.appspot.com/x/log.txt?x=14ec025e18 > kernel

Re: [PATCH net v3] virtio_net: Do not send RSS key if it is not supported

2024-03-31 Thread Michael S. Tsirkin
On Fri, Mar 29, 2024 at 10:16:41AM -0700, Breno Leitao wrote: > There is a bug when setting the RSS options in virtio_net that can break > the whole machine, getting the kernel into an infinite loop. > > Running the following command in any QEMU virtual machine with virtionet > will reproduce

Re: [PATCH v3] vhost/vdpa: Add MSI translation tables to iommu for software-managed MSI

2024-03-29 Thread Michael S. Tsirkin
On Fri, Mar 29, 2024 at 06:39:33PM +0800, Jason Wang wrote: > On Fri, Mar 29, 2024 at 5:13 PM Michael S. Tsirkin wrote: > > > > On Wed, Mar 27, 2024 at 05:08:57PM +0800, Jason Wang wrote: > > > On Thu, Mar 21, 2024 at 3:00 PM Michael S. Tsirkin > > > wrote: >

Re: [PATCH v2] Documentation: Add reconnect process for VDUSE

2024-03-29 Thread Michael S. Tsirkin
On Fri, Mar 29, 2024 at 05:38:25PM +0800, Cindy Lu wrote: > Add a document explaining the reconnect process, including what the > Userspace App needs to do and how it works with the kernel. > > Signed-off-by: Cindy Lu > --- > Documentation/userspace-api/vduse.rst | 41

Re: [PATCH v3] vhost/vdpa: Add MSI translation tables to iommu for software-managed MSI

2024-03-29 Thread Michael S. Tsirkin
On Fri, Mar 29, 2024 at 11:55:50AM +0800, Jason Wang wrote: > On Wed, Mar 27, 2024 at 5:08 PM Jason Wang wrote: > > > > On Thu, Mar 21, 2024 at 3:00 PM Michael S. Tsirkin wrote: > > > > > > On Wed, Mar 20, 2024 at 06:19:12PM +0800, Wang Rong wrote: > > &g

Re: [PATCH v3] vhost/vdpa: Add MSI translation tables to iommu for software-managed MSI

2024-03-29 Thread Michael S. Tsirkin
On Wed, Mar 27, 2024 at 05:08:57PM +0800, Jason Wang wrote: > On Thu, Mar 21, 2024 at 3:00 PM Michael S. Tsirkin wrote: > > > > On Wed, Mar 20, 2024 at 06:19:12PM +0800, Wang Rong wrote: > > > From: Rong Wang > > > > > > Once enable iommu domain for on

Re: [PATCH v3 3/3] vhost: Improve vhost_get_avail_idx() with smp_rmb()

2024-03-28 Thread Michael S. Tsirkin
so that smp_rmb() is executed when > the avail_idx is advanced. With it, the callers needn't to worry > about the memory barrier. > > Suggested-by: Michael S. Tsirkin > Signed-off-by: Gavin Shan Previous patches are ok. This one I feel needs more work - first more code suc

Re: [PATCH untested] vhost: order avail ring reads after index updates

2024-03-27 Thread Michael S. Tsirkin
On Wed, Mar 27, 2024 at 07:52:02PM +, Will Deacon wrote: > On Wed, Mar 27, 2024 at 01:26:23PM -0400, Michael S. Tsirkin wrote: > > vhost_get_vq_desc (correctly) uses smp_rmb to order > > avail ring reads after index reads. > > However, over time we added two more places th

[PATCH untested] vhost: order avail ring reads after index updates

2024-03-27 Thread Michael S. Tsirkin
Reported-by: Gavin Shan Reported-by: Will Deacon Suggested-by: Will Deacon Fixes: 275bf960ac69 ("vhost: better detection of available buffers") Cc: "Jason Wang" Fixes: d3bb267bbdcb ("vhost: cache avail index in vhost_enable_notify()") Cc: "Stefano Garzarella&

Re: [PATCH v2 1/2] vhost: Add smp_rmb() in vhost_vq_avail_empty()

2024-03-27 Thread Michael S. Tsirkin
On Wed, Mar 27, 2024 at 09:38:45AM +1000, Gavin Shan wrote: > A smp_rmb() has been missed in vhost_vq_avail_empty(), spotted by > Will Deacon . Otherwise, it's not ensured the > available ring entries pushed by guest can be observed by vhost > in time, leading to stale available ring entries

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-27 Thread Michael S. Tsirkin
On Tue, Mar 26, 2024 at 03:46:29PM +, Will Deacon wrote: > On Tue, Mar 26, 2024 at 11:43:13AM +, Will Deacon wrote: > > On Tue, Mar 26, 2024 at 09:38:55AM +, Keir Fraser wrote: > > > On Tue, Mar 26, 2024 at 03:49:02AM -0400, Michael S. Tsirkin wrote: > > >

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-26 Thread Michael S. Tsirkin
On Mon, Mar 25, 2024 at 05:34:29PM +1000, Gavin Shan wrote: > > On 3/20/24 17:14, Michael S. Tsirkin wrote: > > On Wed, Mar 20, 2024 at 03:24:16PM +1000, Gavin Shan wrote: > > > On 3/20/24 10:49, Michael S. Tsirkin wrote:> > > > > diff --git a/drivers/v

Re: [PATCH v3] vhost/vdpa: Add MSI translation tables to iommu for software-managed MSI

2024-03-21 Thread Michael S. Tsirkin
On Wed, Mar 20, 2024 at 06:19:12PM +0800, Wang Rong wrote: > From: Rong Wang > > Once enable iommu domain for one device, the MSI > translation tables have to be there for software-managed MSI. > Otherwise, platform with software-managed MSI without an > irq bypass function, can not get a

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-20 Thread Michael S. Tsirkin
On Wed, Mar 20, 2024 at 03:24:16PM +1000, Gavin Shan wrote: > On 3/20/24 10:49, Michael S. Tsirkin wrote:> > > I think you are wasting the time with these tests. Even if it helps what > > does this tell us? Try setting a flag as I suggested elsewhere. > > Then check it

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-19 Thread Michael S. Tsirkin
On Wed, Mar 20, 2024 at 09:56:58AM +1000, Gavin Shan wrote: > On 3/20/24 04:22, Will Deacon wrote: > > On Tue, Mar 19, 2024 at 02:59:23PM +1000, Gavin Shan wrote: > > > On 3/19/24 02:59, Will Deacon wrote: > > > > >drivers/virtio/virtio_ring.c | 12 +--- > > > > >1 file changed, 9

Re: [GIT PULL] virtio: features, fixes

2024-03-19 Thread Michael S. Tsirkin
On Tue, Mar 19, 2024 at 11:03:44AM -0700, Linus Torvalds wrote: > On Tue, 19 Mar 2024 at 00:41, Michael S. Tsirkin wrote: > > > > virtio: features, fixes > > > > Per vq sizes in vdpa. > > Info query for block devices support in vdpa. > > DMA sync call

Re: [syzbot] [virtualization?] upstream boot error: WARNING: refcount bug in __free_pages_ok

2024-03-19 Thread Michael S. Tsirkin
On Tue, Mar 19, 2024 at 01:19:23PM -0400, Stefan Hajnoczi wrote: > On Tue, Mar 19, 2024 at 03:40:53AM -0400, Michael S. Tsirkin wrote: > > On Tue, Mar 19, 2024 at 12:32:26AM -0700, syzbot wrote: > > > Hello, > > > > > > syzbot found the followin

Re: [PATCH v7 0/3] vduse: add support for networking devices

2024-03-19 Thread Michael S. Tsirkin
On Thu, Feb 29, 2024 at 11:16:04AM +0100, Maxime Coquelin wrote: > Hello Michael, > > On 2/1/24 09:40, Michael S. Tsirkin wrote: > > On Thu, Feb 01, 2024 at 09:34:11AM +0100, Maxime Coquelin wrote: > > > Hi Jason, > > > > > > It looks like all patches go

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-19 Thread Michael S. Tsirkin
On Tue, Mar 19, 2024 at 06:08:27PM +1000, Gavin Shan wrote: > On 3/19/24 17:09, Michael S. Tsirkin wrote: > > On Tue, Mar 19, 2024 at 04:49:50PM +1000, Gavin Shan wrote: > > > > > > On 3/19/24 16:43, Michael S. Tsirkin wrote: > > > > On Tue, Mar 19, 202

Re: EEVDF/vhost regression (bisected to 86bfbb7ce4f6 sched/fair: Add lag based placement)

2024-03-19 Thread Michael S. Tsirkin
On Tue, Mar 19, 2024 at 09:21:06AM +0100, Tobias Huschle wrote: > On 2024-03-15 11:31, Michael S. Tsirkin wrote: > > On Fri, Mar 15, 2024 at 09:33:49AM +0100, Tobias Huschle wrote: > > > On Thu, Mar 14, 2024 at 11:09:25AM -0400, Michael S. Tsirkin wrote: > > > > &g

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-19 Thread Michael S. Tsirkin
On Tue, Mar 19, 2024 at 04:54:15PM +1000, Gavin Shan wrote: > On 3/19/24 16:10, Michael S. Tsirkin wrote: > > On Tue, Mar 19, 2024 at 02:09:34AM -0400, Michael S. Tsirkin wrote: > > > On Tue, Mar 19, 2024 at 02:59:23PM +1000, Gavin Shan wrote: > > > > On 3/

[GIT PULL] virtio: features, fixes

2024-03-19 Thread Michael S. Tsirkin
, cleanups. Signed-off-by: Michael S. Tsirkin Andrew Melnychenko (1): vhost: Added pad cleanup if vnet_hdr is not present. David Hildenbrand (1): virtio: reenable config if freezing device failed Jason Wang (2

Re: [syzbot] [virtualization?] upstream boot error: WARNING: refcount bug in __free_pages_ok

2024-03-19 Thread Michael S. Tsirkin
On Tue, Mar 19, 2024 at 12:32:26AM -0700, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit:b3603fcb79b1 Merge tag 'dlm-6.9' of git://git.kernel.org/p.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=10f04c8118 >

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-19 Thread Michael S. Tsirkin
On Mon, Mar 18, 2024 at 04:59:24PM +, Will Deacon wrote: > On Thu, Mar 14, 2024 at 05:49:23PM +1000, Gavin Shan wrote: > > The issue is reported by Yihuang Yu who have 'netperf' test on > > NVidia's grace-grace and grace-hopper machines. The 'netperf' > > client is started in the VM hosted by

Re: [PATCH v3] vduse: Fix off by one in vduse_dev_mmap()

2024-03-19 Thread Michael S. Tsirkin
On Wed, Feb 28, 2024 at 09:24:07PM +0300, Dan Carpenter wrote: > The dev->vqs[] array has "dev->vq_num" elements. It's allocated in > vduse_dev_init_vqs(). Thus, this > comparison needs to be >= to avoid > reading one element beyond the end of the array. > > Add an array_index_nospec() as well

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-19 Thread Michael S. Tsirkin
On Tue, Mar 19, 2024 at 04:49:50PM +1000, Gavin Shan wrote: > > On 3/19/24 16:43, Michael S. Tsirkin wrote: > > On Tue, Mar 19, 2024 at 04:38:49PM +1000, Gavin Shan wrote: > > > On 3/19/24 16:09, Michael S. Tsirkin wrote: > > > > > > > >

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-19 Thread Michael S. Tsirkin
On Tue, Mar 19, 2024 at 04:54:15PM +1000, Gavin Shan wrote: > On 3/19/24 16:10, Michael S. Tsirkin wrote: > > On Tue, Mar 19, 2024 at 02:09:34AM -0400, Michael S. Tsirkin wrote: > > > On Tue, Mar 19, 2024 at 02:59:23PM +1000, Gavin Shan wrote: > > > > On 3/

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-19 Thread Michael S. Tsirkin
On Tue, Mar 19, 2024 at 04:38:49PM +1000, Gavin Shan wrote: > On 3/19/24 16:09, Michael S. Tsirkin wrote: > > > > > > diff --git a/drivers/virtio/virtio_ring.c > > > > > b/drivers/virtio/virtio_ring.c > > > > > index 49299b1f9ec7..7d852811c912

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-19 Thread Michael S. Tsirkin
On Thu, Mar 14, 2024 at 05:49:23PM +1000, Gavin Shan wrote: > The issue is reported by Yihuang Yu who have 'netperf' test on > NVidia's grace-grace and grace-hopper machines. The 'netperf' > client is started in the VM hosted by grace-hopper machine, > while the 'netperf' server is running on

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-19 Thread Michael S. Tsirkin
On Tue, Mar 19, 2024 at 02:09:34AM -0400, Michael S. Tsirkin wrote: > On Tue, Mar 19, 2024 at 02:59:23PM +1000, Gavin Shan wrote: > > On 3/19/24 02:59, Will Deacon wrote: > > > On Thu, Mar 14, 2024 at 05:49:23PM +1000, Gavin Shan wrote: > > > > The issue is reported b

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-19 Thread Michael S. Tsirkin
On Tue, Mar 19, 2024 at 02:59:23PM +1000, Gavin Shan wrote: > On 3/19/24 02:59, Will Deacon wrote: > > On Thu, Mar 14, 2024 at 05:49:23PM +1000, Gavin Shan wrote: > > > The issue is reported by Yihuang Yu who have 'netperf' test on > > > NVidia's grace-grace and grace-hopper machines. The

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-18 Thread Michael S. Tsirkin
On Mon, Mar 18, 2024 at 09:41:45AM +1000, Gavin Shan wrote: > On 3/18/24 02:50, Michael S. Tsirkin wrote: > > On Fri, Mar 15, 2024 at 09:24:36PM +1000, Gavin Shan wrote: > > > > > > On 3/15/24 21:05, Michael S. Tsirkin wrote: > > > > On Fri, Mar 15, 202

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-17 Thread Michael S. Tsirkin
On Fri, Mar 15, 2024 at 09:24:36PM +1000, Gavin Shan wrote: > > On 3/15/24 21:05, Michael S. Tsirkin wrote: > > On Fri, Mar 15, 2024 at 08:45:10PM +1000, Gavin Shan wrote: > > > > > Yes, I guess smp_wmb() ('dmb') is buggy on NVidia's grace-hopper > > > >

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-15 Thread Michael S. Tsirkin
On Fri, Mar 15, 2024 at 08:45:10PM +1000, Gavin Shan wrote: > > + Will, Catalin and Matt from Nvidia > > On 3/14/24 22:59, Michael S. Tsirkin wrote: > > On Thu, Mar 14, 2024 at 10:50:15PM +1000, Gavin Shan wrote: > > > On 3/14/24 21:50, Michael S. Tsirkin wrote: &

Re: EEVDF/vhost regression (bisected to 86bfbb7ce4f6 sched/fair: Add lag based placement)

2024-03-15 Thread Michael S. Tsirkin
On Fri, Mar 15, 2024 at 09:33:49AM +0100, Tobias Huschle wrote: > On Thu, Mar 14, 2024 at 11:09:25AM -0400, Michael S. Tsirkin wrote: > > > > Thanks a lot! To clarify it is not that I am opposed to changing vhost. > > I would like however for some documentation to exist sayi

Re: EEVDF/vhost regression (bisected to 86bfbb7ce4f6 sched/fair: Add lag based placement)

2024-03-14 Thread Michael S. Tsirkin
On Thu, Mar 14, 2024 at 12:46:54PM +0100, Tobias Huschle wrote: > On Tue, Mar 12, 2024 at 09:45:57AM +, Luis Machado wrote: > > On 3/11/24 17:05, Michael S. Tsirkin wrote: > > > > > > Are we going anywhere with this btw? > > > > > > > > &g

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-14 Thread Michael S. Tsirkin
On Thu, Mar 14, 2024 at 10:50:15PM +1000, Gavin Shan wrote: > On 3/14/24 21:50, Michael S. Tsirkin wrote: > > On Thu, Mar 14, 2024 at 08:15:22PM +1000, Gavin Shan wrote: > > > On 3/14/24 18:05, Michael S. Tsirkin wrote: > > > > On Thu, Mar 14, 2024 at 05:4

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-14 Thread Michael S. Tsirkin
On Thu, Mar 14, 2024 at 08:15:22PM +1000, Gavin Shan wrote: > On 3/14/24 18:05, Michael S. Tsirkin wrote: > > On Thu, Mar 14, 2024 at 05:49:23PM +1000, Gavin Shan wrote: > > > The issue is reported by Yihuang Yu who have 'netperf' test on > > > NVidia's grace-grac

Re: [PATCH] virtio_ring: Fix the stale index in available ring

2024-03-14 Thread Michael S. Tsirkin
On Thu, Mar 14, 2024 at 05:49:23PM +1000, Gavin Shan wrote: > The issue is reported by Yihuang Yu who have 'netperf' test on > NVidia's grace-grace and grace-hopper machines. The 'netperf' > client is started in the VM hosted by grace-hopper machine, > while the 'netperf' server is running on

Re: Re: Re: EEVDF/vhost regression (bisected to 86bfbb7ce4f6 sched/fair: Add lag based placement)

2024-03-11 Thread Michael S. Tsirkin
On Thu, Feb 01, 2024 at 12:47:39PM +0100, Tobias Huschle wrote: > On Thu, Feb 01, 2024 at 03:08:07AM -0500, Michael S. Tsirkin wrote: > > On Thu, Feb 01, 2024 at 08:38:43AM +0100, Tobias Huschle wrote: > > > On Sun, Jan 21, 2024 at 01:44:32PM -0500, Michael S. Tsirkin wrote: >

Re: [PATCH net-next v2 3/3] tun: AF_XDP Tx zero-copy support

2024-03-01 Thread Michael S. Tsirkin
On Fri, Mar 01, 2024 at 11:45:52AM +, wangyunjian wrote: > > -Original Message- > > From: Paolo Abeni [mailto:pab...@redhat.com] > > Sent: Thursday, February 29, 2024 7:13 PM > > To: wangyunjian ; m...@redhat.com; > > willemdebruijn.ker...@gmail.com; jasow...@redhat.com;

Re: [PATCH net-next v2 0/3] tun: AF_XDP Tx zero-copy support

2024-02-28 Thread Michael S. Tsirkin
gt; tun: AF_XDP Tx zero-copy support threading broken pls repost. vhost bits look ok though: Acked-by: Michael S. Tsirkin > drivers/net/tun.c | 177 ++-- > drivers/vhost/net.c | 21 +++-- > include/linux/if_tun.h | 32 ++

Re: [PATCH] vduse: Fix off by one in vduse_dev_mmap()

2024-02-27 Thread Michael S. Tsirkin
On Tue, Feb 27, 2024 at 06:21:46PM +0300, Dan Carpenter wrote: > The dev->vqs[] array has "dev->vq_num" elements. It's allocated in > vduse_dev_init_vqs(). Thus, this > comparison needs to be >= to avoid > reading one element beyond the end of the array. > > Fixes: 316ecd1346b0 ("vduse: Add

Re: [PATCH] virtiofs: limit the length of ITER_KVEC dio by max_nopage_rw

2024-02-25 Thread Michael S. Tsirkin
On Fri, Feb 23, 2024 at 10:42:37AM +0100, Miklos Szeredi wrote: > On Wed, 3 Jan 2024 at 11:58, Hou Tao wrote: > > > > From: Hou Tao > > > > When trying to insert a 10MB kernel module kept in a virtiofs with cache > > disabled, the following warning was reported: > > > > [ cut here

Re: [PATCH -next] VDUSE: fix another doc underline warning

2024-02-23 Thread Michael S. Tsirkin
DUSE devices reconnectoin works > > > Fixes: 2b3fd606c662 ("Documentation: Add reconnect process for VDUSE") > Signed-off-by: Randy Dunlap > Cc: Cindy Lu > Cc: Michael S. Tsirkin > Cc: Jason Wang > Cc: Xuan Zhuo > Cc: virtualizat...@lists.lin

Re: [PATCH] vduse: implement DMA sync callbacks

2024-02-22 Thread Michael S. Tsirkin
On Tue, Feb 20, 2024 at 01:01:36AM -0800, Christoph Hellwig wrote: > On Mon, Feb 19, 2024 at 06:06:06PM +0100, Maxime Coquelin wrote: > > Since commit 295525e29a5b ("virtio_net: merge dma > > operations when filling mergeable buffers"), VDUSE device > > require support for DMA's

  1   2   3   4   5   6   7   8   9   10   >