Re: [RFC PATCH v2 1/2] Add RISC-V CSR qtest support

2024-06-18 Thread Thomas Huth
On 18/06/2024 08.44, Ivan Klokov wrote: The RISC-V architecture supports the creation of custom CSR-mapped devices. It would be convenient to test them in the same way as MMIO-mapped devices. To do this, a new call has been added to read/write CSR registers. Signed-off-by: Ivan Klokov --- ...

Re: [PATCH v2 2/4] target/ppc: Move VSX vector with length storage access insns to decodetree.

2024-06-18 Thread Chinmay Rath
On 6/17/24 23:15, Richard Henderson wrote: On 6/17/24 03:40, Chinmay Rath wrote: static TCGv do_ea_calc_ra(DisasContext *ctx, int ra) { TCGv EA; if (!ra) {     return tcg_constant_tl(0); } if (NARROW_MODE(ctx)) {     EA = tcg_temp_new();     tcg_gen_ext32u_t

Re: [PATCH v2 2/4] target/ppc: Move VSX vector with length storage access insns to decodetree.

2024-06-18 Thread Chinmay Rath
On 6/17/24 23:27, Richard Henderson wrote: On 6/17/24 04:51, Chinmay Rath wrote: Hi Richard, On 6/17/24 00:43, Richard Henderson wrote: On 6/13/24 02:33, Chinmay Rath wrote: +/* EA <- (ra == 0) ? 0 : GPR[ra] */ +static TCGv do_ea_calc_ra(DisasContext *ctx, int ra) +{ +    TCGv EA; +    if

[PATCH v4 3/3] target/ppc: handle vcpu hotplug failure gracefully

2024-06-18 Thread Harsh Prateek Bora
On ppc64, the PowerVM hypervisor runs with limited memory and a VCPU creation during hotplug may fail during kvm_ioctl for KVM_CREATE_VCPU, leading to termination of guest since errp is set to &error_fatal while calling kvm_init_vcpu. This unexpected behaviour can be avoided by pre-creating and par

[PATCH v4 2/3] cpu-common.c: export cpu_get_free_index to be reused later

2024-06-18 Thread Harsh Prateek Bora
This helper provides an easy way to identify the next available free cpu index which can be used for vcpu creation. Until now, this is being called at a very later stage and there is a need to be able to call it earlier (for now, with ppc64) hence the need to export. Suggested-by: Nicholas Piggin

[PATCH v4 1/3] accel/kvm: Introduce kvm_create_and_park_vcpu() helper

2024-06-18 Thread Harsh Prateek Bora
There are distinct helpers for creating and parking a KVM vCPU. However, there can be cases where a platform needs to create and immediately park the vCPU during early stages of vcpu init which can later be reused when vcpu thread gets initialized. This would help detect failures with kvm_create_vc

[PATCH v4 0/3] target/ppc: vcpu hotplug failure handling fixes

2024-06-18 Thread Harsh Prateek Bora
On ppc64, the PowerVM hypervisor runs with limited memory and a VCPU creation during hotplug may fail during kvm_ioctl for KVM_CREATE_VCPU, leading to termination of guest since errp is set to &error_fatal while calling kvm_init_vcpu. This unexpected behaviour can be avoided by pre-creating and par

Re: [PATCH] nbd: Prevent NULL pointer dereference in nbd_blockdev_client_closed()

2024-06-18 Thread Alexander Ivanov
Hello Eric, Do you have any ideas about the bug? Thank you. On 6/10/24 14:33, Eric Blake wrote: On Sat, Jun 08, 2024 at 11:36:59AM GMT, Alexander Ivanov wrote: There is a bug reproducer in the attachment. Summarizing the reproducer, you are repeatedly calling QMP nbd-server-start/nbd-server-

Re: [PATCH 18/20] qapi: ensure all errors sections are uniformly typset

2024-06-18 Thread Markus Armbruster
John Snow writes: > On Fri, Jun 14, 2024, 7:24 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > Transactions have the only instance of an Errors section that isn't a >> > rST list; turn it into one. >> >> Just for consistency? Or do you have other shenanigans up your sleeve? > > Just

Re: [PATCH 14/20] qapi: fix non-compliant JSON examples

2024-06-18 Thread Markus Armbruster
John Snow writes: > On Fri, Jun 14, 2024, 6:55 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > If we parse all examples as QMP, we need them to conform to a standard >> > so that they render correctly. Once the QMP lexer is active for >> > examples, these will produce warning message

[PATCH v3 2/4] target/ppc: Move VSX vector with length storage access insns to decodetree.

2024-06-18 Thread Chinmay Rath
Moving the following instructions to decodetree specification : {l, st}xvl(l) : X-form The changes were verified by validating that the tcg-ops generated by those instructions remain the same, which were captured using the '-d in_asm,op' flag. Also added a new function do_ea_ca

[PATCH v3 3/4] target/ppc: Move VSX vector storage access insns to decodetree.

2024-06-18 Thread Chinmay Rath
Moving the following instructions to decodetree specification: lxv{b16, d2, h8, w4, ds, ws}x : X-form stxv{b16, d2, h8, w4}x : X-form The changes were verified by validating that the tcg-ops generated for those instructions remain the same, which were captured using the '-d in_asm,

[PATCH v3 4/4] target/ppc: Move VSX fp compare insns to decodetree.

2024-06-18 Thread Chinmay Rath
Moving the following instructions to decodetree specification: xvcmp{eq, gt, ge, ne}{s, d}p: XX3-form The changes were verified by validating that the tcg-ops generated for those instructions remain the same which were captured using the '-d in_asm,op' flag. Signed-off-by: Chinmay Ra

[PATCH v3 1/4] target/ppc: Moving VSX scalar storage access insns to decodetree.

2024-06-18 Thread Chinmay Rath
Moving the following instructions to decodetree specification : lxs{d, iwa, ibz, ihz, iwz, sp}x : X-form stxs{d, ib, ih, iw, sp}x: X-form The changes were verified by validating that the tcg-ops generated by those instructions remain the same, which were ca

[PATCH v3 0/4] target/ppc: Move VSX storage access and compare

2024-06-18 Thread Chinmay Rath
Moving all remaining VSX storage access instructions and all VSX compare instructions of XX3 form with RC field, to decodetree specification. Change log : v3: - Patch 2/4 : Updated the added function do_ea_calc_ra to return modifiable EA, after discussions with Richard. v2: https://lore.kerne

Re: [RFC PATCH v2 3/5] rust: add PL011 device model

2024-06-18 Thread Daniel P . Berrangé
On Mon, Jun 17, 2024 at 01:32:54PM +0200, Paolo Bonzini wrote: > Il lun 17 giu 2024, 10:59 Manos Pitsidianakis < > manos.pitsidiana...@linaro.org> ha scritto: > > > >qdev_define_type!(c"test-device", TestDevice); > > >impl ObjectImpl for TestDevice {} > > >impl DeviceImpl for TestDevice {} > > > >

Re: [PATCH v2] target/i386/kvm: Refine VMX controls setting for backward compatibility

2024-06-18 Thread Ewan Hai
Dear Xiaoyao and Maintainers,     Are there any new comments regarding this patch? On 2/22/24 22:13, Ewan Hai wrote: On 2/20/24 06:07, Ewan Hai wrote: On 2/20/24 03:32, Xiaoyao Li wrote: diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 11b8177eff..c8f6c0b531 100644 --- a/tar

Re: [RFC PATCH v2 3/5] rust: add PL011 device model

2024-06-18 Thread Paolo Bonzini
On Tue, Jun 18, 2024 at 11:13 AM Daniel P. Berrangé wrote: > I wonder if starting with a device implementation is perhaps the > wrong idea, in terms of a practical yet simple first step. > > As devices go, the pl011 device is simple, but compared to other > QOM impls in QEMU, devices are still rel

Re: [RFC PATCH v2 3/5] rust: add PL011 device model

2024-06-18 Thread Peter Maydell
On Tue, 18 Jun 2024 at 10:30, Paolo Bonzini wrote: > > On Tue, Jun 18, 2024 at 11:13 AM Daniel P. Berrangé > wrote: > > I wonder if starting with a device implementation is perhaps the > > wrong idea, in terms of a practical yet simple first step. > > > > As devices go, the pl011 device is simpl

Re: [PATCH v2] hw/arm/virt-acpi-build: Fix IORT id_count

2024-06-18 Thread Michael S. Tsirkin
On Mon, Jun 17, 2024 at 03:39:45PM -0700, Nicolin Chen wrote: > The IORT doc defines "Number of IDs" ("id_count" in the virt-acpi-build) > to be "the number of IDs in the range minus one". Otherwise, Linux kernel > reports "conflicting mapping for input ID" FW_BUG at the overlapped ID. > > Fixes:

Re: [PATCH 9/9] contrib/plugins: add ips plugin example for cost modeling

2024-06-18 Thread Alex Bennée
Pierrick Bouvier writes: > On 6/17/24 13:56, Dr. David Alan Gilbert wrote: >> * Pierrick Bouvier (pierrick.bouv...@linaro.org) wrote: >>> On 6/14/24 15:00, Dr. David Alan Gilbert wrote: * Pierrick Bouvier (pierrick.bouv...@linaro.org) wrote: > Hi Dave, > > On 6/12/24 14:02, Dr. D

[PATCH v8 02/13] libvhost-user: set msg.msg_control to NULL when it is empty

2024-06-18 Thread Stefano Garzarella
On some OS (e.g. macOS) sendmsg() returns -1 (errno EINVAL) if the `struct msghdr` has the field `msg_controllen` set to 0, but `msg_control` is not NULL. Reviewed-by: Eric Blake Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Acked-by: Stef

[PATCH v8 01/13] qapi: clarify that the default is backend dependent

2024-06-18 Thread Stefano Garzarella
The default value of the @share option of the @MemoryBackendProperties really depends on the backend type, so let's document the default values in the same place where we define the option to avoid dispersing the information. Cc: David Hildenbrand Suggested-by: Markus Armbruster Reviewed-by: Mar

[PATCH v8 00/13] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-06-18 Thread Stefano Garzarella
As discussed with Michael and Markus [1], this version also includes the patch on which v7 depended to simplify the merge in Michael's tree. The series is all reviewed, so if there are no new changes required, I would ask to merge it. [1] https://patchew.org/QEMU/20240612130140.63004-1-sgarz...@

[PATCH v8 04/13] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported

2024-06-18 Thread Stefano Garzarella
libvhost-user will panic when receiving VHOST_USER_GET_INFLIGHT_FD message if MFD_ALLOW_SEALING is not defined, since it's not able to create a memfd. VHOST_USER_GET_INFLIGHT_FD is used only if VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD is negotiated. So, let's mask that feature if the backend is not ab

[PATCH v8 03/13] libvhost-user: fail vu_message_write() if sendmsg() is failing

2024-06-18 Thread Stefano Garzarella
In vu_message_write() we use sendmsg() to send the message header, then a write() to send the payload. If sendmsg() fails we should avoid sending the payload, since we were unable to send the header. Discovered before fixing the issue with the previous patch, where sendmsg() failed on macOS due t

[PATCH v8 05/13] vhost-user-server: do not set memory fd non-blocking

2024-06-18 Thread Stefano Garzarella
In vhost-user-server we set all fd received from the other peer in non-blocking mode. For some of them (e.g. memfd, shm_open, etc.) it's not really needed, because we don't use these fd with blocking operations, but only to map memory. In addition, in some systems this operation can fail (e.g. in

[PATCH v8 08/13] vhost-user: enable frontends on any POSIX system

2024-06-18 Thread Stefano Garzarella
The vhost-user protocol is not really Linux-specific so let's enable vhost-user frontends for any POSIX system. In vhost_net.c we use VHOST_FILE_UNBIND which is defined in a Linux specific header, let's define it for other systems as well. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe

[PATCH v8 06/13] contrib/vhost-user-blk: fix bind() using the right size of the address

2024-06-18 Thread Stefano Garzarella
On macOS passing `-s /tmp/vhost.socket` parameter to the vhost-user-blk application, the bind was done on `/tmp/vhost.socke` pathname, missing the last character. This sounds like one of the portability problems described in the unix(7) manpage: Pathname sockets When binding a socket

[PATCH v8 07/13] contrib/vhost-user-*: use QEMU bswap helper functions

2024-06-18 Thread Stefano Garzarella
Let's replace the calls to le*toh() and htole*() with qemu/bswap.h helpers to make the code more portable. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Acked-by: Stefan Hajnoczi Reviewed-by: David Hildenbrand Signed-off-by: Stefano

[PATCH v8 10/13] contrib/vhost-user-blk: enable it on any POSIX system

2024-06-18 Thread Stefano Garzarella
Let's make the code more portable by adding defines from block/file-posix.c to support O_DIRECT in other systems (e.g. macOS). vhost-user-server.c is a dependency, let's enable it for any POSIX system. Acked-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Dau

[PATCH v8 09/13] libvhost-user: enable it on any POSIX system

2024-06-18 Thread Stefano Garzarella
The vhost-user protocol is not really Linux-specific so let's enable libvhost-user for any POSIX system. Compiling it on macOS and FreeBSD some problems came up: - avoid to include linux/vhost.h which is available only on Linux (vhost_types.h contains many of the things we need) - macOS doesn't

[PATCH v8 12/13] tests/qtest/vhost-user-blk-test: use memory-backend-shm

2024-06-18 Thread Stefano Garzarella
`memory-backend-memfd` is available only on Linux while the new `memory-backend-shm` can be used on any POSIX-compliant operating system. Let's use it so we can run the test in multiple environments. Since we are here, let`s remove `share=on` which is the default for shm (and also for memfd). Ack

[PATCH v8 13/13] tests/qtest/vhost-user-test: add a test case for memory-backend-shm

2024-06-18 Thread Stefano Garzarella
`memory-backend-shm` can be used with vhost-user devices, so let's add a new test case for it. Acked-by: Thomas Huth Acked-by: Stefan Hajnoczi Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Stefano Garzarella --- tests/qtest/vhost-user-test.c | 23 +

[PATCH v8 11/13] hostmem: add a new memory backend based on POSIX shm_open()

2024-06-18 Thread Stefano Garzarella
shm_open() creates and opens a new POSIX shared memory object. A POSIX shared memory object allows creating memory backend with an associated file descriptor that can be shared with external processes (e.g. vhost-user). The new `memory-backend-shm` can be used as an alternative when `memory-backen

Re: [PATCH v3 03/13] hw/riscv: add RISC-V IOMMU base emulation

2024-06-18 Thread Jason Chien
Hi Daniel, On 2024/5/24 上午 01:39, Daniel Henrique Barboza wrote: From: Tomasz Jeznach The RISC-V IOMMU specification is now ratified as-per the RISC-V international process. The latest frozen specifcation can be found at: https://github.com/riscv-non-isa/riscv-iommu/releases/download/v1.0/ris

Re: [PATCH 00/43] Remaining MMU clean up patches

2024-06-18 Thread BALATON Zoltan
On Mon, 27 May 2024, BALATON Zoltan wrote: This is the rest of the MMU clean up series the first part of which was merged. Here are the remaining patches rebased and some more added. Ping? Regards, BALATON Zoltan BALATON Zoltan (43): target/ppc: Reorganise and rename ppc_hash32_pp_prot() t

Re: [PATCH v3 09/13] hw/riscv/riscv-iommu: add s-stage and g-stage support

2024-06-18 Thread Jason Chien
Hi Daniel, On 2024/5/24 上午 01:39, Daniel Henrique Barboza wrote: From: Tomasz Jeznach Add support for s-stage (sv32, sv39, sv48, sv57 caps) and g-stage (sv32x4, sv39x4, sv48x4, sv57x4 caps). Most of the work is done in the riscv_iommu_spa_fetch() function that now has to consider how many tran

Re: [PATCH v8 01/13] qapi: clarify that the default is backend dependent

2024-06-18 Thread Philippe Mathieu-Daudé
On 18/6/24 12:00, Stefano Garzarella wrote: The default value of the @share option of the @MemoryBackendProperties really depends on the backend type, so let's document the default values in the same place where we define the option to avoid dispersing the information. Cc: David Hildenbrand Sug

Re: [PATCH v2 0/2] target/s390x: Fix tracing header path in TCG mem_helper.c

2024-06-18 Thread Philippe Mathieu-Daudé
ping? On 13/6/24 12:44, Philippe Mathieu-Daudé wrote: In order to keep trace event headers local to their directory, introduce s390_skeys_get/s390_skeys_set helpers, fixing: In file included from ../../target/s390x/tcg/mem_helper.c:33: ../../target/s390x/tcg/trace.h:1:10: fatal error: 't

Re: [PATCH v1 0/3] util/readline.c: Add common but missing shortcuts

2024-06-18 Thread Philippe Mathieu-Daudé
On 13/6/24 10:06, Manos Pitsidianakis wrote: Some commonly used readline shortcuts are missing from our implementation. This series adds: - Control-n next line, same as Down arrow key - Control-p previous line, same as Up arrow key - Control-u erase line starting from cursor Manos Pitsidianakis

Re: [PATCH 0/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu*()

2024-06-18 Thread Philippe Mathieu-Daudé
On 12/6/24 15:25, Philippe Mathieu-Daudé wrote: Trivial patches using const IOMMUTLBEvent. Philippe Mathieu-Daudé (3): memory: Constify IOMMUTLBEvent in memory_region_notify_iommu_one() memory: Constify IOMMUTLBEvent in memory_region_notify_iommu() hw/i386/iommu: Constify IOMMUTLBEvent

Re: [PATCH v6 00/23] hw/i386: Remove deprecated pc-i440fx-2.0 -> 2.3 machines

2024-06-18 Thread Philippe Mathieu-Daudé
On 17/6/24 09:10, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (23): hw/i386/pc: Deprecate 2.4 to 2.12 pc-i440fx machines hw/i386/pc: Remove deprecated pc-i440fx-2.0 machine hw/usb/hcd-xhci: Remove XHCI_FLAG_FORCE_PCIE_ENDCAP flag hw/usb/hcd-xhci: Remove XHCI_FLAG_SS_FIRST fl

Re: [PATCH 00/26] hw/ppc: Prefer HumanReadableText over Monitor

2024-06-18 Thread Philippe Mathieu-Daudé
On 10/6/24 08:20, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (26): hw/ppc: Avoid using Monitor in pnv_phb3_msi_pic_print_info() hw/ppc: Avoid using Monitor in icp_pic_print_info() hw/ppc: Avoid using Monitor in xive_tctx_pic_print_info() hw/ppc: Avoid using Monitor in ics_p

Re: [PATCH v3 2/3] hw/dma: Add a trace log for a description loading failure

2024-06-18 Thread Philippe Mathieu-Daudé
On 13/6/24 03:35, Fea.Wang wrote: Due to a description loading failure, adding a trace log makes observing the DMA behavior easy. Signed-off-by: Fea.Wang Reviewed-by: Edgar E. Iglesias Reviewed-by: Frank Chang --- hw/dma/trace-events| 3 +++ hw/dma/xilinx_axidma.c | 3 +++ 2 files cha

Re: [PATCH v2 0/3] hw/usb: Introduce x-query-usbhost QMP command

2024-06-18 Thread Philippe Mathieu-Daudé
On 11/6/24 12:23, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (3): hw/usb: Remove unused 'host.h' header hw/usb: Introduce x-query-usbhost QMP command monitor: Remove monitor_register_hmp() Series queued.

Re: [PATCH 0/2] hw/intc: Introduce x-query-interrupt-controllers QMP command

2024-06-18 Thread Philippe Mathieu-Daudé
On 10/6/24 08:35, Philippe Mathieu-Daudé wrote: Philippe Mathieu-Daudé (2): hw/intc: Avoid using Monitor in INTERRUPT_STATS_PROVIDER::print_info() hw/intc: Introduce x-query-interrupt-controllers QMP command Series queued.

Re: [PATCH v3 2/3] ui+display: rename is_placeholder() -> surface_is_placeholder()

2024-06-18 Thread Philippe Mathieu-Daudé
On 5/6/24 15:14, Gerd Hoffmann wrote: No functional change. Signed-off-by: Gerd Hoffmann --- include/ui/surface.h | 2 +- ui/console.c | 2 +- ui/sdl2-2d.c | 2 +- ui/sdl2-gl.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Philippe Mathieu

Re: [PATCH 19/20] qapi: convert "Note" sections to plain rST

2024-06-18 Thread Markus Armbruster
John Snow writes: > On Fri, Jun 14, 2024, 9:44 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > We do not need a dedicated section for notes. By eliminating a specially >> > parsed section, these notes can be treated as normal rST paragraphs in >> > the new QMP reference manual, and c

Re: [PATCH v3 0/3] stdvga: fix screen blanking

2024-06-18 Thread Philippe Mathieu-Daudé
On 5/6/24 15:14, Gerd Hoffmann wrote: Gerd Hoffmann (3): stdvga: fix screen blanking ui+display: rename is_placeholder() -> surface_is_placeholder() ui+display: rename is_buffer_shared() -> surface_is_allocated() Since Marc-André reviewed, I'm queuing this series, thanks!

Re: [PATCH v3 1/4] hw/intc: Remove loongarch_ipi.c

2024-06-18 Thread Philippe Mathieu-Daudé
On 5/6/24 04:15, Jiaxun Yang wrote: It was missed out in previous commit. Fixes: b4a12dfc2132 ("hw/intc/loongarch_ipi: Rename as loongson_ipi") Signed-off-by: Jiaxun Yang --- hw/intc/loongarch_ipi.c | 347 1 file changed, 347 deletions(-) Re

Re: [PATCH v5 1/1] hw/arm/sbsa-ref: Enable CPU cluster on ARM sbsa machine

2024-06-18 Thread Leif Lindholm
On 2024-06-07 11:38, Xiong Yining wrote: Enable CPU cluster support on SbsaQemu platform, so that users can specify a 4-level CPU hierarchy sockets/clusters/cores/threads. And this topology can be passed to the firmware through /cpus/topology Device Tree. Signed-off-by: Xiong Yining tested-by:

Re: [PATCH v3 3/4] hw/mips/loongson3_virt: Wire up loongson_ipi device

2024-06-18 Thread Philippe Mathieu-Daudé
On 5/6/24 04:15, Jiaxun Yang wrote: Wire up loongson_ipi device for loongson3_virt machine, so we can have SMP support for TCG backend as well. Signed-off-by: Jiaxun Yang --- hw/mips/Kconfig | 1 + hw/mips/loongson3_bootp.c | 2 -- hw/mips/loongson3_bootp.h | 3 +++ hw/mips/lo

[PATCH v2] osdep: add a qemu_close_all_open_fd() helper

2024-06-18 Thread Clément Léger
Since commit 03e471c41d8b ("qemu_init: increase NOFILE soft limit on POSIX"), the maximum number of file descriptors that can be opened are raised to nofile.rlim_max. On recent debian distro, this yield a maximum of 1073741816 file descriptors. Now, when forking to start qemu-bridge-helper, this ac

Re: [PATCH v2 03/17] vfio/common: Move dirty tracking ranges update to helper

2024-06-18 Thread Cédric Le Goater
On 6/17/24 1:39 PM, Eric Auger wrote: Hi Cédric, On 6/17/24 08:33, Cédric Le Goater wrote: From: Joao Martins Separate the changes that updates the ranges from the listener, to s/updates/update fixed. make it reusable in preparation to expand its use to vIOMMU support. [ clg: - Rebased o

Re: [PATCH v2 04/17] vfio/common: Extract vIOMMU code from vfio_sync_dirty_bitmap()

2024-06-18 Thread Cédric Le Goater
On 6/17/24 4:00 PM, Eric Auger wrote: Hi Cédric, On 6/17/24 08:33, Cédric Le Goater wrote: From: Avihai Horon Extract vIOMMU code from vfio_sync_dirty_bitmap() to a new function and restructure the code. This is done in preparation for optimizing vIOMMU deviice dirty page device fixed.

Re: [PATCH v3 3/4] hw/mips/loongson3_virt: Wire up loongson_ipi device

2024-06-18 Thread Philippe Mathieu-Daudé
On 18/6/24 13:17, Philippe Mathieu-Daudé wrote: On 5/6/24 04:15, Jiaxun Yang wrote: Wire up loongson_ipi device for loongson3_virt machine, so we can have SMP support for TCG backend as well. Signed-off-by: Jiaxun Yang ---   hw/mips/Kconfig   |  1 +   hw/mips/loongson3_bootp.c |  2 --

Re: [PATCH 20/20] qapi: convert "Example" sections to rST

2024-06-18 Thread Markus Armbruster
John Snow writes: > On Fri, Jun 14, 2024 at 10:39 AM Markus Armbruster > wrote: > >> John Snow writes: >> >> > Eliminate the "Example" sections in QAPI doc blocks, converting them >> > into QMP example code blocks. This is generally done by converting >> > "Example:" or "Examples:" lines into "

Re: [PATCH v3 0/2] meson: Remove libibumad dependence

2024-06-18 Thread Philippe Mathieu-Daudé
On 13/6/24 11:01, Philippe Mathieu-Daudé wrote: On 11/6/24 12:54, zhenwei pi wrote: v2 -> v3: - refresh lcitool after removing libibumad v1 -> v2: - remove libibumad from tests/lcitool/projects/qemu.yml v1: - remove libibumad dependence Zhenwei Pi (2):    meson: Remove libibumad dependence   

Re: [PATCH v4 00/15] vfio: VFIO migration support with vIOMMU

2024-06-18 Thread Joao Martins
[sorry for the delay, I was out last week] On 10/06/2024 17:53, Cédric Le Goater wrote: > On 6/7/24 5:10 PM, Joao Martins wrote: >> On 06/06/2024 16:43, Cédric Le Goater wrote: >>> Hello Joao, >>> >>> On 6/22/23 23:48, Joao Martins wrote: Hey, This series introduces support for vIOM

[PATCH v2] target/riscv: fix instructions count handling in icount mode

2024-06-18 Thread Clément Léger
When icount is enabled, rather than returning the virtual CPU time, we should return the instruction count itself. Add an instructions bool parameter to get_ticks() to correctly return icount_get_raw() when icount_enabled() == 1 and instruction count is queried. This will modify the existing behavi

Re: [PATCH v2 05/17] vfio/container: Introduce vfio_address_space_insert()

2024-06-18 Thread Cédric Le Goater
On 6/17/24 4:04 PM, Eric Auger wrote: On 6/17/24 08:33, Cédric Le Goater wrote: It will ease future changes. Does it, really? Changed to : It prepares gound for a future change initializing the 'space' pointer of VFIOContainerBase. The goal is to replace vfio_container_init() by an .

Re: [PATCH v2 06/17] vfio/container: Simplify vfio_container_init()

2024-06-18 Thread Cédric Le Goater
On 6/17/24 4:25 PM, Eric Auger wrote: Hi Cédric, On 6/17/24 08:33, Cédric Le Goater wrote: Assign the base container VFIOAddressSpace 'space' pointer in vfio_address_space_insert(). OK I get it now. Maybe in the previous patch, say that the vfio_address_space_insert() will be enhanced with a

Re: [PATCH v2] ppc/pnv: Introduce pnv_chip_foreach_cpu()

2024-06-18 Thread Philippe Mathieu-Daudé
On 17/6/24 13:19, Philippe Mathieu-Daudé wrote: From: Cédric Le Goater This helper routine uses the machine definition, sockets, cores and threads, to loop on all CPUs of the machine. Replace CPU_FOREACH() with it. Signed-off-by: Cédric Le Goater Reviewed-by: Nicholas Piggin Reviewed-by: Phi

Re: [PATCH 3/3] semihosting: Restrict to TCG

2024-06-18 Thread Philippe Mathieu-Daudé
ping :) On 12/6/24 15:12, Philippe Mathieu-Daudé wrote: Hi Paolo, On 30/5/24 15:58, Philippe Mathieu-Daudé wrote: On 30/5/24 09:31, Paolo Bonzini wrote: On Thu, May 30, 2024 at 9:22 AM Philippe Mathieu-Daudé wrote: On 30/5/24 08:02, Paolo Bonzini wrote: On Wed, May 29, 2024 at 5:56 PM Phi

Re: [PATCH 09/20] qapi/parser: add undocumented stub members to all_sections

2024-06-18 Thread Markus Armbruster
John Snow writes: > On Fri, Jun 14, 2024 at 4:53 AM Markus Armbruster wrote: > >> John Snow writes: >> >> > This helps simplify the doc generator if it doesn't have to check for >> > undocumented members. >> > >> > Signed-off-by: John Snow >> > --- >> > scripts/qapi/parser.py | 20 +++

Re: [PATCH v2 0/4] MAINTAINERS: update kraxel's entries.

2024-06-18 Thread Philippe Mathieu-Daudé
On 28/5/24 10:38, Gerd Hoffmann wrote: Gerd Hoffmann (4): MAINTAINERS: drop audio maintainership I couldn't figure if the discussion on patch #1 is resolved, so I only queued patches 3 & 4 to avoid you getting spammed. MAINTAINERS: drop virtio-gpu maintainership MAINTAINERS: drop sp

Re: [PATCH v2 00/17] vfio: QOMify VFIOContainer

2024-06-18 Thread Cédric Le Goater
On 6/17/24 6:22 PM, Eric Auger wrote: Hi Cédric, On 6/17/24 08:33, Cédric Le Goater wrote: Hello, The series starts with simple changes (patch 1-4). Two of which were initially sent by Joao in a series adding VFIO migration support with vIOMMU [1]. The changes following prepare VFIOContainer

Re: [PATCH 0/4] hw/m68k/virt: Add some devices

2024-06-18 Thread Philippe Mathieu-Daudé
On 27/5/24 19:15, Jiaxun Yang wrote: Hi all, This series added some devices that I found lacking when I was trying to port U-Boot to m68k virt machine. Cc'ing Mark, but both he and Laurent are busy :/ Please review. Thanks Signed-off-by: Jiaxun Yang --- Jiaxun Yang (4): hw/m68k/virt

Re: [PATCH 3/4] hw/m68k/virt: Add a pflash controller for BIOS firmware

2024-06-18 Thread Philippe Mathieu-Daudé
Hi Jiaxun, On 27/5/24 19:15, Jiaxun Yang wrote: Add a 8 MiB pflash controller for BIOS firmware, and boot from it if possible. Signed-off-by: Jiaxun Yang --- hw/m68k/Kconfig | 1 + hw/m68k/virt.c| 44

Re: [PATCH v3 0/4] hw/mips/loongson3_virt: Implement IPI support

2024-06-18 Thread Philippe Mathieu-Daudé
On 12/6/24 14:09, Jiaxun Yang wrote: 在2024年6月5日六月 上午3:15,Jiaxun Yang写道: Hi all, This series enabled IPI support for loongson3 virt board, loosely based on my previous work[1]. It generalized loongarch_ipi device to share among both loongarch and MIPS machines. Thanks A genttle ping :-) Ser

[PATCH] hw/virtio: Fix the de-initialization of vhost-user devices

2024-06-18 Thread Thomas Huth
The unrealize functions of the various vhost-user devices are calling the corresponding vhost_*_set_status() functions with a status of 0 to shut down the device correctly. Now these vhost_*_set_status() functions all follow this scheme: bool should_start = virtio_device_should_start(vdev, st

Re: [PATCH qemu ] hw/acpi: Fix big endian host creation of Generic Port Affinity Structures

2024-06-18 Thread Igor Mammedov
On Mon, 17 Jun 2024 13:05:15 +0100 Jonathan Cameron wrote: > On Fri, 14 Jun 2024 15:08:35 +0100 > Jonathan Cameron wrote: > > > On Fri, 14 Jun 2024 12:57:25 +0200 > > Igor Mammedov wrote: > > > > > On Thu, 6 Jun 2024 18:47:16 +0100 > > > Jonathan Cameron wrote: > > > > > > > On Thu, 6

Re: [PATCH v2 04/12] qtest: bios-tables-test: Rename aarch64 tests with aarch64 in them

2024-06-18 Thread Igor Mammedov
On Fri, 24 May 2024 11:44:03 +0530 Sunil V L wrote: > Existing AARCH64 virt test functions do not have AARCH64 in their name. > To add RISC-V virt related test cases, better to rename existing > functions to indicate they are ARM only. > > Signed-off-by: Sunil V L > Reviewed-by: Alistair Franci

Re: [PATCH v2 0/2] target/s390x: Fix tracing header path in TCG mem_helper.c

2024-06-18 Thread Thomas Huth
On 13/06/2024 12.44, Philippe Mathieu-Daudé wrote: In order to keep trace event headers local to their directory, introduce s390_skeys_get/s390_skeys_set helpers, fixing: In file included from ../../target/s390x/tcg/mem_helper.c:33: ../../target/s390x/tcg/trace.h:1:10: fatal error: 'trace

[PATCH] tcg/loongarch64: Fix tcg_out_movi tcg_debug_assert() error

2024-06-18 Thread Song Gao
On Loongnix 20.5 systems, QEMU configure with option '--enable-debug' or '--enable-debug-tcg ', booting the Loongnix 20.5 VM in tcg mode will get an assertion error. "... [ 31.484992] [drm] Initialized virtio_gpu 0.0.1 0 for virtio1 on minor 0 qemu-system-loongarch64: /home1/gaosong

[PATCH] hw/gpio/aspeed: Add bounds checking for register table access

2024-06-18 Thread Zheyu Ma
Added bounds checking in the aspeed_gpio_read() and aspeed_gpio_write() functions to ensure the index idx is within the valid range of the reg_table array. The correct size of reg_table is determined dynamically based on whether it is aspeed_3_3v_gpios or aspeed_1_8v_gpios. If idx exceeds the size

[PATCH] hw/timer/hpet: Fix wrong HPET interrupts

2024-06-18 Thread TaiseiIto
Before this commit, there are 3 problems about HPET timer interrupts. First, HPET periodic timers cause a too early interrupt before HPET main counter value reaches a value written its comparator value register. Second, disabled HPET timers whose comparator value register is not 0x

Re: [PATCH] hw/virtio: Fix the de-initialization of vhost-user devices

2024-06-18 Thread Manos Pitsidianakis
On Tue, 18 Jun 2024 15:19, Thomas Huth wrote: The unrealize functions of the various vhost-user devices are calling the corresponding vhost_*_set_status() functions with a status of 0 to shut down the device correctly. Now these vhost_*_set_status() functions all follow this scheme: bool sh

[PATCH] hw/misc/stm32l4x5_rcc: Add validation for MCOPRE and MCOSEL values

2024-06-18 Thread Zheyu Ma
This commit adds validation checks for the MCOPRE and MCOSEL values in the rcc_update_cfgr_register function. If the MCOPRE value exceeds 0b100 or the MCOSEL value exceeds 0b111, an error is logged and the corresponding clock mux is disabled. This helps in identifying and handling invalid configura

[PATCH] hw/usb/hcd-dwc2: Handle invalid address access in read and write functions

2024-06-18 Thread Zheyu Ma
This commit modifies the dwc2_hsotg_read() and dwc2_hsotg_write() functions to handle invalid address access gracefully. Instead of using g_assert_not_reached(), which causes the program to abort, the functions now log an error message and return a default value for reads or do nothing for writes.

Re: [PATCH 3/3] semihosting: Restrict to TCG

2024-06-18 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > ping :) > > On 12/6/24 15:12, Philippe Mathieu-Daudé wrote: >> Hi Paolo, >> On 30/5/24 15:58, Philippe Mathieu-Daudé wrote: >>> On 30/5/24 09:31, Paolo Bonzini wrote: On Thu, May 30, 2024 at 9:22 AM Philippe Mathieu-Daudé wrote: > > On 30/5/24 0

Re: [PATCH 3/3] semihosting: Restrict to TCG

2024-06-18 Thread Philippe Mathieu-Daudé
On 18/6/24 15:56, Alex Bennée wrote: Philippe Mathieu-Daudé writes: ping :) On 12/6/24 15:12, Philippe Mathieu-Daudé wrote: Hi Paolo, On 30/5/24 15:58, Philippe Mathieu-Daudé wrote: On 30/5/24 09:31, Paolo Bonzini wrote: On Thu, May 30, 2024 at 9:22 AM Philippe Mathieu-Daudé wrote: On 3

Re: [PATCH] hw/usb/hcd-dwc2: Handle invalid address access in read and write functions

2024-06-18 Thread Philippe Mathieu-Daudé
Cc'ing Paul. On 18/6/24 15:56, Zheyu Ma wrote: This commit modifies the dwc2_hsotg_read() and dwc2_hsotg_write() functions to handle invalid address access gracefully. Instead of using g_assert_not_reached(), which causes the program to abort, the functions now log an error message and return a

Re: [PATCH v2 2/3] hw/usb: Introduce x-query-usbhost QMP command

2024-06-18 Thread Philippe Mathieu-Daudé
On 11/6/24 12:23, Philippe Mathieu-Daudé wrote: This is a counterpart to the HMP "info usbhost" command. It is being added with an "x-" prefix because this QMP command is intended as an adhoc debugging tool and will thus not be modelled in QAPI as fully structured data, nor will it have long term

Re: [PATCH 3/4] hw/m68k/virt: Add a pflash controller for BIOS firmware

2024-06-18 Thread Jiaxun Yang
在2024年6月18日六月 下午12:47,Philippe Mathieu-Daudé写道: > Hi Jiaxun, > > On 27/5/24 19:15, Jiaxun Yang wrote: >> Add a 8 MiB pflash controller for BIOS firmware, and boot >> from it if possible. >> >> Signed-off-by: Jiaxun Yang >> --- >> hw/m68k/Kconfig | 1 + >>

[PATCH] hw/timer/a9gtimer: Handle QTest mode in a9_gtimer_get_current_cpu

2024-06-18 Thread Zheyu Ma
This commit updates the a9_gtimer_get_current_cpu() function to handle cases where QTest is enabled. When QTest is used, it returns 0 instead of dereferencing the current_cpu, which can be NULL. This prevents the program from crashing during QTest runs. Reproducer: cat << EOF | qemu-system-aarch64

[PATCH] hw/misc: Fix invalid size assertions in exynos4210_rng read/write functions

2024-06-18 Thread Zheyu Ma
This commit updates the exynos4210_rng_read() and exynos4210_rng_write() functions to handle cases where the size is not 4 bytes. Instead of asserting, which causes the program to abort, the functions now log an error message and return a default value for reads or do nothing for writes when the si

Re: [PATCH] hw/timer/a9gtimer: Handle QTest mode in a9_gtimer_get_current_cpu

2024-06-18 Thread Philippe Mathieu-Daudé
On 18/6/24 16:40, Zheyu Ma wrote: This commit updates the a9_gtimer_get_current_cpu() function to handle cases where QTest is enabled. When QTest is used, it returns 0 instead of dereferencing the current_cpu, which can be NULL. This prevents the program from crashing during QTest runs. Reproduc

Re: [PATCH v2 0/2] target/s390x: Fix tracing header path in TCG mem_helper.c

2024-06-18 Thread Paolo Bonzini
On 6/13/24 12:44, Philippe Mathieu-Daudé wrote: In order to keep trace event headers local to their directory, introduce s390_skeys_get/s390_skeys_set helpers, fixing: In file included from ../../target/s390x/tcg/mem_helper.c:33: ../../target/s390x/tcg/trace.h:1:10: fatal error: 'trace/tr

Re: [PATCH v3 03/13] hw/riscv: add RISC-V IOMMU base emulation

2024-06-18 Thread Jason Chien
On 2024/6/18 下午 06:06, Jason Chien wrote: Hi Daniel, On 2024/5/24 上午 01:39, Daniel Henrique Barboza wrote: From: Tomasz Jeznach The RISC-V IOMMU specification is now ratified as-per the RISC-V international process. The latest frozen specifcation can be found at: https://github.com/riscv-n

Re: [RFC PATCH 27/34] accel/tcg: Make translate-all.c target independent

2024-06-18 Thread Richard Henderson
On 6/13/24 02:50, Anton Johansson wrote: On 24/01/24, Richard Henderson wrote: On 1/20/24 00:40, Anton Johansson wrote: Makes translate-all.c independent of softmmu target by switching TARGET_LONG_BITS-> target_long_bits() TARGET_INSN_START_WORDS -> tcg_ctx->insn_start_wor

[PATCH] block: m25p80: Fix heap-buffer-overflow in flash_erase function

2024-06-18 Thread Zheyu Ma
This patch fixes a heap-buffer-overflow issue in the flash_erase function of the m25p80 flash memory emulation. The overflow occurs when the combination of offset and length exceeds the allocated memory for the storage. The patch adds a check to ensure that the erase length does not exceed the stor

Re: [PATCH v2 2/3] hw/usb: Introduce x-query-usbhost QMP command

2024-06-18 Thread Philippe Mathieu-Daudé
On 18/6/24 16:15, Philippe Mathieu-Daudé wrote: On 11/6/24 12:23, Philippe Mathieu-Daudé wrote: This is a counterpart to the HMP "info usbhost" command. It is being added with an "x-" prefix because this QMP command is intended as an adhoc debugging tool and will thus not be modelled in QAPI as

Re: [PATCH] block: m25p80: Fix heap-buffer-overflow in flash_erase function

2024-06-18 Thread Philippe Mathieu-Daudé
Hi Zheyu, On 18/6/24 17:23, Zheyu Ma wrote: This patch fixes a heap-buffer-overflow issue in the flash_erase function of the m25p80 flash memory emulation. The overflow occurs when the combination of offset and length exceeds the allocated memory for the storage. The patch adds a check to ensure

[PATCH] adb: Fix assertion failure in adb_request() by blocking/unblocking autopoll

2024-06-18 Thread Zheyu Ma
This commit addresses an assertion failure in the adb_request() function. The failure occurs because the autopoll feature is not properly blocked/unblocked during an ADB request. By calling adb_autopoll_block() at the beginning and adb_autopoll_unblock() at the end of the adb_request() function, we

Re: [PATCH] hw/misc: Fix invalid size assertions in exynos4210_rng read/write functions

2024-06-18 Thread Philippe Mathieu-Daudé
On 18/6/24 16:50, Zheyu Ma wrote: This commit updates the exynos4210_rng_read() and exynos4210_rng_write() functions to handle cases where the size is not 4 bytes. Instead of asserting, which causes the program to abort, the functions now log an error message and return a default value for reads

Re: [PATCH] hw/usb/dev-mtp: Correctly report free space

2024-06-18 Thread Philippe Mathieu-Daudé
On 18/6/24 02:36, Fabio D'Urso wrote: In order to compute the amount of free space (in bytes), the number of available blocks (f_bavail) should be multiplied by the block size (f_frsize) instead of the total number of blocks (f_blocks). Signed-off-by: Fabio D'Urso --- hw/usb/dev-mtp.c | 2 +-

Re: [PATCH v4 1/5] ppc/pnv: Add SPI model

2024-06-18 Thread Cédric Le Goater
Hello Chalapathi, On 6/17/24 6:54 PM, Chalapathi V wrote: SPI controller device model supports a connection to a single SPI responder. This provide access to SPI seeproms, TPM, flash device and an ADC controller. All SPI function control is mapped into the SPI register space to enable full cont

[PULL v1 3/3] hw/net: Fix the transmission return size

2024-06-18 Thread Edgar E. Iglesias
From: "Fea.Wang" Fix the transmission return size because not all bytes could be transmitted successfully. So, return a successful length instead of a constant value. Signed-off-by: Fea.Wang Reviewed-by: Edgar E. Iglesias Reviewed-by: Frank Chang Signed-off-by: Edgar E. Iglesias --- hw/net/

  1   2   3   4   >