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

2025-03-18 Thread Paolo Bonzini
On 3/18/25 09:32, Zhao Liu wrote: 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_

[PATCH] qcow2: fix null pointer dereference in crypto block

2025-03-18 Thread gerben
You can reproduce this issue by running ./qemu-img info segv. The segv file used for reproduction can be found here: https://github.com/Gerben100/reproduce_qemu-img_error

[PATCH] docs/devel/testing/functional: Add a section about logging

2025-03-18 Thread Thomas Huth
From: Thomas Huth We should tell the users where to find the log file. While we're at it, also rename the "Overview" heading to a more accurate "Introduction to writing tests" instead. Reported-by: Aditya Gupta Signed-off-by: Thomas Huth --- docs/devel/testing/functional.rst | 22

[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 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 01/21] hw/timer: Make frequency configurable

2025-03-18 Thread Corvin Köhne
From: YannickV The a9 global timer and arm mp timers rely on the PERIPHCLK as their clock source. The current implementation does not take that into account. That causes problems for applications assuming other frequencies than 1 GHz. We can now configure frequencies for the a9 global timer and

[PATCH 02/21] hw/timer: Make PERIPHCLK period configurable

2025-03-18 Thread Corvin Köhne
From: YannickV The a9 global timer and arm mp timer rely on the PERIPHCLK as their clock source. The period of PERIPHCLK (denoted as N) must be a multiple of the core CLK period, with N being equal to or greater than two. However, the current implementation does not take the PERIPHCLK period into

[PATCH 06/21] hw/dma/zynq-devcfg: Simulate dummy PL reset

2025-03-18 Thread Corvin Köhne
From: YannickV Setting PCFG_PROG_B should reset the PL. After a reset PCFG_INIT should indicate that the reset is finished successfully. In order to add a MMIO-Device as part of the PL in the Zynq, the reset logic must succeed. The PCFG_INIT flag is now set when the PL reset is triggered by PCFG

[PATCH 03/21] hw/dma/zynq-devcfg: Handle bitstream loading via DMA to 0xffffffff

2025-03-18 Thread Corvin Köhne
From: YannickV A DMA transfer to destination address `0x` should trigger a bitstream load via the PCAP interface. Currently, this case is not intercepted, causing loaders to enter an infinite loop when polling the status register. This commit adds a check for `0x` as the destinat

[PATCH 05/21] hw/dma/zynq: Notify devcfg on FPGA reset via SLCR control

2025-03-18 Thread Corvin Köhne
From: YannickV When the FPGA_RST_CTRL register in the SLCR (System Level Control Register) is written to, the devcfg (Device Configuration) should indicate the finished reset. Problems occure when Loaders trigger a reset via SLCR and poll for the done flag in devcfg. Since the flag will never be

[PATCH 1/2] target/riscv: Restrict mideleg/medeleg/medelegh access to S-mode harts

2025-03-18 Thread Jay Chang
RISC-V Privileged Spec states: "In harts with S-mode, the medeleg and mideleg registers must exist, and setting a bit in medeleg or mideleg will delegate the corresponding trap , when occurring in S-mode or U-mode, to the S-mode trap handler. In harts without S-mode, the medeleg and mideleg registe

[PATCH 07/21] hw/dma/zynq-devcfg: Indicate power-up status of PL

2025-03-18 Thread Corvin Köhne
From: YannickV It is assumed, that the programmable logic (PL) is always powered during emulation. Therefor the PCFG_POR_B bit in the MCTRL register is set. This commit is necessary for the Beckhoff CX7200 board emulation that has a FPGA implemented in the PL. Signed-off-by: Yannick Voßen ---

[PATCH 15/21] hw/arm/beckhoff_CX7200: Adjust Flashes and Busses

2025-03-18 Thread Corvin Köhne
From: YannickV The CX7200 has one QSPI flash connected to the QSPI bus. The defines are adjusted accordingly. The QSPI flash is a is25lp016d. There is no parallel flash. Signed-off-by: Yannick Voßen --- hw/arm/beckhoff_CX7200.c | 20 1 file changed, 4 insertions(+), 16 del

[PATCH v8 3/7] migration: enable multifd and postcopy together

2025-03-18 Thread Prasad Pandit
From: Prasad Pandit Enable Multifd and Postcopy migration together. The migration_ioc_process_incoming() routine checks magic value sent on each channel and helps to properly setup multifd and postcopy channels. The Precopy and Multifd threads work during the initial guest RAM transfer. When mig

[PATCH v3 10/15] 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: [PULL 2/2] target/loongarch: check tlb_ps

2025-03-18 Thread Peter Maydell
On Fri, 7 Mar 2025 at 02:42, Song Gao wrote: > > For LoongArch th min tlb_ps is 12(4KB), for TLB code, > the tlb_ps may be 0,this may case UndefinedBehavior > Add a check-tlb_ps fuction to check tlb_ps, > to make sure the tlb_ps is avalablie. we check tlb_ps > when get the tlb_ps from tlb->misc or

Re: [PATCH v5 1/3] Add support for emulation of CRC32 instructions

2025-03-18 Thread Aleksandar Rakic
Hi, Could you please let us know if you have any comments on the latest version of this patch? Kind regards, Aleksandar Rakic

[PATCH for-10.1 25/32] vfio: Move vfio_set_migration_error() into migration.c

2025-03-18 Thread Cédric Le Goater
This routine is related to VFIO migration. It belongs to "migration.c". While at it, rename it to better reflect the namespace it belongs to. Signed-off-by: Cédric Le Goater --- hw/vfio/migration.h | 1 + hw/vfio/dirty-tracking.c | 19 +-- hw/vfio/migration.c | 7

[PATCH for-10.1 27/32] vfio: Rename VFIODevice related services

2025-03-18 Thread Cédric Le Goater
Rename these routines : vfio_disable_irqindex -> vfio_device_irq_disable vfio_unmask_single_irqindex -> vfio_device_irq_unmask vfio_mask_single_irqindex -> vfio_device_irq_mask vfio_set_irq_signaling -> vfio_device_irq_set_signaling vfio_attach_device -> vfio_device

[PATCH v8 0/7] Allow to enable multifd and postcopy migration together

2025-03-18 Thread Prasad Pandit
From: Prasad Pandit Hello, * This series (v8) splits earlier patch-2 which enabled multifd and postcopy options together into two separate patches. One modifies the channel discovery in migration_ioc_process_incoming() function, and second one enables the multifd and postcopy migration tog

Re: [PATCH 0/2] qga: Add 'guest-get-load' command

2025-03-18 Thread Dehan Meng
QE tested this series's patches. cpu load will be captured by the new api 'guest-get-load'. Tested-by: Dehan Meng On Fri, Mar 14, 2025 at 7:39 PM Konstantin Kostiuk wrote: > Konstantin Kostiuk (2): > qga-win: implement a 'guest-get-load' command > qga: Add tests for guest-get-load command

Re: [PATCH v3 0/7] Move memory listener register to vhost_vdpa_init

2025-03-18 Thread Lei Yang
On Tue, Mar 18, 2025 at 10:15 AM Jason Wang wrote: > > On Tue, Mar 18, 2025 at 9:55 AM Lei Yang wrote: > > > > Hi Jonah > > > > I tested this series with the vhost_vdpa device based on mellanox > > ConnectX-6 DX nic and hit the host kernel crash. This problem can be > > easier to reproduce under

Re: [PATCH] docs/devel/testing/functional: Add a section about logging

2025-03-18 Thread Daniel P . Berrangé
On Tue, Mar 18, 2025 at 10:20:21AM +0100, Thomas Huth wrote: > From: Thomas Huth > > We should tell the users where to find the log file. > While we're at it, also rename the "Overview" heading to a > more accurate "Introduction to writing tests" instead. > > Reported-by: Aditya Gupta > Signed-

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

2025-03-18 Thread Gerd Hoffman
Hi, > Maybe not from the user's point of view, but surely for the vmfwupdate > interface design and for the launch measurement calculations. > > When using igvm parameters for the kernel hashes we need to pass on (at > least) two items via vmfwupdate API: The igvm image itself and the > kernel

[PATCH for-10.1 14/32] vfio: Move Host IOMMU type declarations into their respective files

2025-03-18 Thread Cédric Le Goater
These definitions don't have any use outside of their respective submodules. There is no need to expose them externally. Keep them private. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 5 - hw/vfio/container.c | 2 ++ hw/vfio/iommufd.c | 3 +++ 3

Re: [PATCH v2 0/2] support block encryption/decryption in parallel

2025-03-18 Thread Guoyi Tu
Hi there, Would you have any feedback on this patch? Any suggestions would be greatly appreciated.” -- Guoyi On 2025/1/20 22:58, t...@chinatelecom.cn wrote: From: Guoyi Tu Currently, disk I/O encryption and decryption operations are performed sequentially in the main thread or IOthread. W

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

2025-03-18 Thread Peter Maydell
On Tue, 18 Mar 2025 at 11:31, Aleksandar Rakic wrote: > > Hi, > > If ieee754 equals EMULATED, then the variables mips_use_nan_2008 and > mips_use_nan_legacy are set to true > ( > https://elixir.bootlin.com/linux/v6.13.6/source/arch/mips/kernel/fpu-probe.c#L208 > ) > and any binaries are accepted

RE: [PATCH 01/39] target/hexagon: Implement ciad helper

2025-03-18 Thread Sid Manning
> -Original Message- > From: ltaylorsimp...@gmail.com > Sent: Monday, March 17, 2025 11:08 AM > 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: Building QEMU as a Shared Library

2025-03-18 Thread Alex Bennée
Saanjh Sengupta writes: > Hi, > > Unable to view this. Any GitHub repository diff page I could view for > the same? It was part of this series: https://patchew.org/QEMU/20241022105614.839199-1-alex.ben...@linaro.org/ Specifically this patch: https://patchew.org/QEMU/20241022105614.839199

RE: [RFC PATCH v2 07/20] hw/arm/smmu-common: Introduce callbacks for PCIIOMMUOps

2025-03-18 Thread Shameerali Kolothum Thodi via
> -Original Message- > From: Eric Auger > Sent: Monday, March 17, 2025 4:52 PM > To: Shameerali Kolothum Thodi > ; qemu-...@nongnu.org; > qemu-devel@nongnu.org > Cc: peter.mayd...@linaro.org; j...@nvidia.com; nicol...@nvidia.com; > ddut...@redhat.com; berra...@redhat.com; nath...@nvidia.

Re: [PATCH 13/17] rust/vmstate: Support vmstate_validate

2025-03-18 Thread Zhao Liu
> For now I would leave out a generic field-exists check, and keep the > implementation of vmstate_validate as you did it in v1. > > Once we look more in the builder concept we can think of adding also a > VMStateField (with a PhantomData bool> inside) and add > with_field_exists(). This makes se

Re: [PATCH] qemu-img: fix division by zero in bench_cb() for zero-sized images

2025-03-18 Thread Kevin Wolf
Am 18.03.2025 um 11:19 hat ger...@altlinux.org geschrieben: > From: Denis Rastyogin > > This error was discovered by fuzzing qemu-img. > > This commit fixes a division by zero error in the bench_cb() function > that occurs when using the bench command with a zero-sized image. > > The issue aris

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

2025-03-18 Thread Zhao Liu
> /// 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_name, > _>(phantom__(&$test_fn))) > }, I

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

2025-03-18 Thread Daniel P . Berrangé
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 from a device reference manual, > and much of it is not relevant to

Re: Generic way to detect qemu linux-user emulation

2025-03-18 Thread Daniel P . Berrangé
On Tue, Mar 18, 2025 at 10:53:27AM +, Peter Maydell wrote: > On Tue, 18 Mar 2025 at 10:36, Helge Deller wrote: > > > > On 3/18/25 11:18, Andreas Schwab wrote: > > > Is there a generic way for a program to detect that is it being run > > > inside the linux-user emulation? > > > > Yes, having a

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

2025-03-18 Thread Cédric Le Goater
Gather all VFIOIOMMUFD related declarations into "iommufd.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". Signed-off-by: Cédric Le Goater --- hw/vfio/iommufd.h | 29 + include/hw/vfio/vfio-common.h | 21 +++-- hw/vfio/io

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

2025-03-18 Thread Michael S. Tsirkin
On Tue, Mar 18, 2025 at 12:01:44PM +0100, Paolo Bonzini wrote: > 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 unvers

[PATCH for-10.1 03/32] vfio: Introduce a new header file for external migration services

2025-03-18 Thread Cédric Le Goater
The migration core subsytem makes uses of the VFIO migration API to collect statistics on the number of bytes transferred. These services are declared in "hw/vfio/vfio-common.h" which also contains VFIO internal declarations. Move the migration declarations into a new header file "hw/vfio/vfio-migr

Re: [PATCH] target/riscv/csr.c: fix OVERFLOW_BEFORE_WIDEN in rmw_sctrdepth()

2025-03-18 Thread Peter Maydell
On Fri, 7 Mar 2025 at 12:46, Daniel Henrique Barboza wrote: > > Coverity found the following issue: > > >>> CID 1593156: Integer handling issues (OVERFLOW_BEFORE_WIDEN) > >>> Potentially overflowing expression "0x10 << depth" with type > "int" (32 bits, signed) is evaluated using 3

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

2025-03-18 Thread Peter Maydell
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; recent changes in the codebase mean that one of Coverity's "maybe this n

[PATCH 1/3] scripts: render_block_graph: Fix invalid escape sequence warning with python 3.12

2025-03-18 Thread Peter Krempa
From: Peter Krempa Trying to run 'render_block_graph' produces following warnings on machine with python 3.12: $ ./scripts/render_block_graph.py cd-throttle ble.png ./scripts/render_block_graph.py:57: SyntaxWarning: invalid escape sequence '\l' ' w - Write\l' ./scripts/render_block_graph.

[PATCH 0/3] scripts: render_block_graph: Fix with new python and improve argument parsing

2025-03-18 Thread Peter Krempa
New python doesn't like '\l' escapes from the 'dot' language. While at it improve usability of the script by employing proper argument parsing. Peter Krempa (3): scripts: render_block_graph: Fix invalid escape sequence warning with python 3.12 scripts: render_block_graph: Implement proper

Re: [PATCH] docs/system: Add entry for LoongArch system

2025-03-18 Thread gaosong
在 2025/3/12 下午2:26, Bibo Mao 写道: Add index entry for LoongArch system and do some small modification with LoongArch document with rst syntax. Signed-off-by: Bibo Mao --- docs/system/loongarch/virt.rst | 31 ++- docs/system/target-loongarch.rst | 19

Generic way to detect qemu linux-user emulation

2025-03-18 Thread Andreas Schwab
Is there a generic way for a program to detect that is it being run inside the linux-user emulation? The purpose for that would be to work around limitations of the emulation, like CLONE_VFORK being unsupported. For example, python >= 3.13 needs to avoid using posix_spawn in that case, because th

[PATCH] qemu-img: fix division by zero in bench_cb() for zero-sized images

2025-03-18 Thread gerben
From: Denis Rastyogin This error was discovered by fuzzing qemu-img. This commit fixes a division by zero error in the bench_cb() function that occurs when using the bench command with a zero-sized image. The issue arises because b->image_size can be zero, leading to a division by zero in the m

Re: Generic way to detect qemu linux-user emulation

2025-03-18 Thread Helge Deller
On 3/18/25 11:36, Helge Deller wrote: On 3/18/25 11:18, Andreas Schwab wrote: Is there a generic way for a program to detect that is it being run inside the linux-user emulation? Yes, having a reliable way to detect it would be good. In qemu-user emulation we could change the return values o

Re: [PATCH 1/2] aspeed: Fix maximum number of spi controller

2025-03-18 Thread Cédric Le Goater
On 3/17/25 07:59, Troy Lee wrote: Commit 6de4aa8dc544 ("hw/arm/aspeed_ast27x0: Add SoC Support for AST2700 A1") extends ast2700a1 spis_num to 3, but ASPEED_SPIS_NUM defines the maximum number of spi controller to 2, result in ehci[0] is being overwritten in runtime. Signed-off-by: Troy Lee Fi

[PATCH for-10.1 01/32] vfio: Move vfio_mig_active() into migration.c

2025-03-18 Thread Cédric Le Goater
vfio_mig_active() is part of the VFIO migration API. Move the definitions where VFIO migration is implemented. Signed-off-by: Cédric Le Goater --- hw/vfio/common.c| 16 hw/vfio/migration.c | 16 2 files changed, 16 insertions(+), 16 deletions(-) diff --git

[PATCH for-10.1 06/32] vfio: Introduce a new header file for internal migration services

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

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

2025-03-18 Thread Cédric Le Goater
Gather all CPR related declarations into "cpr.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". Order file list in meson.build while at it. Signed-off-by: Cédric Le Goater --- hw/vfio/cpr.h | 15 +++ include/hw/vfio/vfio-common.h | 3 --- hw/vfio/c

[PATCH for-10.1 05/32] vfio: Make vfio_viommu_preset() static

2025-03-18 Thread Cédric Le Goater
This routine is only used in file "migration.c". Move it there. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 1 - hw/vfio/common.c | 6 -- hw/vfio/migration.c | 5 + 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/hw/vf

Re: [PATCH 2/9] cxl-mailbox-utils: 0x5600 - FMAPI Get DCD Info

2025-03-18 Thread Jonathan Cameron via
On Mon, 17 Mar 2025 16:31:29 + anisa.su...@gmail.com wrote: > From: Anisa Su > > FM DCD Management command 0x5600 implemented per CXL 3.2 Spec Section > 7.6.7.6.1 > > Signed-off-by: Anisa Su > --- > hw/cxl/cxl-mailbox-utils.c | 67 ++ > hw/cxl/i2c_mctp

Re: Generic way to detect qemu linux-user emulation

2025-03-18 Thread Peter Maydell
On Tue, 18 Mar 2025 at 12:43, Daniel P. Berrangé wrote: > > On Tue, Mar 18, 2025 at 01:34:57PM +0100, Andreas Schwab wrote: > > On Mär 18 2025, Daniel P. Berrangé wrote: > > > > > Whereever practical, it is preferrable to check a discrete feature > > > or behaviour in a functional way, rather than

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

  1   2   3   4   >