[PATCH vhost v7 1/6] virtio_balloon: remove the dependence where names[] is null

2024-03-28 Thread Xuan Zhuo
Currently, the init_vqs function within the virtio_balloon driver relies on the condition that certain names array entries are null in order to skip the initialization of some virtual queues (vqs). This behavior is unique to this part of the codebase. In an upcoming commit, we plan to eliminate thi

[PATCH vhost v7 0/6] refactor the params of find_vqs()

2024-03-28 Thread Xuan Zhuo
This pathset is splited from the http://lore.kernel.org/all/20240229072044.77388-1-xuanz...@linux.alibaba.com That may needs some cycles to discuss. But that notifies too many people. But just the four commits need to notify so many people. And four commits are independent. So I split that

[PATCH vhost v7 5/6] virtio: vring_new_virtqueue(): pass struct instead of multi parameters

2024-03-28 Thread Xuan Zhuo
Now, we pass multi parameters to vring_new_virtqueue. These parameters may from transport or from driver. vring_new_virtqueue is called by many places. Every time, we try to add a new parameter, that is difficult. If parameters from the driver, that should directly be passed to vring. Then the vr

[PATCH vhost v7 2/6] virtio: remove support for names array entries being null.

2024-03-28 Thread Xuan Zhuo
commit 6457f126c888 ("virtio: support reserved vqs") introduced this support. Multiqueue virtio-net use 2N as ctrl vq finally, so the logic doesn't apply. And not one uses this. On the other side, that makes some trouble for us to refactor the find_vqs() params. So I remove this support. Signed-

[PATCH vhost v7 4/6] virtio: vring_create_virtqueue: pass struct instead of multi parameters

2024-03-28 Thread Xuan Zhuo
Now, we pass multi parameters to vring_create_virtqueue. These parameters may from transport or from driver. vring_create_virtqueue is called by many places. Every time, we try to add a new parameter, that is difficult. If parameters from the driver, that should directly be passed to vring. Then

[PATCH vhost v7 3/6] virtio: find_vqs: pass struct instead of multi parameters

2024-03-28 Thread Xuan Zhuo
Now, we pass multi parameters to find_vqs. These parameters may work for transport or work for vring. And find_vqs has multi implements in many places: arch/um/drivers/virtio_uml.c drivers/platform/mellanox/mlxbf-tmfifo.c drivers/remoteproc/remoteproc_virtio.c drivers/s390/virtio/virtio_ccw.c

[PATCH vhost v7 6/6] virtio_ring: simplify the parameters of the funcs related to vring_create/new_virtqueue()

2024-03-28 Thread Xuan Zhuo
As the refactor of find_vqs()/vring_new_virtqueue()/vring_create_virtqueue the struct cfg/tp_cfg are passed to vring. This patch refactors the vring by these structures. This can simplify the code. Signed-off-by: Xuan Zhuo Reviewed-by: Ilpo Järvinen Acked-by: Jason Wang --- drivers/virtio/vir

Re: [PATCH vhost v7 5/6] virtio: vring_new_virtqueue(): pass struct instead of multi parameters

2024-03-28 Thread Jason Wang
On Thu, Mar 28, 2024 at 4:04 PM Xuan Zhuo wrote: > > Now, we pass multi parameters to vring_new_virtqueue. These parameters > may from transport or from driver. > > vring_new_virtqueue is called by many places. > Every time, we try to add a new parameter, that is difficult. > > If parameters from

Re: [PATCH] um: Add winch to winch_handlers before registering winch IRQ

2024-03-28 Thread Roberto Sassu
On 3/7/2024 1:43 PM, Roberto Sassu wrote: On Thu, 2024-03-07 at 11:49 +0100, Roberto Sassu wrote: From: Roberto Sassu Registering a winch IRQ is racy, an interrupt may occur before the winch is added to the winch_handlers list. If that happens, register_winch_irq() adds to that list a winch t

Re: [PATCH] um: Add winch to winch_handlers before registering winch IRQ

2024-03-28 Thread Johannes Berg
On Thu, 2024-03-07 at 11:49 +0100, Roberto Sassu wrote: > From: Roberto Sassu > > Registering a winch IRQ is racy, an interrupt may occur before the winch is > added to the winch_handlers list. > > If that happens, register_winch_irq() adds to that list a winch that is > scheduled to be (or has

Re: [PATCH] um: Fix return value in ubd_init()

2024-03-28 Thread Johannes Berg
On Wed, 2024-03-06 at 17:12 +0800, Duoming Zhou wrote: > When kmalloc_array() fails to allocate memory, the ubd_init() > should return -ENOMEM instead of -1. So, fix it. Not sure this really matters, but the code seems cleaner with it :) Reviewed-by: Johannes Berg johannes

Re: [PATCH v3 0/9] um: Minor fixes and cleanups

2024-03-28 Thread Johannes Berg
On Wed, 2024-03-06 at 18:19 +0800, Tiwei Bie wrote: > A series of minor fixes and cleanups for UML. > > Most changes in this series are very straightforward. Please consider > picking this series for v6.9. > > There are still some remaining -Wmissing-prototypes warnings. I plan to > send a follow

Re: [PATCH 1/1] arch/um: fix forward declaration for vmalloc

2024-03-28 Thread Johannes Berg
On Tue, 2024-03-26 at 00:37 -0700, Suren Baghdasaryan wrote: > > -extern void *vmalloc(unsigned long size); > +extern void *vmalloc_noprof(unsigned long size); > +#define vmalloc(...) vmalloc_noprof(__VA_ARGS__) > I was confused a bit by the define at first, but that's because this is a

[PATCH 1/5] um: signal: move pid variable where needed

2024-03-28 Thread Johannes Berg
From: Johannes Berg We have W=1 warnings on 64-bit because the pid is only used in branches on 32-bit; move it inside to get rid of the warnings. Signed-off-by: Johannes Berg --- arch/x86/um/signal.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/x86/um/signa

[PATCH 3/5] um: vector: fix bpfflash parameter evaluation

2024-03-28 Thread Johannes Berg
From: Johannes Berg With W=1 the build complains about a pointer compared to zero, clearly the result should've been compared. Fixes: 9807019a62dc ("um: Loadable BPF "Firmware" for vector drivers") Signed-off-by: Johannes Berg --- arch/um/drivers/vector_kern.c | 2 +- 1 file changed, 1 inserti

[PATCH 4/5] um: vector: remove unused len variable/calculation

2024-03-28 Thread Johannes Berg
From: Johannes Berg The len variable is unused, so not needed, remove it. Signed-off-by: Johannes Berg --- arch/um/drivers/vector_kern.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 63e5f108a6b9..4279

[PATCH 2/5] um: slirp: remove set but unused variable 'pid'

2024-03-28 Thread Johannes Berg
From: Johannes Berg The code doesn't use 'pid' here, just remove it. Signed-off-by: Johannes Berg --- arch/um/drivers/slirp_user.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/um/drivers/slirp_user.c b/arch/um/drivers/slirp_user.c index 8f633e2e5f3d..97228aa080cb

[PATCH 5/5] um: process: remove unused 'n' variable

2024-03-28 Thread Johannes Berg
From: Johannes Berg The return value of fn() wasn't used for a long time, so no need to assign it to a variable, addressing a W=1 warning. This seems to be - with patches from others posted to the list before - the last W=1 warning in arch/um/. Fixes: 22e2430d60db ("x86, um: convert to saner ke

Re: [PATCH v2] um: Makefile: use bash from the environment

2024-03-28 Thread Johannes Berg
On Sat, 2024-03-23 at 17:44 +, Yueh-Shun Li wrote: > Set Makefile SHELL to bash instead of /bin/bash for better portability. > > Some systems do not install binaries to /bin, and therefore do not > provide /bin/bash. This includes Linux distros which intentionally avoid > implementing the File

Re: [PATCH v7] um: Enable preemption in UML

2024-03-28 Thread Johannes Berg
> @@ -23,7 +23,7 @@ struct thread_info { > int preempt_count; /* 0 => preemptable, > <0 => BUG */ > struct thread_info *real_thread;/* Points to non-IRQ stack */ > - unsigned long aux_fp_regs[FP_SIZE];

Re: [PATCH] um: Remove obsolete pcap driver

2024-03-28 Thread Johannes Berg
On Thu, 2024-03-28 at 13:24 +, anton.iva...@cambridgegreys.com wrote: > From: Anton Ivanov > > Remove the pcap driver in UML. It is obsolete. It does not build on > recent systems due to changes in libpcap and its dependencies. > > The vector driver's raw transport in UML provides identical

[PATCH] um: Remove obsolete pcap driver

2024-03-28 Thread anton . ivanov
From: Anton Ivanov Remove the pcap driver in UML. It is obsolete. It does not build on recent systems due to changes in libpcap and its dependencies. The vector driver's raw transport in UML provides identical functionality. Signed-off-by: Anton Ivanov --- arch/um/drivers/Kconfig | 20 --

Re: [PATCH v7] um: Enable preemption in UML

2024-03-28 Thread Anton Ivanov
On 28/03/2024 09:27, Johannes Berg wrote: @@ -23,7 +23,7 @@ struct thread_info { int preempt_count; /* 0 => preemptable, <0 => BUG */ struct thread_info *real_thread;/* Points to non-IRQ stack */

Re: [PATCH 19/22] rpmsg: virtio: drop owner assignment

2024-03-28 Thread Mathieu Poirier
On Wed, Mar 27, 2024 at 01:41:12PM +0100, Krzysztof Kozlowski wrote: > virtio core already sets the .owner, so driver does not need to. > > Signed-off-by: Krzysztof Kozlowski > > --- > > Depends on the first patch. > --- > drivers/rpmsg/virtio_rpmsg_bus.c | 1 - > 1 file changed, 1 deletion(-)

[PATCH v8] um: Enable preemption in UML

2024-03-28 Thread anton . ivanov
From: Anton Ivanov 1. Preemption requires saving/restoring FPU state. This patch adds support for it using GCC intrinsics as well as appropriate storage space in the thread structure. We reuse the space which is already allocated for the userspace threads in the thread_info structure. 2. irq cri

Re: [PATCH 1/5] um: signal: move pid variable where needed

2024-03-28 Thread Tiwei Bie
On 3/28/24 5:06 PM, Johannes Berg wrote: > From: Johannes Berg > > We have W=1 warnings on 64-bit because the pid is only > used in branches on 32-bit; move it inside to get rid of > the warnings. > > Signed-off-by: Johannes Berg > --- > arch/x86/um/signal.c | 9 - > 1 file changed, 4