[PATCH v8 4/7] tests/qtest/migration: consolidate set capabilities

2025-03-18 Thread Prasad Pandit
From: Prasad Pandit Migration capabilities are set in multiple '.start_hook' functions for various tests. Instead, consolidate setting capabilities in 'migrate_start_set_capabilities()' function which is called from the 'migrate_start()' function. While simplifying the capabilities setting, it he

[PATCH v8 2/7] migration: Refactor channel discovery mechanism

2025-03-18 Thread Prasad Pandit
From: Prasad Pandit The various logical migration channels don't have a standardized way of advertising themselves and their connections may be seen out of order by the migration destination. When a new connection arrives, the incoming migration currently make use of heuristics to determine which

[PATCH v8 7/7] migration/ram: Implement save_postcopy_prepare()

2025-03-18 Thread Prasad Pandit
From: Peter Xu Implement save_postcopy_prepare(), preparing for the enablement of both multifd and postcopy. Please see the rich comment for the rationals. Signed-off-by: Peter Xu Signed-off-by: Prasad Pandit --- migration/ram.c | 37 + 1 file changed, 37

Re: [PATCH 2/2] hw/arm: ast27x0: Wire up EHCI controllers

2025-03-18 Thread Cédric Le Goater
On 3/17/25 07:59, Troy Lee wrote: AST27x0 has 4 EHCI controllers, where each CPU and I/O die has 2 instances. This patch use existing TYPE_PLATFORM_EHCI. After wiring up the EHCI controller, the ast2700a1-evb can find up to 4 USB EHCI interfaces. ehci-platform 12061000.usb: EHCI Host Controller

[PATCH v8 6/7] migration: Add save_postcopy_prepare() savevm handler

2025-03-18 Thread Prasad Pandit
From: Peter Xu Add a savevm handler for a module to opt-in sending extra sections right before postcopy starts, and before VM is stopped. RAM will start to use this new savevm handler in the next patch to do flush and sync for multifd pages. Note that we choose to do it before VM stopped becaus

[PATCH v3 04/15] rust/vmstate: Fix size field of VMStateField with VMS_ARRAY_OF_POINTER flag

2025-03-18 Thread Zhao Liu
The `size` field of the VMStateField with VMS_ARRAY_OF_POINTER flag should stores the size of pointer, which depends on platform. Currently, `*const`, `*mut`, `NonNull`, `Box<>` and their wrapper are supported, and they have the same size as `usize`. Store the size (of `usize`) when VMS_ARRAY_OF_

[PATCH for-10.1 07/32] vfio: Introduce a new header file for VFIOdisplay declarations

2025-03-18 Thread Cédric Le Goater
Gather all VFIOdisplay related declarations into "display.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". Signed-off-by: Cédric Le Goater --- hw/vfio/display.h | 41 +++ hw/vfio/pci.h | 1 + include/hw/vfio/vfio-com

[PATCH v3 07/15] rust/vmstate: Fix unnecessary VMState bound of with_varray_flag()

2025-03-18 Thread Zhao Liu
The VMState type bound is not used in with_varray_flag(). And for vmstate_struct, Rust cannot infer the type of `num` from the call_func_with_field(), so this causes the compiling error because it complains "cannot satisfy `_: VMState`" in with_varray_flag(). Note Rust can infer the type in vmsta

[PATCH v3 06/15] rust/vmstate: Fix "cannot infer type" error in vmstate_struct

2025-03-18 Thread Zhao Liu
Rust cannot infer the type (it should be VMStateField) after Zeroable::ZERO, which cause the compiling error. To fix this error, call with_varray_flag() after VMStateField's initialization. Signed-off-by: Zhao Liu --- rust/qemu-api/src/vmstate.rs | 16 +--- 1 file changed, 9 inserti

[PATCH v3 08/15] rust/vmstate: Relax array check when build varray in vmstate_struct

2025-03-18 Thread Zhao Liu
The varry of structure created by vmstate_struct is different with vmstate_of. This is because vmstate_struct uses the `vmsd` to traverse the vmstates of structure's fields, rather than treating the structure directly as a well-defined vmstate. Therefore, there's no need to check array flag when b

[PATCH v3 02/15] rust/vmstate: Fix num_offset in vmstate macros

2025-03-18 Thread Zhao Liu
`num_offset` is a member of `VMStateField`, and there's no need to use "." to access this field in a `VMStateField` instance. Signed-off-by: Zhao Liu --- rust/qemu-api/src/vmstate.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/qemu-api/src/vmstate.rs b/rust/qemu-

[PATCH v3 03/15] rust/vmstate: Fix num field when varray flags are set

2025-03-18 Thread Zhao Liu
Array type vmstate has the VMStateField with `num` equals its length. When the varray vmstate is built based a array type, the `num` field should be cleaned to 0, because varray uses `num_offset` instead of `num` to store elements number information. Signed-off-by: Zhao Liu --- rust/qemu-api/sr

Re: [PATCH v5 2/3] Skip NaN mode check for soft-float

2025-03-18 Thread Aleksandar Rakic
Thank you. Kind regards, Aleksandar Rakic

[PATCH 04/21] hw/arm/zynq-devcfg: Prevent unintended unlock during initialization

2025-03-18 Thread Corvin Köhne
From: YannickV During the emulation startup, all registers are reset, which triggers the `r_unlock_post_write` function with a value of 0. This led to an unintended memory access disable, making the devcfg unusable. To address this, a property 'is_initialized' is introduced. It is set to false d

Re: [PATCH v2 10/14] rust/vmstate: Support vmstate_validate

2025-03-18 Thread Paolo Bonzini
Il mar 18 mar 2025, 13:03 Zhao Liu ha scritto: > > /// This macro can be used (by just passing it a type) to forward the > `VMState` > > @@ -572,9 +548,9 @@ const fn phantom__(_: &T) -> > ::core::marker::PhantomData { > > } > > Some(test_cb_builder__::<$struct_n

[PATCH 11/21] hw/misc: Add Beckhoff CCAT device

2025-03-18 Thread Corvin Köhne
From: YannickV This adds the Beckhoff Communication Controller (CCAT). The information block, EEPROM interface and DMA controller are currently implemented. The EEPROM provides production information for Beckhoff Devices. An EEPORM binary must therefor be handed over. It should be aligned to a

[PATCH 21/21] MAINTAINERS: add myself as reviewer for Beckhoff devices

2025-03-18 Thread Corvin Köhne
From: Corvin Köhne I don't have commit privileges, so I can't merge any changes. However, someone from Beckhoff should review changes made to their board emulations. Signed-off-by: Corvin Köhne --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS

[PATCH 00/21] Hi,

2025-03-18 Thread Corvin Köhne
From: Corvin Köhne Beckhoff has build a board, called CX7200, based on the Xilinx Zynq A9 platform. This commit series adds the Beckhoff CX7200 as new board variant to QEMU. The emulation is able to successfully boot an CX7200 image. The image includes some self tests executed on every boot. Onl

[PATCH 10/21] hw/misc/zynq_slcr: Add logic for DCI configuration

2025-03-18 Thread Corvin Köhne
From: YannickV The registers for the digitally controlled impedance (DCI) clock are part of the system level control registers (SLCR). The DONE bit in the status register indicates a successfull DCI calibration. An description of the calibration process can be found here: https://docs.amd.com/r/e

[PATCH 13/21] hw/arm/beckhoff_CX7200: Remove second SD controller

2025-03-18 Thread Corvin Köhne
From: YannickV The CX7200 has one SD controller connected to address 0xE0101000. The controller connected to address 0xE010 can be removed. Signed-off-by: Yannick Voßen --- hw/arm/beckhoff_CX7200.c | 48 ++-- 1 file changed, 21 insertions(+), 27 deletion

[PATCH 08/21] hw/dma/zynq-devcfg: Fix register memory

2025-03-18 Thread Corvin Köhne
From: YannickV Registers are always 32 bit aligned. R_MAX is not the maximum register address, it is the maximum register number. The memory size can be determined by 4 * R_MAX. Currently every register with an offset bigger than 0x40 will be ignored, because the memory size is set wrong. This e

[PATCH 17/21] hw/arm/beckhoff_CX7200: Remove unimplemented devices

2025-03-18 Thread Corvin Köhne
From: YannickV Some unimplemented devices do not exist for the CX7200. All unimplemented devices have been removed for better overview and the fact that they are not necessary for a CX7200 emulation. Signed-off-by: Yannick Voßen --- hw/arm/beckhoff_CX7200.c | 69 ---

[PATCH 18/21] hw/arm/beckhoff_CX7200: Set CPU frequency and PERIPHCLK period

2025-03-18 Thread Corvin Köhne
From: YannickV The CPU frequency for the CX7200 is set to 720 MHz, with the peripheral clock running at half of the CPU frequency. That is why the PERIPHCLK_PERIOD is set to two. These values are forwarded to the A9 global timer, watchdog timer and MP Timer. Signed-off-by: Yannick Voßen --- hw

[PATCH v3 15/15] rust/vmstate: Include complete crate path of VMStateFlags in vmstate_clock

2025-03-18 Thread Zhao Liu
The use of "bindings::*" masks incomplete path of VMStateFlags. Include complete crate path of VMStateFlags in vmstate_clock, and clean up "bindings::*" in device_class.rs of pl011. Signed-off-by: Zhao Liu --- Changes since v2: * A new commit. --- rust/hw/char/pl011/src/device_class.rs | 8 +++

[PATCH 19/21] hw/arm/beckhoff_CX7200: Add CCAT to CX7200

2025-03-18 Thread Corvin Köhne
From: YannickV The Beckhoff CX7200 is based on the Xilinx Zynq-7000 SoC. It integrates the Beckhoff Communication Controller (CCAT), which is implemented as an FPGA within the Zynq's programmable logic (PL). This commit adds the CCAT as an MMIO device to the CX7200 machine in QEMU, enabling its

Re: [PULL 14/24] hw/uefi: add var-service-json.c + qapi for NV vars.

2025-03-18 Thread Peter Maydell
On Tue, 4 Mar 2025 at 12:49, Gerd Hoffmann wrote: > > Define qapi schema for the uefi variable store state. > > Use it and the generated visitor helper functions to store persistent > (EFI_VARIABLE_NON_VOLATILE) variables in JSON format on disk. > > Acked-by: Markus Armbruster > Signed-off-by: Ge

Re: [PATCH] hvf: arm: Emulate ICC_RPR_EL1 accesses properly

2025-03-18 Thread Peter Maydell
On Sat, 15 Mar 2025 at 13:21, Zenghui Yu wrote: > > Commit a2260983c655 ("hvf: arm: Add support for GICv3") added GICv3 support > by implementing emulation for a few system registers. ICC_RPR_EL1 was > defined but not plugged in the sysreg handlers (for no good reason). > > Fix it. > > Signed-off-

[PATCH v8 5/7] tests/qtest/migration: add postcopy tests with multifd

2025-03-18 Thread Prasad Pandit
From: Prasad Pandit Add new qtests to run postcopy migration with multifd channels enabled. Signed-off-by: Prasad Pandit --- tests/qtest/migration/compression-tests.c | 16 tests/qtest/migration/postcopy-tests.c| 27 + tests/qtest/migration/precopy-tests.c | 19 +++

Re: [PATCH] hw/arm: Add missing psci_conduit to NPCM8XX SoC boot info

2025-03-18 Thread Peter Maydell
On Sat, 15 Mar 2025 at 14:20, Guenter Roeck wrote: > > Without psci_conduit, the Linux kernel crashes almost immediately. > > psci: probing for conduit method from DT. > Internal error: Oops - Undefined instruction: 0200 [#1] > PREEMPT SMP > > Fixes: ae0c4d1a1290 ("hw/arm: Add

Re: [PULL 10/10] crypto: Introduce x509 utils

2025-03-18 Thread Dorjoy Chowdhury
On Tue, Mar 18, 2025 at 10:44 PM Peter Maydell wrote: > > On Mon, 9 Sept 2024 at 15:21, Daniel P. Berrangé wrote: > > > > From: Dorjoy Chowdhury > > > > An utility function for getting fingerprint from X.509 certificate > > has been introduced. Implementation only provided using gnutls. > > Hi;

[PATCH 01/13] exec/cpu-all: restrict BSWAP_NEEDED to target specific code

2025-03-18 Thread Pierrick Bouvier
This identifier is already poisoned, so it can't be used from common code anyway. Signed-off-by: Pierrick Bouvier --- include/exec/cpu-all.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 902ca1f3c7b..6dd71eb0de9 10

Re: [PATCH v2] microvm: do not use the lastest cpu version

2025-03-18 Thread Paolo Bonzini
On 2/20/25 07:53, Ani Sinha wrote: commit 0788a56bd1ae3 ("i386: Make unversioned CPU models be aliases") introduced 'default_cpu_version' for PCMachineClass. This created three categories of CPU models: - Most unversioned CPU models would use version 1 by default. - For machines 4.0.1 and old

[PATCH v3 13/15] rust/vmstate: Add unit test for pointer case

2025-03-18 Thread Zhao Liu
Add a unit test to cover some patterns accepted by vmstate_of macro, which correspond to the following C version macros: * VMSTATE_POINTER * VMSTATE_ARRAY_OF_POINTER Note: Currently, vmstate_struct can't handle the pointer to structure case. Leave this case as a FIXME and use vmstate_unused as a

Re: [PATCH v2 10/14] rust/vmstate: Support vmstate_validate

2025-03-18 Thread Zhao Liu
On Tue, Mar 18, 2025 at 01:32:03PM +0100, Paolo Bonzini wrote: > Date: Tue, 18 Mar 2025 13:32:03 +0100 > From: Paolo Bonzini > Subject: Re: [PATCH v2 10/14] rust/vmstate: Support vmstate_validate > > Il mar 18 mar 2025, 13:03 Zhao Liu ha scritto: > > > > /// This macro can be used (by just pas

Issue with copy-before-write snapshot

2025-03-18 Thread Prashant Patil
Hello All, Hope this email finds you well. We are currently exploring the copy-before-write snapshot operation through series of steps mentioned here - https://www.mail-archive.com/qemu-devel@nongnu.org/msg876056.html We are not able to run 'blockdev-replace' command, it fails with below error:

[PATCH v3 01/15] rust/vmstate: Remove unnecessary unsafe

2025-03-18 Thread Zhao Liu
Remove the `unsafe` block of vmsd, because vmsd (passed to vmstate_struct) is defined in Rust side now, and it doesn't need `unsafe`. Signed-off-by: Zhao Liu --- rust/qemu-api/src/vmstate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/qemu-api/src/vmstate.rs b/rust/q

[PATCH 3/3] scripts: render_block_graph: Avoid backtrace on error from virsh

2025-03-18 Thread Peter Krempa
From: Peter Krempa An error from virsh spews also backtrace: $ ./scripts/render_block_graph.py --vm doesnotexist error: failed to get domain 'doesnotexist' Traceback (most recent call last): File "/home/pipo/git/qemu.git/./scripts/render_block_graph.py", line 152, in render_blo

[PATCH 2/3] scripts: render_block_graph: Implement proper argument parser

2025-03-18 Thread Peter Krempa
From: Peter Krempa As no argument parsing is employed the script is hard to use and when running without arguments it blurbs: $ ./scripts/render_block_graph.py Traceback (most recent call last): File "/home/pipo/git/qemu.git/./scripts/render_block_graph.py", line 135, in obj = sys.ar

Re: [PATCH] rust: pl011: Cut down amount of text quoted from PL011 TRM

2025-03-18 Thread Peter Maydell
On Mon, 17 Mar 2025 at 18:59, Daniel P. Berrangé wrote: > > On Mon, Mar 17, 2025 at 05:32:39PM +, Peter Maydell wrote: > > Currently the comments in the Rust pl011 register.rs file include > > large amounts of text from the PL011 TRM. This is much more > > commentary than we typically quote f

Re: [PATCH v2 1/2] hw/arm/fsl-imx8mp: Derive struct FslImx8mpState from TYPE_SYS_BUS_DEVICE

2025-03-18 Thread Peter Maydell
On Fri, 14 Mar 2025 at 18:32, Bernhard Beschow wrote: > > Deriving from TYPE_SYS_BUS_DEVICE fixes the SoC object to be reset upon > machine > reset. It also makes the SoC implementation not user-creatable which can > trigger > the following crash: > > $ ./qemu-system-aarch64 -M virt -device f

Re: [PATCH v2 1/2] hw/arm/fsl-imx8mp: Derive struct FslImx8mpState from TYPE_SYS_BUS_DEVICE

2025-03-18 Thread Peter Maydell
On Tue, 18 Mar 2025 at 15:27, Peter Maydell wrote: > > On Fri, 14 Mar 2025 at 18:32, Bernhard Beschow wrote: > > > > Deriving from TYPE_SYS_BUS_DEVICE fixes the SoC object to be reset upon > > machine > > reset. It also makes the SoC implementation not user-creatable which can > > trigger > > t

Re: Building QEMU as a Shared Library

2025-03-18 Thread Saanjh Sengupta
Hi, Unable to view this. Any GitHub repository diff page I could view for the same? Regards Saanjh Sengupta From: Alex Bennée Sent: Tuesday, March 18, 2025 1:48:01 PM To: Saanjh Sengupta Cc: Pierrick Bouvier ; Philippe Mathieu-Daudé ; Paolo Bonzini ; Marc-And

[PATCH v2 13/14] rust/vmstate: Add unit test for pointer case

2025-03-18 Thread Zhao Liu
Add a unit test to cover some patterns accepted by vmstate_of macro, which correspond to the following C version macros: * VMSTATE_POINTER * VMSTATE_ARRAY_OF_POINTER Note: Currently, vmstate_struct can't handle the pointer to structure case. Leave this case as a FIXME and use vmstate_unused as a

[PATCH for-10.1 00/32] vfio: Spring cleanup

2025-03-18 Thread Cédric Le Goater
Hello, Several large extensions were merged in VFIO recently: migration support with dirty tracking, support for different host IOMMU backend devices, multifd support, etc. This adds up to the previous extensions: vfio-platform, AP, CCW. The result is that VFIO is now a subsystem of over +16,000 l

[PATCH for-10.1 13/32] vfio: Move VFIOAddressSpace helpers into container-base.c

2025-03-18 Thread Cédric Le Goater
VFIOAddressSpace is a common object used by VFIOContainerBase which is declared in "hw/vfio/vfio-container-base.h". Move the VFIOAddressSpace related services into "container-base.c". While at it, rename : vfio_get_address_space -> vfio_address_space_get vfio_put_address_space -> vfio_address

[PATCH for-10.1 15/32] vfio: Introduce a new header file for helper services

2025-03-18 Thread Cédric Le Goater
Gather all helper routine declarations into "helpers.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". Signed-off-by: Cédric Le Goater --- hw/vfio/helpers.h | 26 ++ include/hw/vfio/vfio-common.h | 7 --- hw/s390x/s390-pci-vfio.c |

[PATCH for-10.1 02/32] vfio: Rename vfio_reset_bytes_transferred()

2025-03-18 Thread Cédric Le Goater
Enforce a 'vfio_mig_' prefix for the VFIO migration API to better reflect the namespace these routines belong to. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 +- hw/vfio/migration.c | 2 +- migration/target.c| 2 +- 3 files changed, 3 insertions(+)

[PATCH for-10.1 28/32] vfio: Make vfio_devices_query_dirty_bitmap() static

2025-03-18 Thread Cédric Le Goater
vfio_devices_query_dirty_bitmap() is only used in "dirty-tracking.c". Signed-off-by: Cédric Le Goater --- hw/vfio/dirty-tracking.h | 3 --- hw/vfio/dirty-tracking.c | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/vfio/dirty-tracking.h b/hw/vfio/dirty-tracking.h index 4b

[PATCH for-10.1 10/32] vfio: Introduce new files for VFIORegion definitions and declarations

2025-03-18 Thread Cédric Le Goater
Gather all VFIORegion related declarations and definitions into their own files to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". These declarations are made available externally (for "sysbus-fdt.c"). This is for 'vfio-platform' devices which have been deprecated and will be removed

[PATCH for-10.1 17/32] vfio: Move vfio_kvm_device_add/del_fd() to helpers.c

2025-03-18 Thread Cédric Le Goater
vfio_kvm_device_add/del_fd() are low level routines. Move them with the other helpers. Signed-off-by: Cédric Le Goater --- hw/vfio/helpers.h | 3 ++ include/hw/vfio/vfio-common.h | 3 -- hw/vfio/common.c | 58 -- hw/vfio/helpers.c

[PATCH for-10.1 04/32] vfio: Make vfio_un/block_multiple_devices_migration() static

2025-03-18 Thread Cédric Le Goater
Both of these routines are only used in file "migration.c". Move them there. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 -- hw/vfio/common.c | 62 --- hw/vfio/migration.c | 62 +++

[PATCH for-10.1 16/32] vfio: Move vfio_get_info_dma_avail() into helpers.c

2025-03-18 Thread Cédric Le Goater
vfio_get_info_dma_avail() is a low level routine similar to the other routines extracting capabilities from 'struct vfio_iommu_type1_info'. It belongs to file "helpers.c". Signed-off-by: Cédric Le Goater --- hw/vfio/helpers.h | 5 - include/hw/vfio/vfio-common.h | 2 -- hw/vfio

[PATCH for-10.1 29/32] vfio: Rename VFIOContainer related services

2025-03-18 Thread Cédric Le Goater
Rename these routines : vfio_put_group -> vfio_group_put vfio_get_group -> vfio_group_get vfio_kvm_device_del_group -> vfio_group_del_kvm_device vfio_kvm_device_add_group -> vfio_group_add_kvm_device vfio_get_device -> vfio_device_get vfio_put_base_device -> vfio_device_put vfio_devi

[PATCH for-10.1 24/32] vfio: Introduce new files for dirty tracking definitions and declarations

2025-03-18 Thread Cédric Le Goater
File "common.c" has been emptied of most of its definitions by the previous changes and the only definitions left are related to dirty tracking. Rename it to "dirty-tracking.c" and introduce its associated "dirty-tracking.h" header file for the declarations. Cleanup a little the includes while at

[PATCH for-10.1 21/32] vfio: Move vfio_kvm_device_fd() into helpers.c

2025-03-18 Thread Cédric Le Goater
The vfio_kvm_device_add/del_fd() routines opening the VFIO pseudo device are defined in "helpers.c". Move 'vfio_kvm_device_fd' definition there and its declaration into "helpers.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". Signed-off-by: Cédric Le Goater --- hw/vfio/helper

[PATCH for-10.1 08/32] vfio: Move VFIOHostDMAWindow definition into spapr.c

2025-03-18 Thread Cédric Le Goater
VFIOHostDMAWindow is only used in file "spapr.c". Move it there. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 7 --- hw/vfio/spapr.c | 7 +++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfi

Re: Generic way to detect qemu linux-user emulation

2025-03-18 Thread Andreas Schwab
On Mär 18 2025, Daniel P. Berrangé wrote: > That would get the synchronization behaviour of Linux vfork, > but I'm not sure it'd get the performance benefits (of avoiding > page table copying) which is what Andreas mentioned as the > desired thing ? For an emulation performance isn't a thing, wh

[PATCH for-10.1 23/32] vfio: Move vfio_de/attach_device() into device.c

2025-03-18 Thread Cédric Le Goater
These routines are VFIODevice related. Move their definitions into "device.c". Signed-off-by: Cédric Le Goater --- hw/vfio/common.c | 37 - hw/vfio/device.c | 37 + 2 files changed, 37 insertions(+), 37 deletions(-) diff --

[PATCH v2 10/14] rust/vmstate: Support vmstate_validate

2025-03-18 Thread Zhao Liu
In C version, VMSTATE_VALIDATE accepts the function pointer, which is used to check if some conditions of structure could meet, although the C version macro doesn't accept any structure as the opaque type. But it's hard to integrate VMSTATE_VALIDAE into vmstate_struct, a new macro has to be introd

Re: Building QEMU as a Shared Library

2025-03-18 Thread Alex Bennée
Saanjh Sengupta writes: > Hi Alex, > > You mentioned about a patch series; do you have it handy with you? Message-Id: <20241022105614.839199-18-alex.ben...@linaro.org> Date: Tue, 22 Oct 2024 11:56:11 +0100 Subject: [PATCH v2 17/20] plugins: add ability to register a GDB triggered callba

[PATCH v2 14/14] rust/vmstate: Add unit test for vmstate_validate

2025-03-18 Thread Zhao Liu
Add a unit test for vmstate_validate, which corresponds to the C version macro: VMSTATE_VALIDATE. Signed-off-by: Zhao Liu --- rust/qemu-api/tests/vmstate_tests.rs | 91 +++- 1 file changed, 89 insertions(+), 2 deletions(-) diff --git a/rust/qemu-api/tests/vmstate_tests.r

[PATCH v2 04/14] rust/vmstate: Fix size field of VMStateField with VMS_ARRAY_OF_POINTER flag

2025-03-18 Thread Zhao Liu
The `size` field of the VMStateField with VMS_ARRAY_OF_POINTER flag should stores the size of pointer, which depends on platform. Currently, `*const`, `*mut`, `NonNull`, `Box<>` and their wrapper are supported, and they have the same size as `usize`. Store the size (of `usize`) when VMS_ARRAY_OF_

[PATCH v2 02/14] rust/vmstate: Fix num_offset in vmstate macros

2025-03-18 Thread Zhao Liu
`num_offset` is a member of `VMStateField`, and there's no need to use "." to access this field in a `VMStateField` instance. Signed-off-by: Zhao Liu --- rust/qemu-api/src/vmstate.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/qemu-api/src/vmstate.rs b/rust/qemu-

Re: [PATCH] docs/system: Use the meson binary from the pyvenv

2025-03-18 Thread Akihiko Odaki
On 2025/03/18 14:54, Thomas Huth wrote: From: Thomas Huth To avoid problems with the meson installation from the host system, we should always use the meson from our venv instead. Thus use this in the documentation, too. While we're at it, also mention that it has to be run from the build fold

Re: [PATCH v6] hw/misc/vmfwupdate: Introduce hypervisor fw-cfg interface support

2025-03-18 Thread Gerd Hoffman
Hi, > > (1) How we are going to load kernel + initrd in case the firmware is > > igvm? Just update the igvm to also include linux kernel and > > initrd (see parallel reply from Jörg)? If so, how does the > > launched firmware find the kernel + initrd? > > While diggin

Re: [RFC v2 0/5] accel/kvm: Support KVM PMU filter

2025-03-18 Thread Shaoqin Huang
Hi Zhao, Thanks for your effort to respin the PMU Filter series. I tried your series on ARM64, but it reports error at compile time, here is the error output: qapi/kvm.json:59:Unexpected indentation. While I compiled it on x86, everything is ok. Could you please check why it failed on ARM64

Re: [PATCH 11/13] target/arm/cpu: remove inline stubs for aarch32 emulation

2025-03-18 Thread Philippe Mathieu-Daudé
On 18/3/25 05:51, Pierrick Bouvier wrote: Directly condition associated calls in target/arm/helper.c for now. Signed-off-by: Pierrick Bouvier --- target/arm/cpu.h| 8 target/arm/helper.c | 6 ++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/target/arm/cpu.h

Re: [PATCH] tests/functional/test_x86_64_kvm_xen: Remove avocado tags

2025-03-18 Thread Daniel P . Berrangé
On Tue, Mar 18, 2025 at 06:15:30PM +0100, Thomas Huth wrote: > From: Thomas Huth > > They have been forgotten to be removed when converting the > test to the functional framework. Since they are of no use > anymore, let's remove them now. > > Signed-off-by: Thomas Huth > --- > tests/functional

Re: [PATCH 11/13] target/arm/cpu: remove inline stubs for aarch32 emulation

2025-03-18 Thread Peter Maydell
On Tue, 18 Mar 2025 at 17:42, Philippe Mathieu-Daudé wrote: > > On 18/3/25 05:51, Pierrick Bouvier wrote: > > Directly condition associated calls in target/arm/helper.c for now. > > > > Signed-off-by: Pierrick Bouvier > > --- > > target/arm/cpu.h| 8 > > target/arm/helper.c | 6 ++

Re: [PATCH 11/13] target/arm/cpu: remove inline stubs for aarch32 emulation

2025-03-18 Thread Peter Maydell
On Tue, 18 Mar 2025 at 17:52, Pierrick Bouvier wrote: > > On 3/18/25 10:50, Peter Maydell wrote: > > On Tue, 18 Mar 2025 at 17:42, Philippe Mathieu-Daudé > > wrote: > >> > >> On 18/3/25 05:51, Pierrick Bouvier wrote: > >>> Directly condition associated calls in target/arm/helper.c for now. > >>>

Re: [RFC PATCH v2 03/20] hw/arm/smmuv3-accel: Add initial infrastructure for smmuv3-accel device

2025-03-18 Thread Eric Auger
Hi, On 3/17/25 9:19 PM, Nicolin Chen wrote: > On Mon, Mar 17, 2025 at 04:24:53PM -0300, Jason Gunthorpe wrote: >> On Mon, Mar 17, 2025 at 12:10:19PM -0700, Nicolin Chen wrote: >>> Another question: how does an emulated device work with a vSMMUv3? >>> I could imagine that all the accel steps would

Re: [PATCH 11/13] target/arm/cpu: remove inline stubs for aarch32 emulation

2025-03-18 Thread Pierrick Bouvier
On 3/18/25 11:06, Peter Maydell wrote: On Tue, 18 Mar 2025 at 17:52, Pierrick Bouvier wrote: On 3/18/25 10:50, Peter Maydell wrote: On Tue, 18 Mar 2025 at 17:42, Philippe Mathieu-Daudé wrote: On 18/3/25 05:51, Pierrick Bouvier wrote: Directly condition associated calls in target/arm/helpe

Re: [PATCH 07/13] target/arm/cpu: always define kvm related registers

2025-03-18 Thread Philippe Mathieu-Daudé
On 18/3/25 05:51, Pierrick Bouvier wrote: This does not hurt, even if they are not used. I'm not convinced by the rationale. Signed-off-by: Pierrick Bouvier --- target/arm/cpu.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 23c2293f7d1..96

Re: [PATCH 11/13] target/arm/cpu: remove inline stubs for aarch32 emulation

2025-03-18 Thread Pierrick Bouvier
On 3/18/25 10:42, Philippe Mathieu-Daudé wrote: On 18/3/25 05:51, Pierrick Bouvier wrote: Directly condition associated calls in target/arm/helper.c for now. Signed-off-by: Pierrick Bouvier --- target/arm/cpu.h| 8 target/arm/helper.c | 6 ++ 2 files changed, 6 insertio

RE: [PATCH 05/39] target/hexagon: Implement modify SSR

2025-03-18 Thread Sid Manning
> -Original Message- > From: ltaylorsimp...@gmail.com > Sent: Monday, March 17, 2025 12:37 PM > To: 'Brian Cain' ; qemu-devel@nongnu.org > Cc: richard.hender...@linaro.org; phi...@linaro.org; Matheus Bernardino > (QUIC) ; a...@rev.ng; a...@rev.ng; Marco > Liebel (QUIC) ; alex.ben...@lina

Re: [PATCH v2 03/42] accel/tcg: Fix cpu_ld*_code_mmu for user mode

2025-03-18 Thread Pierrick Bouvier
On 3/18/25 14:31, Richard Henderson wrote: These routines are buggy in multiple ways: - Use of target-endian loads, then a bswap that depends on the host endiannness. The code is very similar to do_ld*_mmu functions, so it's subtle to notice. Was the endianness bug due to the fact we u

[PATCH v2 15/42] include/exec: Split out mmap-lock.h

2025-03-18 Thread Richard Henderson
Split out mmap_lock, et al from page-protection.h to a new header. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- accel/tcg/internal-target.h| 1 + include/exec/mmap-lock.h | 33 + include/exec/page-protection.h | 22 ---

Re: [PATCH 2/3] scripts: render_block_graph: Implement proper argument parser

2025-03-18 Thread Pavel Hrdina
On Tue, Mar 18, 2025 at 05:36:03PM +0100, Peter Krempa wrote: > From: Peter Krempa > > As no argument parsing is employed the script is hard to use and when > running without arguments it blurbs: > > $ ./scripts/render_block_graph.py > Traceback (most recent call last): >File "/home/pipo/g

Re: [RFC PATCH v2 16/20] hw/arm/smmuv3-accel: Read host SMMUv3 device info

2025-03-18 Thread Donald Dutile
Shameer, Hey, On 3/11/25 10:10 AM, Shameer Kolothum wrote: From: Nicolin Chen Read the underlying SMMUv3 device info and set corresponding IDR bits. We need at least one cold-plugged vfio-pci dev associated with the smmuv3-accel instance to do this now.  Hence fail if it is not available. T

[PATCH v3 05/15] rust/vmstate: Fix type check for varray in vmstate_struct

2025-03-18 Thread Zhao Liu
When pass a varray to vmstate_struct, the `type` parameter should be the type of the element in the varray, for example: vmstate_struct!(HPETState, timers, [0 .. num_timers], VMSTATE_HPET_TIMER, BqlRefCell).with_version_id(0) But this breaks current type check, because it checks t

Re: [PATCH 5/5] hw/intc/loongarch_pch: Replace legacy reset callback with new api

2025-03-18 Thread gaosong
在 2025/3/7 下午3:13, Bibo Mao 写道: Replace legacy reset callback register device_class_set_legacy_reset() with new function resettable_class_set_parent_phases(). With new API, it will call reset callback of parent object. The internal state has been cleared in parent object LOONGARCH_PIC_COMMON, he

[PATCH v1 2/2] hw/riscv: initial support for BOSC's Xiangshan Kunminghu SoC

2025-03-18 Thread Huang Borong
This implementation provides emulation for the Xiangshan Kunminghu SoC, including support for UART, CLINT, IMSIC, and APLIC devices. More details can be found at https://github.com/OpenXiangShan/XiangShan Please note the following parameters when running the Xiangshan Kunminghu machine: 1.`-m`: C

Re: [RFC PATCH v2 18/20] hw/arm/smmu-common: Bypass emulated IOTLB for a accel SMMUv3

2025-03-18 Thread Donald Dutile
On 3/11/25 10:10 AM, Shameer Kolothum wrote: From: Nicolin Chen If a vSMMU is configured as a accelerated one, HW IOTLB will be used and all cache invalidation should be done to the HW IOTLB too, v.s. the emulated iotlb. In this case, an iommu notifier isn't registered, as the devices behind

Re: [PATCH 2/5] hw/intc/loongarch_extioi: Add reset support

2025-03-18 Thread gaosong
在 2025/3/7 下午3:13, Bibo Mao 写道: Add reset support with extioi irqchip, and register reset callback support with new API resettable_class_set_parent_phases(). Clear internal HW registers and SW state when virt machine resets. Signed-off-by: Bibo Mao --- hw/intc/loongarch_extioi_common.c

Re: [PATCH 3/5] hw/intc/loongarch_extioi: Replace legacy reset callback with new api

2025-03-18 Thread gaosong
在 2025/3/7 下午3:13, Bibo Mao 写道: Replace legacy reset callback register device_class_set_legacy_reset() with new function resettable_class_set_parent_phases(). With new API, it will call reset callback of parent object and then itself. Signed-off-by: Bibo Mao --- hw/intc/loongarch_extioi.c

Re: [PATCH 4/5] hw/intc/loongarch_pch: Add reset support

2025-03-18 Thread gaosong
在 2025/3/7 下午3:13, Bibo Mao 写道: Add reset support with LoongArch pci irqchip, and register reset callback support with new API resettable_class_set_parent_phases(). Clear internal HW registers and SW state when virt machine resets. Signed-off-by: Bibo Mao --- hw/intc/loongarch_pic_common.c

Re: [PATCH 1/5] hw/intc/loongarch_ipi: Add reset support

2025-03-18 Thread gaosong
在 2025/3/7 下午3:13, Bibo Mao 写道: Add reset support with ipi object, register reset callback and clear internal registers when virt machine resets. Signed-off-by: Bibo Mao --- hw/intc/loongarch_ipi.c | 29 + include/hw/intc/loongarch_ipi.h | 1 + 2 files c

[PATCH v2 34/42] include/hw/core: Drop ifndef CONFIG_USER_ONLY from cpu.h

2025-03-18 Thread Richard Henderson
We were hiding a number of declarations from user-only, although it hurts nothing to allow them. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- include/hw/core/cpu.h | 10 -- 1 file changed, 10 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h

Re: [PATCH 04/13] exec/cpu-all: allow to include specific cpu

2025-03-18 Thread Richard Henderson
On 3/17/25 21:51, Pierrick Bouvier wrote: Including "cpu.h" from code that is not compiled per target is ambiguous by definition. Thus we introduce a conditional include, to allow every architecture to set this, to point to the correct definition. hw/X or target/X will now include directly "targ

[PATCH v4 2/4] hw/loongarch/virt: Remove unnecessary NULL pointer

2025-03-18 Thread Bibo Mao
There is NULL pointer checking function error_propagate() already, it is not necessary to add checking for function parameter. Here remove NULL pointer checking with function parameter. Since function will return directly when there is error report, this patch removes combination about error_setg(

Re: Generic way to detect qemu linux-user emulation

2025-03-18 Thread Daniel P . Berrangé
On Tue, Mar 18, 2025 at 05:08:52PM +, Peter Maydell wrote: > On Tue, 18 Mar 2025 at 15:04, Peter Maydell wrote: > > More generally, AIUI glibc expects that it has control over what's > > happening with threads, so it can set up its own data structures > > for the new thread (e.g. for TLS varia

[PATCH] tests/functional/test_x86_64_kvm_xen: Remove avocado tags

2025-03-18 Thread Thomas Huth
From: Thomas Huth They have been forgotten to be removed when converting the test to the functional framework. Since they are of no use anymore, let's remove them now. Signed-off-by: Thomas Huth --- tests/functional/test_x86_64_kvm_xen.py | 28 - 1 file changed, 28 dele

[PATCH v2 01/42] accel/tcg: Build user-exec-stub.c once

2025-03-18 Thread Richard Henderson
CONFIG_USER_ONLY == !CONFIG_SYSTEM_ONLY. Therefore it's cleaner to just add to user_ss. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- accel/tcg/meson.build | 5 - 1 file changed, 4 insertions(+), 1 deletion(

Re: [PATCH 01/13] exec/cpu-all: restrict BSWAP_NEEDED to target specific code

2025-03-18 Thread Richard Henderson
On 3/17/25 21:51, Pierrick Bouvier wrote: This identifier is already poisoned, so it can't be used from common code anyway. Signed-off-by: Pierrick Bouvier --- include/exec/cpu-all.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) I'll give you a Reviewed-by: Richard Henderson

Re: [PATCH 09/13] target/arm/cpu: define ARM_MAX_VQ once for aarch32 and aarch64

2025-03-18 Thread Pierrick Bouvier
On 3/18/25 11:50, Philippe Mathieu-Daudé wrote: On 18/3/25 05:51, Pierrick Bouvier wrote: This will affect zregs field for aarch32. This field is used for MVE and SVE implementations. MVE implementation is clipping index value to 0 or 1 for zregs[*].d[], so we should not touch the rest of data i

Re: [RFC PATCH v2 13/20] hw/arm/smmuv3-accel: Introduce helpers to batch and issue cache invalidations

2025-03-18 Thread Donald Dutile
Shameer, Hi, On 3/11/25 10:10 AM, Shameer Kolothum wrote: From: Nicolin Chen Inroduce an SMMUCommandBatch and some helpers to batch and issue the Introduce commands. Currently separate out TLBI commands and device cache commands to avoid some errata on certain versions of SMMUs

Re: [PATCH 0/1 v3] [RISC-V/RVV] optimize the memory probing for vector fault-only-first loads.

2025-03-18 Thread Alistair Francis
On Thu, Mar 13, 2025 at 5:23 AM Paolo Savini wrote: > > Adding reviewer information to the patch and rebasing on top of master. > > Previous versions: > > - v1: > https://lore.kernel.org/all/20250129144435.82451-1-paolo.sav...@embecosm.com/ > - v2: > https://lore.kernel.org/all/20250221155320.59

Re: [PATCH v2 41/42] target/riscv: Remove ifndef CONFIG_USER_ONLY from cpu_cfg.h

2025-03-18 Thread Alistair Francis
On Wed, Mar 19, 2025 at 7:39 AM Richard Henderson wrote: > > While RISCVCPUConfig.satp_mode is unused for user-only, > this header is used from disas/riscv.h, whose users are > only built once. The savings of 4 bytes isn't worth it. > > Reviewed-by: Pierrick Bouvier > Signed-off-by: Richard Hend

Re: [PATCH 2/7] target/riscv: env->misa_mxl is a constant

2025-03-18 Thread Alistair Francis
On Tue, Mar 11, 2025 at 4:18 PM Paolo Bonzini wrote: > > > > Il lun 10 mar 2025, 23:18 Alistair Francis ha scritto: >> >> On Tue, Mar 11, 2025 at 3:34 AM Paolo Bonzini wrote: >> > >> > On Fri, Mar 7, 2025 at 1:45 AM Alistair Francis >> > wrote: >> > > I'm not convinced that this is the thing t

Re: [RFC PATCH v2 03/20] hw/arm/smmuv3-accel: Add initial infrastructure for smmuv3-accel device

2025-03-18 Thread Jason Gunthorpe
On Tue, Mar 18, 2025 at 05:22:51PM -0400, Donald Dutile wrote: > I agree with Eric that 'accel' isn't needed -- this should be > ascertained from the pSMMU that a physical device is attached to. I seem to remember the point was made that we don't actually know if accel is possible, or desired, es

<    1   2   3   4   >