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

2022-09-13 Thread Cédric Le Goater
On 9/13/22 21:52, BALATON Zoltan wrote: 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 acce

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

2022-09-13 Thread Xuan Zhuo
On Wed, 14 Sep 2022 11:13:29 +0800, Jason Wang wrote: > > 在 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

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()? Is

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. >

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 insertions(+

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 type

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 &error_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 Armbrus

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

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] 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 cau

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 vh

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 a/hw/net/v

[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

[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 deletions(-)

[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 con

[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 virtio_net_flush

[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 que

[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 insertion(

[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: https://git

[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 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 needs

[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 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 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 deletions

[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 f

[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 vhost_virtque

[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 dev

[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 inde

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 8b80942e7c.

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(-) diff

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 --- h

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 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 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 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 i

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() becau

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 Eug

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 h

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 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 i

[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 Ac

[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.

[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 --

[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 Zolt

[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 a/hw/ppc/ppc4xx_sdr

[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 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 ++--

[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 +561,

[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 on

[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 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 b3f56c49b5..d8a7947

[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 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 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 i

[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 +++ b/hw/ppc/ppc440_bamboo.c

[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 ins

[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 an

[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 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 fi

[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 the

[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 n

[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(+)

[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

[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 ind

[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 code.

[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 00/12] linux-user patches

2022-09-13 Thread Helge Deller
The following changes since commit 621da7789083b80d6f1ff1c0fb499334007b4f51: Update version for v7.1.0 release (2022-08-30 09:40:11 -0700) are available in the Git repository at: https://github.com/hdeller/qemu-hppa.git tags/publish1-pull-request for you to fetch changes up to 192cac33ab644

[PULL 07/12] linux-user: Fix strace of chmod() if mode == 0

2022-09-13 Thread Helge Deller
If the mode parameter of chmod() is zero, this value isn't shown when stracing a program: chmod("filename",) This patch fixes it up to show the zero-value as well: chmod("filename",000) Signed-off-by: Helge Deller --- linux-user/strace.c | 5 + 1 file changed, 5 insertions(+) diff -

[PULL 10/12] linux-user: Show timespec on strace for futex()

2022-09-13 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 6f818212d5..b6b9abaea4 100644 --- a/linux-user/strace.c +++ b/linux-user/strace.c @@ -3714,11 +3714,20 @@ print_futex

[PULL 02/12] linux-user: Add missing clock_gettime64() syscall strace

2022-09-13 Thread Helge Deller
Allow linux-user to strace the clock_gettime64() syscall. This syscall is used a lot on 32-bit guest architectures which use newer glibc versions. Signed-off-by: Helge Deller --- linux-user/strace.c| 53 ++ linux-user/strace.list | 4 2 files cha

[PULL 09/12] linux-user: Add strace for clock_nanosleep()

2022-09-13 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.c| 15 +++ linux-user/strace.list | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/linux-user/strace.c b/linux-user/strace.c index 2f539845bb..6f818212d5 100644 --- a/linux-user/strace.c +++ b/linux-user/str

[PULL 12/12] linux-user: Add parameters of getrandom() syscall for strace

2022-09-13 Thread Helge Deller
Signed-off-by: Helge Deller --- linux-user/strace.list | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/strace.list b/linux-user/strace.list index ad9ef94689..97d8ccadac 100644 --- a/linux-user/strace.list +++ b/linux-user/strace.list @@ -355,7 +355,7 @@ { TARGET_NR

[PULL 06/12] linux-user/hppa: Dump IIR on register dump

2022-09-13 Thread Helge Deller
Include the IIR register (which holds the opcode of the failing instruction) when dumping the hppa registers. Signed-off-by: Helge Deller --- target/hppa/helper.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/hppa/helper.c b/target/hppa/helper.c index e2758d8df

[PULL 05/12] linux-user/hppa: Use EXCP_DUMP() to show enhanced debug info

2022-09-13 Thread Helge Deller
Enhance the hppa linux-user cpu_loop() to show more debugging info on hard errors. Signed-off-by: Helge Deller --- linux-user/hppa/cpu_loop.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linux-user/hppa/cpu_loop.c b/linux-user/hppa/cpu_loop.c index 64263c3dc4..1ef3b46

Re: [RFC PATCH v2 3/3] hw/peci: add support for EndPointConfig reads

2022-09-13 Thread Peter Delevoryas
On Tue, Sep 13, 2022 at 06:21:49PM +, Titus Rwantare wrote: > Signed-off-by: Titus Rwantare > Reviewed-by: Hao Wu Reviewed-by: Peter Delevoryas > --- > hw/peci/peci-client.c | 63 ++ > hw/peci/peci-core.c| 44 +++-- > in

Re: [PATCH v2 00/18] ppc4xx_sdram QOMify and clean ups

2022-09-13 Thread BALATON Zoltan
On Tue, 13 Sep 2022, BALATON Zoltan wrote: 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

Re: [RFC PATCH 1/3] hw/peci: add initial support for PECI

2022-09-13 Thread Peter Delevoryas
On Tue, Sep 13, 2022 at 11:21:16AM -0700, Titus Rwantare wrote: > On Fri, 9 Sept 2022 at 12:58, Peter Delevoryas wrote: > > > > +/* > > > + * PECI Client device > > > + * Copyright 2021 Google LLC > > > + * > > > + * SPDX-License-Identifier: GPL-2.0-or-later > > > > Not sure, but I think the SPDX

Re: [RFC PATCH 0/3] Initial PECI bus support

2022-09-13 Thread Peter Delevoryas
On Tue, Sep 13, 2022 at 11:20:57AM -0700, Titus Rwantare wrote: > On Fri, 9 Sept 2022 at 12:54, Peter Delevoryas wrote: > > > > On Tue, Sep 06, 2022 at 10:05:49PM +, Titus Rwantare wrote: > ... > > > > > > This is something that can also be extended as other parameters arise > > > that need >

[PATCH v2 18/18] 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 Zolt

[PATCH v2 16/18] 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 +++

Re: [RFC PATCH v2 1/3] hw/peci: add initial support for PECI

2022-09-13 Thread Peter Delevoryas
On Tue, Sep 13, 2022 at 06:21:47PM +, Titus Rwantare wrote: > PECI - Platform Environment Control Interface > > This commit adds support for reading basic sensor values from a client > on the PECI bus. > BMCs can use the PECI wire to get thermal information out of an Intel > cpu. Additionally,

[PATCH v2 14/18] 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 --

[PATCH v2 13/18] 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 on

[PATCH v2 15/18] 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 a/hw/ppc/ppc4xx_sdr

[PATCH v2 12/18] 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 v2 11/18] 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 | 81 ++-- hw/ppc/ppc4xx_devs.c | 44 2 files changed, 63 insertions(+), 62 deletions(-) diff --git a/hw

[PATCH v2 17/18] 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.

[PATCH v2 10/18] ppc440_sdram: Implement enable bit in the DDR2 SDRAM controller

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.h| 3 +-- hw/ppc/ppc440_uc.c | 40 +

[PATCH v2 09/18] 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 +561,

[PATCH v2 07/18] 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 i

[PATCH v2 08/18] 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 v2 05/18] 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 +++ b/hw/ppc/ppc440_bamboo.c

[PATCH v2 06/18] 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 v2 03/18] 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 the

[PATCH v2 04/18] 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 an

[PATCH v2 02/18] 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 v2 00/18] 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 n

[PATCH v2 01/18] 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 fi

[RFC PATCH v2 3/3] hw/peci: add support for EndPointConfig reads

2022-09-13 Thread Titus Rwantare
Signed-off-by: Titus Rwantare Reviewed-by: Hao Wu --- hw/peci/peci-client.c | 63 ++ hw/peci/peci-core.c| 44 +++-- include/hw/peci/peci.h | 23 +++ 3 files changed, 128 insertions(+), 2 deletions(-) diff --git a/h

  1   2   >