[PATCH v3 00/20] ppc4xx_sdram QOMify and clean ups

2022-09-13 Thread BALATON Zoltan
This is the end of the QOMify series started by Cédric. This series handles the SDRAM controller models to clean them up, QOMify and unify them and at least partially clean up the mess that has accumulated around these in the past. This includes the not yet merged patches from the last series and

[PATCH v3 14/20] ppc440_sdram: Move RAM size check to ppc440_sdram_init

2022-09-13 Thread BALATON Zoltan
Move the check for valid memory sizes from board to sdram controller init. Board now only checks for additional restrictions imposed by firmware then sdram init checks for valid sizes for SoC. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440.h| 4 ++-- hw/ppc/ppc440_uc.c | 15

[PATCH v4 2/2] x86: re-enable rng seeding via setup_data

2022-09-13 Thread Jason A. Donenfeld
This reverts 3824e25db1 ("x86: disable rng seeding via setup_data"), but for 7.2 rather than 7.1, now that modifying setup_data is safe to do. Cc: Laurent Vivier Cc: Michael S. Tsirkin Cc: Paolo Bonzini Cc: Peter Maydell Cc: Philippe Mathieu-Daudé Cc: Richard Henderson Cc: Ard Biesheuvel

[PATCH v4 1/2] x86: return modified setup_data only if read as memory, not as file

2022-09-13 Thread Jason A. Donenfeld
If setup_data is being read into a specific memory location, then generally the setup_data address parameter is read first, so that the caller knows where to read it into. In that case, we should return setup_data containing the absolute addresses that are hard coded and determined a priori. This

Re: [PATCH 2/3] vdpa: load vlan configuration at NIC startup

2022-09-13 Thread Jason Wang
On Fri, Sep 9, 2022 at 4:38 PM Michael S. Tsirkin wrote: > > On Fri, Sep 09, 2022 at 10:01:16AM +0200, Eugenio Perez Martin wrote: > > On Fri, Sep 9, 2022 at 8:40 AM Jason Wang wrote: > > > > > > On Fri, Sep 9, 2022 at 2:38 PM Jason Wang wrote: > > > > > > > > On Wed, Sep 7, 2022 at 12:36 AM

Re: [PATCH v2 6/6] vhost: vhost-user: enable vq reset feature

2022-09-13 Thread Jason Wang
在 2022/9/12 11:10, Kangjie Xu 写道: Add virtqueue reset feature for vhost-user. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index

[PULL 01/12] linux-user: Add missing signals in strace output

2022-09-13 Thread Helge Deller
Some of the guest signal numbers are currently not converted to their representative names in the strace output, e.g. SIGVTALRM. This patch introduces a smart way to generate and keep in sync the host-to-guest and guest-to-host signal conversion tables for usage in the qemu signal and strace

[PULL 08/12] linux-user/hppa: Set TASK_UNMAPPED_BASE to 0xfa000000 for hppa arch

2022-09-13 Thread Helge Deller
On the parisc architecture the stack grows upwards. Move the TASK_UNMAPPED_BASE to high memory area as it's done by the kernel on physical machines. Signed-off-by: Helge Deller --- linux-user/mmap.c | 4 1 file changed, 4 insertions(+) diff --git a/linux-user/mmap.c b/linux-user/mmap.c

[PATCH v3 15/20] ppc440_sdram: QOM'ify

2022-09-13 Thread BALATON Zoltan
Change the ppc440_sdram model to a QOM class derived from the PPC4xx-dcr-device and name it ppc4xx-sdram-ddr2. This is mostly modelling the DDR2 SDRAM controller found in the 460EX (used on the sam460ex board). Newer SoCs (regardless of their PPC core, e.g. 405EX) may have this controller but we

[PATCH v3 18/20] ppc4xx_sdram: Rename local state variable for brevity

2022-09-13 Thread BALATON Zoltan
Rename the sdram local state variable to s in dcr read/write functions and reset methods for better readability and to match realize methods. Other places not converted will be changed or removed in subsequent patches. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc4xx_sdram.c | 158

[PATCH v3 09/20] ppc440_sdram: Split off map/unmap of sdram banks for later reuse

2022-09-13 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 31 +++ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index 5db59d1190..01184e717b 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -561,26

[PATCH v3 13/20] ppc4xx_sdram: Rename functions to prevent name clashes

2022-09-13 Thread BALATON Zoltan
Rename functions to avoid name clashes when moving the DDR2 controller model currently called ppc440_sdram to ppc4xx_devs. This also more clearly shows which function belongs to which model. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 69 ++--

Re: [PATCH v4 13/15] virtio-net: support queue reset

2022-09-13 Thread Jason Wang
在 2022/9/12 01:22, Kangjie Xu 写道: From: Xuan Zhuo virtio-net and vhost-kernel implement queue reset. Queued packets in the corresponding queue pair are flushed or purged. For virtio-net, userspace datapath will be disabled later in __virtio_queue_reset(). It will set addr of vring to 0 and

Re: [PATCH v4 11/15] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_restart()

2022-09-13 Thread Jason Wang
在 2022/9/12 01:22, Kangjie Xu 写道: Introduce vhost_net_virtqueue_restart(), which can restart the specific virtqueue when the vhost net started running before. If it fails to restart the virtqueue, the device will be stopped. Here we do not reuse vhost_net_start_one() or vhost_dev_start()

[PATCH v3 19/20] ppc4xx_sdram: Generalise bank setup

2022-09-13 Thread BALATON Zoltan
Currently only base and size are set on initial bank creation and bcr value is computed on mapping the region. Set bcr at init so the bcr encoding method becomes local to the controller model and mapping and unmapping can operate on the bank so it can be shared between different controller models.

[PULL 03/12] linux-user: Add pidfd_open(), pidfd_send_signal() and pidfd_getfd() syscalls

2022-09-13 Thread Helge Deller
I noticed those were missing when running the glib2.0 testsuite. Add the syscalls including the strace output. Signed-off-by: Helge Deller --- linux-user/strace.c| 28 linux-user/strace.list | 9 + linux-user/syscall.c | 34

[PULL 11/12] linux-user: Add close_range() syscall

2022-09-13 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.list | 3 +++ linux-user/syscall.c | 12 2 files changed, 15 insertions(+) diff --git a/linux-user/strace.list b/linux-user/strace.list index 215d971b2a..ad9ef94689 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list

[PATCH v3 04/20] ppc4xx: Use Ppc4xxSdramBank in ppc4xx_sdram_banks()

2022-09-13 Thread BALATON Zoltan
Change ppc4xx_sdram_banks() to take one Ppc4xxSdramBank array instead of the separate arrays and adjust ppc4xx_sdram_init() and ppc440_sdram_init() accordingly as well as machines using these. Signed-off-by: BALATON Zoltan --- v2: Use pointer for ram_banks in the prototype of the init funcs as

[PATCH v3 17/20] ppc4xx_sdram: Use hwaddr for memory bank size

2022-09-13 Thread BALATON Zoltan
This resolves the target_ulong dependency that's clearly wrong and was also noted in a fixme comment. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/ppc4xx_sdram.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git

Re: [PATCH 2/3] vdpa: load vlan configuration at NIC startup

2022-09-13 Thread Jason Wang
On Fri, Sep 9, 2022 at 4:02 PM Eugenio Perez Martin wrote: > > On Fri, Sep 9, 2022 at 8:40 AM Jason Wang wrote: > > > > On Fri, Sep 9, 2022 at 2:38 PM Jason Wang wrote: > > > > > > On Wed, Sep 7, 2022 at 12:36 AM Eugenio Pérez wrote: > > > > > > > > To have enabled vlans at device startup may

Re: [PATCH v4 14/15] virtio-net: support queue_enable

2022-09-13 Thread Jason Wang
在 2022/9/12 01:22, Kangjie Xu 写道: Support queue_enable in vhost-kernel scenario. It can be called when a vq reset operation has been performed and the vq is restared. It should be noted that we can restart the vq when the vhost has already started. When launching a new vhost device, the vhost

Re: [PATCH v2 3/6] vhost-net: vhost-user: update vhost_net_virtqueue_reset()

2022-09-13 Thread Jason Wang
在 2022/9/12 11:10, Kangjie Xu 写道: Update vhost_net_virtqueue_reset() for vhost-user scenario. In order to reuse some functions, we process the idx for vhost-user scenario because vhost_get_vq_index behave differently for vhost-user. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo ---

[PATCH v3 10/20] ppc440_sdram: Implement enable bit in the DDR2 SDRAM

2022-09-13 Thread BALATON Zoltan
To allow removing the do_init hack we need to improve the DDR2 SDRAM controller model to handle the enable/disable bit that it ignored so far. Signed-off-by: BALATON Zoltan --- v2: replace 0x0800 with BIT(27) hw/ppc/ppc440_uc.c | 34 -- 1 file changed, 32

[PATCH v3 05/20] ppc440_bamboo: Add missing 4 MiB valid memory size

2022-09-13 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan Reviewed-by: Cédric Le Goater --- hw/ppc/ppc440_bamboo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index 2aac8a3fe9..2bd5e41140 100644 --- a/hw/ppc/ppc440_bamboo.c +++

Re: [PATCH v4 10/15] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_reset()

2022-09-13 Thread Jason Wang
On Mon, Sep 12, 2022 at 1:22 AM Kangjie Xu wrote: > > Introduce vhost_virtqueue_reset(), which can reset the specific > virtqueue in the device. Then it will unmap vrings and the desc > of the virtqueue. > > Here we do not reuse the vhost_net_stop_one() or vhost_dev_stop(), > because they work at

[PATCH v3 06/20] ppc4xx_sdram: Move size check to ppc4xx_sdram_init()

2022-09-13 Thread BALATON Zoltan
Instead of checking if memory size is valid in board code move this check to ppc4xx_sdram_init() as this is a restriction imposed by the SDRAM controller. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc405.h | 2 -- hw/ppc/ppc405_boards.c | 10 -- hw/ppc/ppc405_uc.c | 11

[PATCH v3 11/20] ppc440_sdram: Get rid of the init RAM hack

2022-09-13 Thread BALATON Zoltan
Remove the do_init parameter of ppc440_sdram_init and enable SDRAM controller from the board via DCR access instead. Firmware does this so it may not be needed when booting firmware only with -kernel but we enable it unconditionally to preserve previous behaviour. Signed-off-by: BALATON Zoltan

[PATCH v3 12/20] ppc440_sdram: Rename local variable for readibility

2022-09-13 Thread BALATON Zoltan
Rename local sdram variable in ppc440_sdram_init to s for readibility. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_uc.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index

[PATCH v3 08/20] ppc4xx_sdram: Drop extra zeros for readability

2022-09-13 Thread BALATON Zoltan
Constants that are written zero padded for no good reason are hard to read, it's easier to see what is meant if it's just 0 or 1 instead. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc4xx_devs.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff

[PATCH v3 20/20] ppc4xx_sdram: Convert DDR SDRAM controller to new bank handling

2022-09-13 Thread BALATON Zoltan
Use the generic bank handling introduced in previous patch in the DDR SDRAM controller too. This also fixes previously broken region unmap due to sdram_ddr_unmap_bcr() ignoring container region so it crashed with an assert when the guest tried to disable the controller. Signed-off-by: BALATON

[PULL 04/12] linux-user: Log failing executable in EXCP_DUMP()

2022-09-13 Thread Helge Deller
Enhance the EXCP_DUMP() macro to print out the failing program too. During debugging it's sometimes hard to track down the actual failing program if you are e.g. building a whole debian package. Signed-off-by: Helge Deller --- linux-user/cpu_loop-common.h | 2 ++ 1 file changed, 2 insertions(+)

[PATCH v3 07/20] ppc4xx_sdram: QOM'ify

2022-09-13 Thread BALATON Zoltan
Change the ppc4xx_sdram model to a QOM class derived from the PPC4xx-dcr-device and name it ppc4xx-sdram-ddr. This is mostly modelling the DDR SDRAM controller found in the 440EP (used on the bamboo board) but also backward compatible with the older DDR controllers on some 405 SoCs so we also use

[PATCH v3 16/20] ppc4xx_sdram: Move ppc4xx DDR and DDR2 SDRAM controller models together

2022-09-13 Thread BALATON Zoltan
Move the PPC4xx DDR and DDR2 SDRAM contrller models into a new file called ppc4xx_sdram to separate from other device models and put them in one place allowing sharing some code between them. Signed-off-by: BALATON Zoltan --- hw/ppc/meson.build | 3 +- hw/ppc/ppc440_uc.c | 321

Re: [PATCH v2 5/6] virtio-net: vhost-user: update queue_reset and queue_enable

2022-09-13 Thread Jason Wang
在 2022/9/12 11:10, Kangjie Xu 写道: Update virtio_net_queue_reset() and virtio_net_queue_enable() for vhost-user scenario. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/net/virtio-net.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-)

[PATCH v3 02/20] ppc4xx: Introduce Ppc4xxSdramBank struct

2022-09-13 Thread BALATON Zoltan
Instead of storing sdram bank parameters in unrelated arrays put them in a struct so it's clear they belong to the same bank and simplify the state struct using this bank type. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé --- hw/ppc/ppc440_uc.c | 49

[PATCH v3 03/20] ppc4xx_sdram: Get rid of the init RAM hack

2022-09-13 Thread BALATON Zoltan
The do_init parameter of ppc4xx_sdram_init() is used to map memory regions that is normally done by the firmware by programming the SDRAM controller. This is needed when booting a kernel directly from -kernel without a firmware. Do this from board code accesing normal SDRAM controller registers

[PATCH v3 01/20] ppc440_bamboo: Remove unnecessary memsets

2022-09-13 Thread BALATON Zoltan
In ppc4xx_sdram_init() the struct is allocated with g_new0() so no need to clear its elements. In the bamboo machine init memset can be replaced with array initialiser which is shorter. Signed-off-by: BALATON Zoltan --- hw/ppc/ppc440_bamboo.c | 6 ++ hw/ppc/ppc4xx_devs.c | 8 ++-- 2

Re: [PATCH v2 1/6] net: virtio: rename vhost_set_vring_enable to vhost_set_dev_enable

2022-09-13 Thread Jason Wang
在 2022/9/12 11:10, Kangjie Xu 写道: Previously, vhost_set_vring_enable will enable/disable all vrings in a device, Nit: It would be more clear to say to disable all vrings for a specific vhost device. Since in the case of multiqueue virtio-net, a single virtio-net device may have multiple

Re: [PATCH v2 2/6] vhost-user: add op to enable or disable a single vring

2022-09-13 Thread Jason Wang
在 2022/9/12 11:10, Kangjie Xu 写道: There is only vhost_set_dev_enable op in VhostOps. Thus, we introduce the interface vhost_set_vring_enable to set the enable status for a single vring. Resetting a single vq will rely on this interface. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo

Re: [PATCH v8 03/14] net: simplify net_client_parse() error management

2022-09-13 Thread David Gibson
On Tue, Sep 13, 2022 at 08:39:49AM +0200, Laurent Vivier wrote: > All net_client_parse() callers exit in case of error. > > Move exit(1) to net_client_parse() and remove error checking from > the callers. > > Suggested-by: Markus Armbruster > Signed-off-by: Laurent Vivier > Reviewed-by: Markus

[PATCH v5 04/15] virtio: introduce virtio_queue_enable()

2022-09-13 Thread Xuan Zhuo
From: Kangjie Xu Introduce the interface queue_enable() in VirtioDeviceClass and the fucntion virtio_queue_enable() in virtio, it can be called when VIRTIO_PCI_COMMON_Q_ENABLE is written and related virtqueue can be started. It only supports the devices of virtio 1 or later. The not-supported

[PATCH v5 02/15] virtio: introduce __virtio_queue_reset()

2022-09-13 Thread Xuan Zhuo
Separate the logic of vq reset. This logic will be called directly later. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/virtio/virtio.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c

[PATCH v5 09/15] vhost: expose vhost_virtqueue_stop()

2022-09-13 Thread Xuan Zhuo
From: Kangjie Xu Expose vhost_virtqueue_stop(), we need to use it when resetting a virtqueue. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/virtio/vhost.c | 8 include/hw/virtio/vhost.h | 2 ++ 2 files changed, 6 insertions(+), 4

[PATCH v5 07/15] virtio-pci: support queue enable

2022-09-13 Thread Xuan Zhuo
From: Kangjie Xu PCI devices support device specific vq enable. Based on this function, the driver can re-enable the virtqueue after the virtqueue is reset. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/virtio/virtio-pci.c | 1 + 1 file changed, 1

Re: [PATCH] e1000e: set RX desc status with DD flag in a separate operation

2022-09-13 Thread Jason Wang
On Fri, Sep 9, 2022 at 7:20 PM dinghui wrote: > > On 2022/9/9 10:40, Jason Wang wrote: > > On Sat, Aug 27, 2022 at 12:06 AM Ding Hui wrote: > >> > >> Like commit 034d00d48581 ("e1000: set RX descriptor status in > >> a separate operation"), there is also same issue in e1000e, which > >> would

Re: [PATCH v8 01/14] net: introduce convert_host_port()

2022-09-13 Thread David Gibson
On Tue, Sep 13, 2022 at 08:39:47AM +0200, Laurent Vivier wrote: > Signed-off-by: Laurent Vivier > Reviewed-by: Stefano Brivio Reviewed-by: David Gibson Although, if you do respin, an actual commit message would be nice to have. > --- > include/qemu/sockets.h | 2 ++ > net/net.c

Re: [PATCH v8 07/14] net: stream: add unix socket

2022-09-13 Thread David Gibson
On Tue, Sep 13, 2022 at 08:39:53AM +0200, Laurent Vivier wrote: > Signed-off-by: Laurent Vivier > Reviewed-by: Stefano Brivio > --- > net/stream.c| 108 +--- > qapi/net.json | 2 +- > qemu-options.hx | 1 + > 3 files changed, 105

Re: [PATCH v8 05/14] qapi: net: add stream and dgram netdevs

2022-09-13 Thread David Gibson
On Tue, Sep 13, 2022 at 08:39:51AM +0200, Laurent Vivier wrote: > Copied from socket netdev file and modified to use SocketAddress > to be able to introduce new features like unix socket. > > "udp" and "mcast" are squashed into dgram netdev, multicast is detected > according to the IP address

Re: [PATCH v5 11/15] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_restart()

2022-09-13 Thread Jason Wang
On Wed, Sep 14, 2022 at 12:21 PM Xuan Zhuo wrote: > > From: Kangjie Xu > > Introduce vhost_net_virtqueue_restart(), which can restart the > specific virtqueue when the vhost net started running before. > If it fails to restart the virtqueue, the device will be stopped. > > Here we do not reuse

Re: [PATCH v8 06/14] net: stream: Don't ignore EINVAL on netdev socket connection

2022-09-13 Thread David Gibson
On Tue, Sep 13, 2022 at 08:39:52AM +0200, Laurent Vivier wrote: > From: Stefano Brivio > > Other errors are treated as failure by net_stream_client_init(), > but if connect() returns EINVAL, we'll fail silently. Remove the > related exception. Is this also a bug in net_socket_connect_init()?

[PATCH v5 03/15] virtio: introduce virtio_queue_reset()

2022-09-13 Thread Xuan Zhuo
Introduce a new interface function virtio_queue_reset() to implement reset for vq. Add a new callback to VirtioDeviceClass for queue reset operation for each child device. Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/virtio/virtio.c | 11 +++ include/hw/virtio/virtio.h

[PATCH v5 01/15] virtio: sync relevant definitions with linux

2022-09-13 Thread Xuan Zhuo
This is updated using scripts/update-linux-headers.sh. Added VIRTIO_F_RING_RESET, VIRTIO_PCI_COMMON_Q_RESET. It came from here: https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 Add VIRTIO_PCI_COMMON_Q_NDATA, which comes from here:

Re: [PATCH v8 02/14] net: remove the @errp argument of net_client_inits()

2022-09-13 Thread David Gibson
On Tue, Sep 13, 2022 at 08:39:48AM +0200, Laurent Vivier wrote: > The only caller passes _fatal, so use this directly in the function. > > It's what we do for -blockdev, -device, and -object. > > Suggested-by: Markus Armbruster > Signed-off-by: Laurent Vivier > Reviewed-by: Markus Armbruster

Re: [PATCH v8 11/14] qemu-sockets: move and rename SocketAddress_to_str()

2022-09-13 Thread David Gibson
On Tue, Sep 13, 2022 at 08:39:57AM +0200, Laurent Vivier wrote: > Rename SocketAddress_to_str() to socket_uri() and move it to > util/qemu-sockets.c close to socket_parse(). > > socket_uri() generates a string from a SocketAddress while > socket_parse() generates a SocketAddress from a string. >

[PATCH v5 10/15] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_reset()

2022-09-13 Thread Xuan Zhuo
From: Kangjie Xu Introduce vhost_virtqueue_reset(), which can reset the specific virtqueue in the device. Then it will unmap vrings and the desc of the virtqueue. Here we do not reuse the vhost_net_stop_one() or vhost_dev_stop(), because they work at queue pair level. We do not use

[PATCH v5 05/15] virtio: core: vq reset feature negotation support

2022-09-13 Thread Xuan Zhuo
From: Kangjie Xu A a new command line parameter "queue_reset" is added. Meanwhile, the vq reset feature is disabled for pre-7.2 machines. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/core/machine.c | 4 +++- include/hw/virtio/virtio.h | 4 +++- 2

[PATCH v5 08/15] vhost: expose vhost_virtqueue_start()

2022-09-13 Thread Xuan Zhuo
From: Kangjie Xu Expose vhost_virtqueue_start(), we need to use it when restarting a virtqueue. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/virtio/vhost.c | 8 include/hw/virtio/vhost.h | 3 +++ 2 files changed, 7 insertions(+), 4

[PATCH v5 12/15] virtio-net: introduce flush_or_purge_queued_packets()

2022-09-13 Thread Xuan Zhuo
From: Kangjie Xu Introduce the fucntion flush_or_purge_queued_packets(), it will be used in device reset and virtqueue reset. Therefore, we extract the common logic as a new function. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo Acked-by: Jason Wang --- hw/net/virtio-net.c | 17

[PATCH v5 15/15] vhost: vhost-kernel: enable vq reset feature

2022-09-13 Thread Xuan Zhuo
From: Kangjie Xu Add virtqueue reset feature for vhost-kernel. Signed-off-by: Kangjie Xu Signed-off-by: Xuan Zhuo --- hw/net/vhost_net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index d2926e2ed6..53b2fac4f6 100644 --- a/hw/net/vhost_net.c

[PATCH v5 14/15] virtio-net: support queue_enable

2022-09-13 Thread Xuan Zhuo
From: Kangjie Xu Support queue_enable in vhost-kernel scenario. It can be called when a vq reset operation has been performed and the vq is restared. It should be noted that we can restart the vq when the vhost has already started. When launching a new vhost device, the vhost is not started and

Re: [PATCH v5 15/15] vhost: vhost-kernel: enable vq reset feature

2022-09-13 Thread Jason Wang
On Wed, Sep 14, 2022 at 12:21 PM Xuan Zhuo wrote: > > From: Kangjie Xu > > Add virtqueue reset feature for vhost-kernel. > > Signed-off-by: Kangjie Xu > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang > --- > hw/net/vhost_net.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git

[PATCH v5 06/15] virtio-pci: support queue reset

2022-09-13 Thread Xuan Zhuo
PCI devices support vq reset. Based on this function, the driver can adjust the size of the ring, and quickly recycle the buffer in the ring. The migration of the virtio devices will not happen during a reset operation. This is becuase the global iothread lock is held. Migration thread also

[PATCH v5 00/15] Support VIRTIO_F_RING_RESET for virtio-net, vhost-net kernel in virtio pci-modern

2022-09-13 Thread Xuan Zhuo
The virtio queue reset function has already been defined in the virtio spec 1.2. The relevant virtio spec information is here: https://github.com/oasis-tcs/virtio-spec/issues/124 https://github.com/oasis-tcs/virtio-spec/issues/139 This patch set is to support this function in QEMU. It

[PATCH v5 11/15] vhost-net: vhost-kernel: introduce vhost_net_virtqueue_restart()

2022-09-13 Thread Xuan Zhuo
From: Kangjie Xu Introduce vhost_net_virtqueue_restart(), which can restart the specific virtqueue when the vhost net started running before. If it fails to restart the virtqueue, the device will be stopped. Here we do not reuse vhost_net_start_one() or vhost_dev_start() because they work at

[PATCH v5 13/15] virtio-net: support queue reset

2022-09-13 Thread Xuan Zhuo
virtio-net and vhost-kernel implement queue reset. Queued packets in the corresponding queue pair are flushed or purged. For virtio-net, userspace datapath will be disabled later in __virtio_queue_reset(). It will set addr of vring to 0 and idx to 0. Thus, virtio_net_receive() and

[PATCH v8 03/14] net: simplify net_client_parse() error management

2022-09-13 Thread Laurent Vivier
All net_client_parse() callers exit in case of error. Move exit(1) to net_client_parse() and remove error checking from the callers. Suggested-by: Markus Armbruster Signed-off-by: Laurent Vivier Reviewed-by: Markus Armbruster --- include/net/net.h | 2 +- net/net.c | 6 ++

[PATCH v8 10/14] net: dgram: add unix socket

2022-09-13 Thread Laurent Vivier
Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/dgram.c | 65 ++--- qapi/net.json | 2 +- qemu-options.hx | 1 + 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/net/dgram.c b/net/dgram.c index

[PATCH v8 13/14] net: stream: move to QIO

2022-09-13 Thread Laurent Vivier
Use QIOChannel, QIOChannelSocket and QIONetListener. Signed-off-by: Laurent Vivier --- net/stream.c| 482 +--- qemu-options.hx | 4 +- 2 files changed, 171 insertions(+), 315 deletions(-) diff --git a/net/stream.c b/net/stream.c index

[PATCH v8 11/14] qemu-sockets: move and rename SocketAddress_to_str()

2022-09-13 Thread Laurent Vivier
Rename SocketAddress_to_str() to socket_uri() and move it to util/qemu-sockets.c close to socket_parse(). socket_uri() generates a string from a SocketAddress while socket_parse() generates a SocketAddress from a string. Signed-off-by: Laurent Vivier --- include/qemu/sockets.h | 2 +-

[PATCH v8 02/14] net: remove the @errp argument of net_client_inits()

2022-09-13 Thread Laurent Vivier
The only caller passes _fatal, so use this directly in the function. It's what we do for -blockdev, -device, and -object. Suggested-by: Markus Armbruster Signed-off-by: Laurent Vivier Reviewed-by: Markus Armbruster --- include/net/net.h | 2 +- net/net.c | 20 +++-

Re: [PATCH v4 08/15] vhost: expose vhost_virtqueue_start()

2022-09-13 Thread Jason Wang
On Mon, Sep 12, 2022 at 1:22 AM Kangjie Xu wrote: > > Expose vhost_virtqueue_start(), we need to use it when restarting a > virtqueue. > > Signed-off-by: Kangjie Xu > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang > --- > hw/virtio/vhost.c | 8 > include/hw/virtio/vhost.h |

[PATCH v8 09/14] net: dgram: move mcast specific code from net_socket_fd_init_dgram()

2022-09-13 Thread Laurent Vivier
It is less complex to manage special cases directly in net_dgram_mcast_init() and net_dgram_udp_init(). Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/dgram.c | 143 +++- 1 file changed, 73 insertions(+), 70 deletions(-) diff

[PATCH v8 05/14] qapi: net: add stream and dgram netdevs

2022-09-13 Thread Laurent Vivier
Copied from socket netdev file and modified to use SocketAddress to be able to introduce new features like unix socket. "udp" and "mcast" are squashed into dgram netdev, multicast is detected according to the IP address type. "listen" and "connect" modes are managed by stream netdev. An optional

[PATCH v8 06/14] net: stream: Don't ignore EINVAL on netdev socket connection

2022-09-13 Thread Laurent Vivier
From: Stefano Brivio Other errors are treated as failure by net_stream_client_init(), but if connect() returns EINVAL, we'll fail silently. Remove the related exception. Signed-off-by: Stefano Brivio [lvivier: applied to net/stream.c] Signed-off-by: Laurent Vivier Reviewed-by: Daniel P.

Re: Any interest in a QEMU emulation BoF at KVM Forum?

2022-09-13 Thread Alex Bennée
The BoF session will be in Lifey A (the big hall) this afternoon. I thought being able to sit around tables while we discuss things would make things a bit easier. We can share note taking on the etherpad: https://etherpad.opendev.org/p/qemu-emulation-bof%40kvmforum2022 I'll run a HO at:

Re: [PATCH v3 03/24] disas/nanomips: Delete NMD class field

2022-09-13 Thread Richard Henderson
On 9/12/22 13:26, Milica Lazarevic wrote: The m_requested_instruction_categories field always has the same value, ALL_ATTRIBUTES. The only use of that field is within the if statement. When replaced with a specific value, the if statement is always false, so it has been removed. Now, when the

Re: Any interest in a QEMU emulation BoF at KVM Forum?

2022-09-13 Thread Daniel P . Berrangé
On Tue, Sep 13, 2022 at 09:16:07AM +0200, Cédric Le Goater wrote: > On 9/13/22 09:12, Alex Bennée wrote: > > The BoF session will be in Lifey A (the big hall) this afternoon. I thought > > being able to sit around tables while we discuss things would make things a > > bit easier. We can share

Re: [PATCH v3 17/24] disas/nanomips: Remove CPR function

2022-09-13 Thread Richard Henderson
On 9/12/22 13:26, Milica Lazarevic wrote: CPR functions has been removed. Before this patch, we'd been calling img_format twice, the first time through the CPR function to get an appropriate string and the second time to print that formatted string. There's no more need for that. Therefore,

[PATCH v8 01/14] net: introduce convert_host_port()

2022-09-13 Thread Laurent Vivier
Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- include/qemu/sockets.h | 2 ++ net/net.c | 62 ++ 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index

[PATCH v8 04/14] qapi: net: introduce a way to bypass qemu_opts_parse_noisily()

2022-09-13 Thread Laurent Vivier
As qemu_opts_parse_noisily() flattens the QAPI structures ("type" field of Netdev structure can collides with "type" field of SocketAddress), we introduce a way to bypass qemu_opts_parse_noisily() and use directly visit_type_Netdev() to parse the backend parameters. More details from Markus:

[PATCH v8 14/14] tests/qtest: netdev: test stream and dgram backends

2022-09-13 Thread Laurent Vivier
Signed-off-by: Laurent Vivier --- tests/qtest/meson.build | 1 + tests/qtest/netdev-socket.c | 391 2 files changed, 392 insertions(+) create mode 100644 tests/qtest/netdev-socket.c diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index

[PATCH v8 08/14] net: dgram: make dgram_dst generic

2022-09-13 Thread Laurent Vivier
dgram_dst is a sockaddr_in structure. To be able to use it with unix socket, use a pointer to a generic sockaddr structure. Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/dgram.c | 76 +++-- 1 file changed, 45 insertions(+), 31

Re: [PATCH v3 04/24] disas/nanomips: Delete NMD class second field

2022-09-13 Thread Richard Henderson
On 9/12/22 13:26, Milica Lazarevic wrote: We're deleting the m_pc field of the NMD class. It's now part of the Dis_info struct that this patch introduces. Currently, the Dis_info struct has just one field, m_pc, which we need for address calculation in the ADDRESS function. We're filling

Re: [PATCH v4 09/15] vhost: expose vhost_virtqueue_stop()

2022-09-13 Thread Jason Wang
On Mon, Sep 12, 2022 at 1:22 AM Kangjie Xu wrote: > > Expose vhost_virtqueue_stop(), we need to use it when resetting a > virtqueue. > > Signed-off-by: Kangjie Xu > Signed-off-by: Xuan Zhuo Acked-by: Jason Wang > --- > hw/virtio/vhost.c | 8 > include/hw/virtio/vhost.h | 2

[PATCH v8 00/14] qapi: net: add unix socket type support to netdev backend

2022-09-13 Thread Laurent Vivier
"-netdev socket" only supports inet sockets. It's not a complex task to add support for unix sockets, but the socket netdev parameters are not defined to manage well unix socket parameters. As discussed in: "socket.c added support for unix domain socket datagram transport"

Re: Any interest in a QEMU emulation BoF at KVM Forum?

2022-09-13 Thread Cédric Le Goater
On 9/13/22 09:12, Alex Bennée wrote: The BoF session will be in Lifey A (the big hall) this afternoon. I thought being able to sit around tables while we discuss things would make things a bit easier. We can share note taking on the etherpad:

Re: [PATCH v3 14/24] disas/nanomips: Delete wrapper functions

2022-09-13 Thread Richard Henderson
On 9/12/22 13:26, Milica Lazarevic wrote: Following functions just wrap the decode_gpr_gpr3() function: - encode_rs3_and_check_rs3_ge_rt3() - encode_rs3_and_check_rs3_lt_rt3() Therefore those have been deleted. Calls to these two functions have been replaced with calls to decode_gpr_gpr3.

Re: [PATCH v3 13/24] disas/nanomips: Delete copy functions

2022-09-13 Thread Richard Henderson
On 9/12/22 13:26, Milica Lazarevic wrote: Functions that have just one parameter and simply return it have been deleted. Calls to these functions have been replaced with the argument itself. We're deleting following functions: - both versions of copy() - encode_s_from_address() -

Re: [PATCH v3 15/24] disas/nanomips: Replace std::string type

2022-09-13 Thread Richard Henderson
On 9/12/22 13:26, Milica Lazarevic wrote: The return type of typedef disassembly_function is changed to char * instead of std::string. Therefore, for every particular disassembly_function function signature is changed. For example: - static std::string ABS_D(uint64 instruction, img_address m_pc)

[PATCH v8 07/14] net: stream: add unix socket

2022-09-13 Thread Laurent Vivier
Signed-off-by: Laurent Vivier Reviewed-by: Stefano Brivio --- net/stream.c| 108 +--- qapi/net.json | 2 +- qemu-options.hx | 1 + 3 files changed, 105 insertions(+), 6 deletions(-) diff --git a/net/stream.c b/net/stream.c index

[PATCH v8 12/14] qemu-sockets: update socket_uri() and socket_parse() to be consistent

2022-09-13 Thread Laurent Vivier
To be consistent with socket_uri(), add 'tcp:' prefix for inet type in socket_parse(), by default socket_parse() use tcp when no prefix is provided (format is host:port). In socket_uri(), use 'vsock:' prefix for vsock type rather than 'tcp:' because it makes a vsock address look like an inet

Re: [PATCH v3 16/24] disas/nanomips: Remove IMMEDIATE functions

2022-09-13 Thread Richard Henderson
On 9/12/22 13:26, Milica Lazarevic wrote: Both versions of IMMEDIATE functions have been removed. Before this patch, we'd been calling img_format twice, the first time through the IMMEDIATE to get an appropriate string and the second time to print that string. There's no more need for that.

Re: [PATCH v3 19/24] disas/nanomips: Remove function overloading

2022-09-13 Thread Richard Henderson
On 9/12/22 13:26, Milica Lazarevic wrote: Disassemble function that calls the other variant of it is deleted. Where it is called, now we're directly calling the other implementation. Signed-off-by: Milica Lazarevic --- disas/nanomips.cpp | 7 +-- 1 file changed, 1 insertion(+), 6

Re: [PATCH 27/37] target/i386: Use tcg gvec ops for pmovmskb

2022-09-13 Thread Richard Henderson
On 9/12/22 00:04, Paolo Bonzini wrote: +while (vec_len > 8) { +vec_len -= 8; +tcg_gen_shli_tl(s->T0, s->T0, 8); +tcg_gen_ld8u_tl(t, cpu_env, offsetof(CPUX86State, xmm_t0.ZMM_B(vec_len - 1))); +tcg_gen_or_tl(s->T0, s->T0, t); } The shl + or is deposit,

Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory

2022-09-13 Thread Sean Christopherson
On Thu, Sep 08, 2022, Kirill A. Shutemov wrote: > On Wed, Aug 31, 2022 at 05:24:39PM +0300, Kirill A . Shutemov wrote: > > On Sat, Aug 20, 2022 at 10:15:32PM -0700, Hugh Dickins wrote: > > > > I will try next week to rework it as shim to top of shmem. Does it work > > > > for you? > > > > > >

Re: [PATCH 33/37] target/i386: Enable AVX cpuid bits when using TCG

2022-09-13 Thread Richard Henderson
On 9/12/22 00:04, Paolo Bonzini wrote: From: Paul Brook Include AVX, AVX2 and VAES in the guest cpuid features supported by TCG. Signed-off-by: Paul Brook Message-Id:<20220424220204.2493824-40-p...@nowt.org> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 10 +- 1 file changed,

Re: [RFC PATCH 00/37] target/i386: new decoder + AVX implementation

2022-09-13 Thread Richard Henderson
On 9/12/22 00:03, Paolo Bonzini wrote: target/i386: remove old SSE decoder Patch 37 never arrived, but I can imagine what it looked like. :-) The series is looking good. All of the nits were minor. r~

[PATCH v2 0/4] virtio-gpu: Blob resources

2022-09-13 Thread Antonio Caggiano
Add shared memory and support blob resource creation, mapping and unmapping through virglrenderer new stable APIs[0] when available. [0] https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/891 Antonio Caggiano (1): virtio-gpu: Handle resource blob commands Dmitry Osipenko (1):

[PATCH v2 1/4] virtio: Add shared memory capability

2022-09-13 Thread Antonio Caggiano
From: "Dr. David Alan Gilbert" Define a new capability type 'VIRTIO_PCI_CAP_SHARED_MEMORY_CFG' and the data structure 'virtio_pci_shm_cap' to go with it. They allow defining shared memory regions with sizes and offsets of 2^32 and more. Multiple instances of the capability are allowed and

Re: [PATCH v3 1/3] util/main-loop: Fix maximum number of wait objects for win32

2022-09-13 Thread Marc-André Lureau
Hi On Wed, Aug 24, 2022 at 12:52 PM Bin Meng wrote: > From: Bin Meng > > The maximum number of wait objects for win32 should be > MAXIMUM_WAIT_OBJECTS, not MAXIMUM_WAIT_OBJECTS + 1. > > Signed-off-by: Bin Meng > --- > > Changes in v3: > - move the check of adding the same HANDLE twice to a

  1   2   >