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

2025-03-14 Thread Ani Sinha
On Fri, Mar 14, 2025 at 8:47 PM Jörg Rödel wrote: > > On Fri, Mar 14, 2025 at 03:08:43PM +0100, Gerd Hoffman wrote: > > If your input firmware image already is an IGVM (say coconut), what is > > supposed to happen? > > The COCONUT igvmbuilder has the ability to take another IGVM file as > input an

[Stable-9.2.3 05/51] target/arm: Make CP_ACCESS_TRAPs to AArch32 EL3 be Monitor traps

2025-03-14 Thread Michael Tokarev
From: Peter Maydell In system register access pseudocode the common pattern for AArch32 registers with access traps to EL3 is: at EL1 and EL2: if HaveEL(EL3) && !ELUsingAArch32(EL3) && (SCR_EL3.TERR == 1) then AArch64.AArch32SystemAccessTrap(EL3, 0x03); elsif HaveEL(EL3) && ELUsingAArch

[Stable-9.2.3 23/51] target/riscv: rvv: Fix unexpected behavior of vector reduction instructions when vl is 0

2025-03-14 Thread Michael Tokarev
From: Max Chou According to the Vector Reduction Operations section in the RISC-V "V" Vector Extension spec, "If vl=0, no operation is performed and the destination register is not updated." The vd should be updated when vl is larger than 0. Fixes: fe5c9ab1fc ("target/riscv: vector single-width

[Stable-9.2.3 14/51] amd_iommu: Use correct bitmask to set capability BAR

2025-03-14 Thread Michael Tokarev
From: Sairaj Kodilkar AMD IOMMU provides the base address of control registers through IVRS table and PCI capability. Since this base address is of 64 bit, use 32 bits mask (instead of 16 bits) to set BAR low and high. Fixes: d29a09ca68 ("hw/i386: Introduce AMD IOMMU") Signed-off-by: Sairaj Kodi

[Stable-9.2.3 11/51] hw/i386/pc: Fix crash that occurs when introspecting TYPE_PC_MACHINE machines

2025-03-14 Thread Michael Tokarev
From: Thomas Huth QEMU currently crashes when you try to inspect the machines based on TYPE_PC_MACHINE for their properties: $ echo '{ "execute": "qmp_capabilities" } { "execute": "qom-list-properties","arguments": { "typename": "pc-q35-10.0-machine"}}' \ | ./q

[Stable-9.2.3 03/51] target/arm: Report correct syndrome for UNDEFINED S1E2 AT ops at EL3

2025-03-14 Thread Michael Tokarev
From: Peter Maydell The pseudocode for AT S1E2R and AT S1E2W says that they should be UNDEFINED if executed at EL3 when EL2 is not enabled. We were incorrectly using CP_ACCESS_TRAP and reporting the wrong exception syndrome as a result. Use CP_ACCESS_TRAP_UNCATEGORIZED. Cc: qemu-sta...@nongnu.or

[Stable-9.2.3 04/51] target/arm: Report correct syndrome for UNDEFINED LOR sysregs when NS=0

2025-03-14 Thread Michael Tokarev
From: Peter Maydell The pseudocode for the accessors for the LOR sysregs says they are UNDEFINED if SCR_EL3.NS is 0. We were reporting the wrong syndrome value here; use CP_ACCESS_TRAP_UNCATEGORIZED. Cc: qemu-sta...@nongnu.org Fixes: 2d7137c10faf ("target/arm: Implement the ARMv8.1-LOR extension

[Stable-9.2.3 16/51] vdpa: Fix endian bugs in shadow virtqueue

2025-03-14 Thread Michael Tokarev
From: Konstantin Shkolnyy VDPA didn't work on a big-endian machine due to missing/incorrect CPU<->LE data format conversions. Signed-off-by: Konstantin Shkolnyy Message-Id: <20250212164923.1971538-1-k...@linux.ibm.com> Fixes: 10857ec0ad ("vhost: Add VhostShadowVirtqueue") Acked-by: Eugenio Pére

[Stable-9.2.3 07/51] target/arm: Honour SDCR.TDCC and SCR.TERR in AArch32 EL3 non-Monitor modes

2025-03-14 Thread Michael Tokarev
From: Peter Maydell There are not many traps in AArch32 which should trap to Monitor mode, but these trap bits should trap not just lower ELs to Monitor mode but also the non-Monitor modes running at EL3 (i.e. Secure System, Secure Undef, etc). We get this wrong because the relevant access func

[Stable-9.2.3 31/51] target/arm: Apply correct timer offset when calculating deadlines

2025-03-14 Thread Michael Tokarev
From: Peter Maydell When we are calculating timer deadlines, the correct definition of whether or not to apply an offset to the physical count is described in the Arm ARM DDI4087 rev L.a section D12.2.4.1. This is different from when the offset should be applied for a direct read of the counter

[Stable-9.2.3 20/51] physmem: replace assertion with error

2025-03-14 Thread Michael Tokarev
From: Paolo Bonzini It is possible to start QEMU with a confidential-guest-support object even in TCG mode. While there is already a check in qemu_machine_creation_done: if (machine->cgs && !machine->cgs->ready) { error_setg(errp, "accelerator does not support confidential guest %s"

[Stable-9.2.3 15/51] cryptodev/vhost: allocate CryptoDevBackendVhost using g_mem0()

2025-03-14 Thread Michael Tokarev
From: Stefano Garzarella The function `vhost_dev_init()` expects the `struct vhost_dev` (passed as a parameter) to be fully initialized. This is important because some parts of the code check whether `vhost_dev->config_ops` is NULL to determine if it has been set (e.g. later via `vhost_dev_set_co

[Stable-9.2.3 24/51] target/riscv: rvv: Fix incorrect vlen comparison in prop_vlen_set

2025-03-14 Thread Michael Tokarev
From: Max Chou In prop_vlen_set function, there is an incorrect comparison between vlen(bit) and vlenb(byte). This will cause unexpected error when user applies the `vlen=1024` cpu option with a vendor predefined cpu type that the default vlen is 1024(vlenb=128). Fixes: 4f6d036ccc ("target/riscv

[Stable-9.2.3 17/51] hw/virtio/virtio-nsm: Respond with correct length

2025-03-14 Thread Michael Tokarev
From: Alexander Graf When we return a response packet from NSM, we need to indicate its length according to the content of the response. Prior to this patch, we returned the length of the source buffer, which may confuse guest code that relies on the response size. Fix it by returning the respon

[Stable-9.2.3 08/51] target/arm: Correct errors in WFI/WFE trapping

2025-03-14 Thread Michael Tokarev
From: Peter Maydell The code for WFI/WFE trapping has several errors: * it wasn't using arm_sctlr(), so it would look at SCTLR_EL1 even if the CPU was in the EL2&0 translation regime * it was raising UNDEF, not Monitor Trap, for traps to AArch32 EL3 because of SCR.{TWE,TWI} * it was not

[Stable-9.2.3 22/51] target/arm/hvf: sign extend the data for a load operation when SSE=1

2025-03-14 Thread Michael Tokarev
From: Joelle van Dyne In the syndrome value for a data abort, bit 21 is SSE, which is set to indicate that the abort was on a sign-extending load. When we handle the data abort from the guest via address_space_read(), we forgot to handle this and so would return the wrong value if the guest did a

[Stable-9.2.3 30/51] hw/gpio: npcm7xx: fixup out-of-bounds access

2025-03-14 Thread Michael Tokarev
From: Patrick Venture The reg isn't validated to be a possible register before it's dereferenced for one case. The mmio space registered for the gpio device is 4KiB but there aren't that many registers in the struct. Cc: qemu-sta...@nongnu.org Fixes: 526dbbe0874 ("hw/gpio: Add GPIO model for Nu

[Stable-9.2.3 12/51] hw/i386/microvm: Fix crash that occurs when introspecting the microvm machine

2025-03-14 Thread Michael Tokarev
From: Thomas Huth QEMU currently crashes when you try to inspect the properties of the microvm machine: $ echo '{ "execute": "qmp_capabilities" } { "execute": "qom-list-properties","arguments": { "typename": "microvm-machine"}}' | \ ./qemu-system-x86_64 -qmp stdio {"QMP"

[Stable-9.2.3 26/51] target/riscv: throw debug exception before page fault

2025-03-14 Thread Michael Tokarev
From: Daniel Henrique Barboza In the RISC-V privileged ISA section 3.1.15 table 15, it is determined that a debug exception that is triggered from a load/store has a higher priority than a possible fault that this access might trigger. This is not the case ATM as shown in [1]. Adding a breakpoin

[Stable-9.2.3 40/51] target/arm: Correct STRD atomicity

2025-03-14 Thread Michael Tokarev
From: Peter Maydell Our STRD implementation doesn't correctly implement the requirement: * if the address is 8-aligned the access must be a 64-bit single-copy atomic access, not two 32-bit accesses Rewrite the handling of STRD to use a single tcg_gen_qemu_st_i64() of a value produced by conc

[Stable-9.2.3 38/51] hw/arm: enable secure EL2 timers for sbsa machine

2025-03-14 Thread Michael Tokarev
From: Alex Bennée Signed-off-by: Alex Bennée Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell Message-id: 20250204125009.2281315-10-peter.mayd...@linaro.org Cc: qemu-sta...@nongnu.org Signed-off-by: Peter Maydell (cherry picked from commit 9a9d9e82093efa22e3e2bdaac0f24c823f8786f7) Sign

[Stable-9.2.3 01/51] target/arm: Report correct syndrome for UNDEFINED CNTPS_*_EL1 from EL2 and NS EL1

2025-03-14 Thread Michael Tokarev
From: Peter Maydell The access pseudocode for the CNTPS_TVAL_EL1, CNTPS_CTL_EL1 and CNTPS_CVAL_EL1 secure timer registers says that they are UNDEFINED from EL2 or NS EL1. We incorrectly return CP_ACCESS_TRAP from the access function in these cases, which means that we report the wrong syndrome v

[Stable-9.2.3 00/51] Patch Round-up for stable 9.2.3, freeze on 2025-03-24

2025-03-14 Thread Michael Tokarev
The following patches are queued for QEMU stable v9.2.3: https://gitlab.com/qemu-project/qemu/-/commits/staging-9.2 Patch freeze is 2025-03-24, and the release is planned for 2025-03-26: https://wiki.qemu.org/Planning/9.2 Please respond here or CC qemu-sta...@nongnu.org on any additional pa

[PULL 09/17] target/arm: Add cpu local variable to exception_return helper

2025-03-14 Thread Peter Maydell
We already call env_archcpu() multiple times within the exception_return helper function, and we're about to want to add another use of the ARMCPU pointer. Add a local variable cpu so we can call env_archcpu() just once. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm

[Stable-9.2.3 39/51] target/arm: Correct LDRD atomicity and fault behaviour

2025-03-14 Thread Michael Tokarev
From: Peter Maydell Our LDRD implementation is wrong in two respects: * if the address is 4-aligned and the load crosses a page boundary and the second load faults and the first load was to the base register (as in cases like "ldrd r2, r3, [r2]", then we must not update the base regist

[PULL 15/17] target/arm: Make DisasContext.{fp, sve}_access_checked tristate

2025-03-14 Thread Peter Maydell
From: Richard Henderson The check for fp_excp_el in assert_fp_access_checked is incorrect. For SME, with StreamingMode enabled, the access is really against the streaming mode vectors, and access to the normal fp registers is allowed to be disabled. C.f. sme_enabled_check. Convert sve_access_ch

[PULL 14/17] util/cacheflush: Make first DSB unconditional on aarch64

2025-03-14 Thread Peter Maydell
From: Joe Komlodi On ARM hosts with CTR_EL0.DIC and CTR_EL0.IDC set, this would only cause an ISB to be executed during cache maintenance, which could lead to QEMU executing TBs containing garbage instructions. This seems to be because the ISB finishes executing instructions and flushes the pipe

[PATCH 1/1] linux-user: Hold the fd-trans lock across fork

2025-03-14 Thread Geoffrey Thomas
If another thread is holding target_fd_trans_lock during a fork, then the lock becomes permanently locked in the child and the emulator deadlocks at the next interaction with the fd-trans table. As with other locks, acquire the lock in fork_start() and release it in fork_end(). Signed-off-by: Geof

[PULL 07/17] target/arm: SCR_EL3.RW should be treated as 1 if EL2 doesn't support AArch32

2025-03-14 Thread Peter Maydell
The definition of SCR_EL3.RW says that its effective value is 1 if: - EL2 is implemented and does not support AArch32, and SCR_EL3.NS is 1 - the effective value of SCR_EL3.{EEL2,NS} is {1,0} (i.e. we are Secure and Secure EL2 is disabled) We implement the second of these in arm_el_is_aa64(),

Re: [PATCH RFC] target: riscv: Add Svrsw60b59b extension support

2025-03-14 Thread Daniel Henrique Barboza
On 3/14/25 9:11 AM, Alexandre Ghiti wrote: On Fri, Mar 14, 2025 at 11:48 AM Alexandre Ghiti wrote: The Svrsw60b59b extension allows to free the PTE reserved bits 60 and 59 for software to use. I missed that the extension had been renamed to Svrsw60*t*59b, I'll fix that in v2 later after I

[PATCH v3 7/7] vdpa: move memory listener register to vhost_vdpa_init

2025-03-14 Thread Jonah Palmer
From: Eugenio Pérez Current memory operations like pinning may take a lot of time at the destination. Currently they are done after the source of the migration is stopped, and before the workload is resumed at the destination. This is a period where neigher traffic can flow, nor the VM workload

[PULL 08/17] target/arm: HCR_EL2.RW should be RAO/WI if EL1 doesn't support AArch32

2025-03-14 Thread Peter Maydell
When EL1 doesn't support AArch32, the HCR_EL2.RW bit is supposed to be RAO/WI. Enforce the RAO/WI behaviour. Note that we handle "reset value should honour RES1 bits" in the same way that SCR_EL3 does, via a reset function. We do already have some CPU types which don't implement AArch32 above EL0

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

2025-03-14 Thread Jonah Palmer
Current memory operations like pinning may take a lot of time at the destination. Currently they are done after the source of the migration is stopped, and before the workload is resumed at the destination. This is a period where neigher traffic can flow, nor the VM workload can continue (downtim

[PATCH v3 2/7] vdpa: reorder vhost_vdpa_set_backend_cap

2025-03-14 Thread Jonah Palmer
From: Eugenio Pérez It will be used directly by vhost_vdpa_init. Signed-off-by: Eugenio Pérez Signed-off-by: Jonah Palmer --- hw/virtio/vhost-vdpa.c | 60 +- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/hw/virtio/vhost-vdpa.c b/hw/vir

[PATCH v3 1/7] vdpa: check for iova tree initialized at net_client_start

2025-03-14 Thread Jonah Palmer
From: Eugenio Pérez To map the guest memory while it is migrating we need to create the iova_tree, as long as the destination uses x-svq=on. Checking to not override it. The function vhost_vdpa_net_client_stop clear it if the device is stopped. If the guest starts the device again, the iova tree

[PATCH v3 4/7] vdpa: add listener_registered

2025-03-14 Thread Jonah Palmer
From: Eugenio Pérez Check if the listener has been registered or not, so it needs to be registered again at start. Signed-off-by: Eugenio Pérez Signed-off-by: Jonah Palmer --- hw/virtio/vhost-vdpa.c | 7 ++- include/hw/virtio/vhost-vdpa.h | 6 ++ 2 files changed, 12 insertions

[PATCH v3 3/7] vdpa: set backend capabilities at vhost_vdpa_init

2025-03-14 Thread Jonah Palmer
From: Eugenio Pérez The backend does not reset them until the vdpa file descriptor is closed so there is no harm in doing it only once. This allows the destination of a live migration to premap memory in batches, using VHOST_BACKEND_F_IOTLB_BATCH. Signed-off-by: Eugenio Pérez Signed-off-by: Jo

Re: [PATCH RFC] target: riscv: Add Svrsw60b59b extension support

2025-03-14 Thread Alexandre Ghiti
On Fri, Mar 14, 2025 at 1:38 PM Daniel Henrique Barboza wrote: > > > > On 3/14/25 9:11 AM, Alexandre Ghiti wrote: > > On Fri, Mar 14, 2025 at 11:48 AM Alexandre Ghiti > > wrote: > >> > >> The Svrsw60b59b extension allows to free the PTE reserved bits 60 and 59 > >> for software to use. > > > > I

Re: [PATCH v8 00/28] vfio-user client

2025-03-14 Thread John Levon
On Fri, Mar 14, 2025 at 03:25:53PM +0100, Cédric Le Goater wrote: > > This is the 8th revision of the vfio-user client implementation. The > > vfio-user > > protocol allows for implementing (PCI) devices in another userspace process; > > SPDK is one example, which includes a virtual NVMe implemen

[PATCH] configure: disable split_debug on Windows and on non-git builds

2025-03-14 Thread Paolo Bonzini
-gsplit-dwarf is reported to produce broken binaries on Windows. The linker produces warnings but exits successfully: /usr/lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld: qga/qemu-ga.exe:/4: section below image base /usr/lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64

Re: [PATCH] docs/cxl: Add serial number for persistent-memdev

2025-03-14 Thread Dan Williams
Jonathan Cameron wrote: > On Wed, 5 Mar 2025 18:35:40 +0800 > Yuquan Wang wrote: > > > > > > > On Tue, 4 Mar 2025 14:22:48 +0800 > > > Yuquan Wang wrote: > > > > > > > > > > > > > On Thu, Feb 20, 2025 at 04:12:13PM +, Jonathan Cameron wrote: > > > > > > On Mon, 17 Feb 2025 19:20:39

Re: [PATCH v3 4/7] memory-attribute-manager: Introduce MemoryAttributeManager to manage RAMBLock with guest_memfd

2025-03-14 Thread Gupta, Pankaj
On 3/10/2025 9:18 AM, Chenyi Qiang wrote: As the commit 852f0048f3 ("RAMBlock: make guest_memfd require uncoordinated discard") highlighted, some subsystems like VFIO may disable ram block discard. However, guest_memfd relies on the discard operation to perform page conversion between private and

[PULL 02/17] target/arm: Un-inline access_secure_reg()

2025-03-14 Thread Peter Maydell
We would like to move arm_el_is_aa64() to internals.h; however, it is used by access_secure_reg(). Make that function not be inline, so that it can stay in cpu.h. access_secure_reg() is used only in two places: * in hflags.c * in the user-mode arm emulators, to decide whether to store the TL

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

2025-03-14 Thread Jörg Rödel
On Fri, Mar 14, 2025 at 03:08:43PM +0100, Gerd Hoffman wrote: > If your input firmware image already is an IGVM (say coconut), what is > supposed to happen? The COCONUT igvmbuilder has the ability to take another IGVM file as input and add its directive and contents to the output file. This is nee

Re: [PATCH 2/2] memory: suppress INVALID_MEM logs caused by debug access

2025-03-14 Thread Philippe Mathieu-Daudé
On 14/3/25 08:41, Nicholas Piggin wrote: Debugger-driven invalid memory accesses are not guest errors, so should not cause these error logs. Debuggers can access memory wildly, including access to addresses not specified by the user (e.g., gdb it might try to walk the stack or load target addres

Re: [PATCH] configure: disable split_debug on Windows and on non-git builds

2025-03-14 Thread Peter Maydell
On Fri, 14 Mar 2025 at 15:39, Paolo Bonzini wrote: > > -gsplit-dwarf is reported to produce broken binaries on Windows. > The linker produces warnings but exits successfully: > > /usr/lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld: > qga/qemu-ga.exe:/4: section below image

Re: [PATCH] configure: disable split_debug on Windows and on non-git builds

2025-03-14 Thread Daniel P . Berrangé
On Fri, Mar 14, 2025 at 04:44:01PM +, Peter Maydell wrote: > On Fri, 14 Mar 2025 at 15:39, Paolo Bonzini wrote: > > > > -gsplit-dwarf is reported to produce broken binaries on Windows. > > The linker produces warnings but exits successfully: > > > > /usr/lib/gcc/x86_64-w64-mingw32/14.2.0/../..

Re: [PATCH] configure: disable split_debug on Windows and on non-git builds

2025-03-14 Thread Paolo Bonzini
On 3/14/25 17:54, Daniel P. Berrangé wrote: Same remark as on the other patch: can we have a comment explaining why we disable this on Windows, please, ideally with a URL of a bug report against the toolchain ? Two likely candidates open a long time https://gcc.gnu.org/bugzilla/show_bug

Re: [PATCH 32/37] include/hw/intc: Remove ifndef CONFIG_USER_ONLY from armv7m_nvic.h

2025-03-14 Thread Richard Henderson
On 3/14/25 13:34, Pierrick Bouvier wrote: On 3/14/25 13:03, Richard Henderson wrote: I'm not quite sure what you're arguing for here. A build-time error is vastly preferable to a run-time error. Even though this specific patch is safe (code calling those functions should be under system anyw

Re: [PATCH v2 00/14] Factor out HVF's instruction emulator

2025-03-14 Thread Wei Liu
On Fri, Mar 07, 2025 at 11:55:11AM -0800, Wei Liu wrote: > Hi, > > Microsoft's Linux Systems Group developed a Linux driver for the Microsoft > Hypervisor (MSHV for short). The driver is being upstreamed. The first > supported VMM is Cloud Hypervisor. We want to add QEMU as the second supported >

[PULL 04/17] linux-user/arm: Remove unused get_put_user macros

2025-03-14 Thread Peter Maydell
In linux-user/arm/cpu_loop.c we define a full set of get/put macros for both code and data (since the endianness handling is different between the two). However the only one we actually use is get_user_code_u32(). Remove the rest. We leave a comment noting how data-side accesses should be handled

Re: [PATCH] configure: disable split_debug on Windows and on non-git builds

2025-03-14 Thread Alex Bennée
Pierrick Bouvier writes: > On 3/14/25 08:38, Paolo Bonzini wrote: >> -gsplit-dwarf is reported to produce broken binaries on Windows. >> The linker produces warnings but exits successfully: >> /usr/lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld: >> qga/qemu-ga.exe:/4: sec

[PATCH] ppc/amigaone: Check blk_pwrite return value

2025-03-14 Thread BALATON Zoltan
Coverity reported that return value of blk_pwrite() maybe should not be ignored. We can't do much if this happens other than report an error but let's do that to silence this report. Resolves: Coverity CID 1593725 Signed-off-by: BALATON Zoltan --- hw/ppc/amigaone.c | 14 -- 1 file ch

[PATCH] ppc/amigaone: Constify default_env

2025-03-14 Thread BALATON Zoltan
The variable holding default env is not supposed to be written. Signed-off-by: BALATON Zoltan --- hw/ppc/amigaone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/amigaone.c b/hw/ppc/amigaone.c index 5d787c3059..e9407a51b5 100644 --- a/hw/ppc/amigaone.c +++ b/hw/ppc/a

Re: [PATCH] configure: disable split_debug on Windows and on non-git builds

2025-03-14 Thread Pierrick Bouvier
On 3/14/25 08:38, Paolo Bonzini wrote: -gsplit-dwarf is reported to produce broken binaries on Windows. The linker produces warnings but exits successfully: /usr/lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/ld: qga/qemu-ga.exe:/4: section below image base /usr/lib/gcc/x86

Re: [BUG][RFC] CPR transfer Issues: Socket permissions and PID files

2025-03-14 Thread Steven Sistare
Thank you Ben. I appreciate you testing CPR and shaking out the bugs. I will study these and propose patches. My initial reaction to the pidfile issue is that the orchestration layer must pass a different filename when starting the destination qemu instance. When using live update without conta

Re: [PATCH v2 2/3] hw/loongarch/virt: Remove unnecessary NULL pointer checking

2025-03-14 Thread bibo mao
On 2025/3/14 下午5:11, Markus Armbruster wrote: Bibo Mao writes: 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. Signed-off-by: Bibo Mao --- hw/loongar

Re: [PATCH 1/2] hw/xen: Fix xen_bus_realize() error handling

2025-03-14 Thread Stefano Stabellini
On Fri, 14 Mar 2025, Markus Armbruster wrote: > The Error ** argument must be NULL, &error_abort, &error_fatal, or a > pointer to a variable containing NULL. Passing an argument of the > latter kind twice without clearing it in between is wrong: if the > first call sets an error, it no longer poin

Re: [PATCH 1/2] gdbstub: Add phys_memory_rw_debug for physical memory access

2025-03-14 Thread Richard Henderson
On 3/14/25 00:41, Nicholas Piggin wrote: Add an accessor for gdb physical memory access mode which sets the the .debug attribute for the MemTxAttribute, and also returns success to the caller. GDB with PhyMemMode will now report failure from memory accesses outside valid system memory addresses,

Re: [PATCH] configure: disable split_debug on Windows and on non-git builds

2025-03-14 Thread Richard Henderson
On 3/14/25 14:14, Alex Bennée wrote: Pierrick Bouvier writes: On 3/14/25 08:38, Paolo Bonzini wrote: -gsplit-dwarf is reported to produce broken binaries on Windows. The linker produces warnings but exits successfully: /usr/lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/

[PATCH v5 09/17] exec/ram_addr: remove dependency on cpu.h

2025-03-14 Thread Pierrick Bouvier
Needed so compilation units including it can be common. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/ram_addr.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index e4c28fbec9b..f5d574261

[PATCH v5 11/17] exec/ram_addr: call xen_hvm_modified_memory only if xen is enabled

2025-03-14 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/ram_addr.h | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index f5d574261a3..92e8708af76 100644 --- a/include/exec/ram_addr.h +++ b/inclu

Re: [PATCH 09/11] docs: add QAPI namespace "QMP" to qemu-qmp-ref

2025-03-14 Thread Markus Armbruster
John Snow writes: > This also creates the qapi-qmp-index.html index and cross-reference > target. > > Signed-off-by: John Snow > --- > docs/conf.py | 4 +++- > docs/interop/qemu-qmp-ref.rst | 1 + > qapi/qapi-schema.json | 2 +- > 3 files changed, 5 insertions(+), 2 del

Re: [PULL 00/72] ppc-for-10.0-1 queue

2025-03-14 Thread Nicholas Piggin
On Thu Mar 13, 2025 at 8:49 PM AEST, Philippe Mathieu-Daudé wrote: > On 13/3/25 07:13, Thomas Huth wrote: >> On 13/03/2025 03.34, Stefan Hajnoczi wrote: >>> On Tue, Mar 11, 2025 at 8:59 PM Nicholas Piggin >>> wrote: The following changes since commit 825b96dbcee23d134b691fc75618b5

Re: [PATCH] target/arm: Define raw write for PMU CLR registers

2025-03-14 Thread Akihiko Odaki
On 2025/03/14 3:34, Peter Maydell wrote: On Thu, 13 Mar 2025 at 07:16, Akihiko Odaki wrote: PMCNTENCLR_EL0 and PMINTENCLR_EL1 clears written bits so we need an alternative raw write functions, which will be used to copy KVM kernel coprocessor state into userspace. Signed-off-by: Akihiko Odaki

Re: Cross-compilation artifact is broken

2025-03-14 Thread Konstantin Kostiuk
On Wed, Mar 12, 2025 at 6:24 PM Alex Bennée wrote: > Daniel P. Berrangé writes: > > > On Wed, Mar 12, 2025 at 02:05:09PM +, Daniel P. Berrangé wrote: > >> On Wed, Mar 12, 2025 at 03:52:45PM +0200, Konstantin Kostiuk wrote: > >> > Hi All, > >> > > >> > I cross-compiled qemu-ga from current ma

Re: Re: [PATCH] cryptodev: Fix error handling in cryptodev_lkcf_execute_task()

2025-03-14 Thread zhenwei pi
Hi Markus, Current code style seems buggy, I think the main reason is that the Error *errp is not generated at right place. keyctl_pkey_XXX fails without new error, qcrypto_akcipher_XXX fails with new error, but they are in the same switch-case code block. If we can separate crypto operations

Re: [PATCH v2] target/arm: Define raw write for PMU CLR registers

2025-03-14 Thread Peter Maydell
On Fri, 14 Mar 2025 at 08:13, Akihiko Odaki wrote: > > Raw writes to PMCNTENCLR and PMCNTENCLR_EL0 incorrectly used their > default write function, which clears written bits instead of writes the > raw value. > > PMINTENCLR and PMINTENCLR_EL1 are similar registers, but they instead > had ARM_CP_NO

[PULL 00/12] QAPI patches patches for 2025-03-14

2025-03-14 Thread Markus Armbruster
The following changes since commit 0462a32b4f63b2448b4a196381138afd50719dc4: Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging (2025-03-14 09:31:13 +0800) are available in the Git repository at: https://repo.or.cz/qemu/armbru.git tags/pull-qapi-2025-03-14 for you to fe

Re: [PATCH v3 6/7] memory: Attach MemoryAttributeManager to guest_memfd-backed RAMBlocks

2025-03-14 Thread Chenyi Qiang
On 3/14/2025 5:50 PM, David Hildenbrand wrote: > On 14.03.25 10:30, Chenyi Qiang wrote: >> >> >> On 3/14/2025 5:00 PM, David Hildenbrand wrote: >>> On 14.03.25 09:21, Chenyi Qiang wrote: Hi David & Alexey, >>> >>> Hi, >>> To keep the bitmap aligned, I add the undo operation for >>

Re: [PATCH v2] target/arm: Define raw write for PMU CLR registers

2025-03-14 Thread Akihiko Odaki
On 2025/03/14 19:22, Peter Maydell wrote: On Fri, 14 Mar 2025 at 08:13, Akihiko Odaki wrote: Raw writes to PMCNTENCLR and PMCNTENCLR_EL0 incorrectly used their default write function, which clears written bits instead of writes the raw value. PMINTENCLR and PMINTENCLR_EL1 are similar regis

Re: [PATCH 2/3] hw/loongarch/virt: Remove unnecessary NULL pointer checking

2025-03-14 Thread Markus Armbruster
bibo mao writes: On 2025/3/13 下午6:32, Markus Armbruster wrote: [...] >> diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c >> index a5840ff968..4674bd9163 100644 >> --- a/hw/loongarch/virt.c >> +++ b/hw/loongarch/virt.c >> @@ -859,30 +859,29 @@ static void virt_cpu_pre_plug(HotplugHandler

Re: [PATCH v2] target/arm: Define raw write for PMU CLR registers

2025-03-14 Thread Peter Maydell
On Fri, 14 Mar 2025 at 10:24, Akihiko Odaki wrote: > > > > On 2025/03/14 19:22, Peter Maydell wrote: > > On Fri, 14 Mar 2025 at 08:13, Akihiko Odaki > > wrote: > >> > >> Raw writes to PMCNTENCLR and PMCNTENCLR_EL0 incorrectly used their > >> default write function, which clears written bits inst

[RFC PATCH] meson.build: don't bother with split-debug for windows

2025-03-14 Thread Alex Bennée
It was reported this breaks the final artefacts on windows when run under Wine. Signed-off-by: Alex Bennée Cc: Konstantin Kostiuk --- meson.build | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index c2c71b6f8a..9b1af6d030 100644 --- a/meson.b

Re: [PATCH v2] target/arm: Define raw write for PMU CLR registers

2025-03-14 Thread Akihiko Odaki
On 2025/03/14 19:29, Peter Maydell wrote: On Fri, 14 Mar 2025 at 10:24, Akihiko Odaki wrote: On 2025/03/14 19:22, Peter Maydell wrote: On Fri, 14 Mar 2025 at 08:13, Akihiko Odaki wrote: Raw writes to PMCNTENCLR and PMCNTENCLR_EL0 incorrectly used their default write function, which clear

[PATCH v5 08/17] exec/memory-internal: remove dependency on cpu.h

2025-03-14 Thread Pierrick Bouvier
Needed so compilation units including it can be common. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/memory-internal.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h index 100c1237ac2..b729f

Re: [PATCH 32/37] include/hw/intc: Remove ifndef CONFIG_USER_ONLY from armv7m_nvic.h

2025-03-14 Thread Richard Henderson
On 3/14/25 11:36, Pierrick Bouvier wrote: On 3/14/25 11:13, Richard Henderson wrote: On 3/13/25 14:00, Pierrick Bouvier wrote: diff --git a/include/hw/intc/armv7m_nvic.h b/include/hw/intc/armv7m_nvic.h index 89fe8aedaa..7b9964fe7e 100644 --- a/include/hw/intc/armv7m_nvic.h +++ b/include/hw/intc

Re: [PATCH] configure: disable split_debug on Windows and on non-git builds

2025-03-14 Thread Pierrick Bouvier
On 3/14/25 14:14, Alex Bennée wrote: Pierrick Bouvier writes: On 3/14/25 08:38, Paolo Bonzini wrote: -gsplit-dwarf is reported to produce broken binaries on Windows. The linker produces warnings but exits successfully: /usr/lib/gcc/x86_64-w64-mingw32/14.2.0/../../../../x86_64-w64-mingw32/bin/

Re: [PATCH v4 12/17] hw/xen: add stubs for various functions

2025-03-14 Thread Pierrick Bouvier
On 3/14/25 06:35, Anthony PERARD wrote: On Thu, Mar 13, 2025 at 09:38:58AM -0700, Pierrick Bouvier wrote: Those functions are used by system/physmem.c, and are called only if xen is enabled (which happens only if CONFIG_XEN is not set). You mean, 's/is not set/is set/'? Right, I'll update th

[PATCH v2 5/8] hw/ppc: Implement saving CPU state in Fadump

2025-03-14 Thread Aditya Gupta
Kernel expects CPU states/register states in the format mentioned in "Register Save Area" in PAPR. The platform (in our case, QEMU) saves each CPU register in the form of an array of "register entries", the start and end of this array is signified by "CPUSTRT" and "CPUEND" register entries respect

Re: [PATCH] util/loongarch64: Add clang compiler support

2025-03-14 Thread Yao Zi
On Fri, Mar 07, 2025 at 09:13:39AM +0800, Bibo Mao wrote: > Float register name f0 - f31 is not recognized with clang compiler > with LoongArch64 target, its name should be $f0 - $f31. It is ok > for both gcc and clang compiler. Sorry I didn't search the list carefully and sent a similar patch[1].

[PATCH v5 01/17] exec/tswap: target code can use TARGET_BIG_ENDIAN instead of target_words_bigendian()

2025-03-14 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/tswap.h | 11 ++- cpu-target.c | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/exec/tswap.h b/include/exec/tswap.h index ecd4faef015..2683da0adb7 100644 --- a/include/ex

[PATCH v5 15/17] include/exec/memory: move devend functions to memory-internal.h

2025-03-14 Thread Pierrick Bouvier
Only system/physmem.c and system/memory.c use those functions, so we can move then to internal header. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/memory-internal.h | 19 +++ include/exec/memory.h | 18 -- 2 files chan

[PATCH v5 04/17] exec/memory_ldst_phys: extract memory_ldst_phys declarations from cpu-all.h

2025-03-14 Thread Pierrick Bouvier
They are now accessible through exec/memory.h instead, and we make sure all variants are available for common or target dependent code. Move stl_phys_notdirty function as well. Cached endianness agnostic version rely on st/ld*_p, which is available through tswap.h. Reviewed-by: Richard Henderson

[PATCH v5 05/17] exec/memory.h: make devend_memop "target defines" agnostic

2025-03-14 Thread Pierrick Bouvier
Will allow to make system/memory.c common later. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/memory.h | 16 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index da21e9150b5..069021

[PATCH v5 16/17] system/memory: make compilation unit common

2025-03-14 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- system/memory.c| 17 + system/meson.build | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/system/memory.c b/system/memory.c index 4c829793a0a..eddd21a6cdb 100644 --- a/system/memory.c

Re: [PATCH 2/2] utils/qemu-sockets: Introduce keep-alive-idle-period inet socket option

2025-03-14 Thread Vladimir Sementsov-Ogievskiy
On 03.03.25 17:33, Juraj Marcin wrote: The default idle period for TCP connection could be even 2 hours. However, in some cases, the application needs to be aware of a connection issue much sooner. This is the case, for example, for postcopy live migration. If there is no traffic from the migrat

[PATCH v5 14/17] include/exec/memory: extract devend_big_endian from devend_memop

2025-03-14 Thread Pierrick Bouvier
we'll use it in system/memory.c. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/exec/memory.h | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 069021ac3ff..70177304a92 100644 -

[PATCH v5 12/17] hw/xen: add stubs for various functions

2025-03-14 Thread Pierrick Bouvier
Those symbols are used by system/physmem.c, and are called only if xen_enabled() (which happens only if CONFIG_XEN is set and xen is available). So we can crash the stubs in case those are called, as they are linked only when CONFIG_XEN is not set. Acked-by: Richard Henderson Acked-by: Anthony P

Re: [PATCH v2] blockdev-backup: Add error handling option for copy-before-write jobs

2025-03-14 Thread Vladimir Sementsov-Ogievskiy
On 04.03.25 12:17, Raman Dzehtsiar wrote: This patch extends the blockdev-backup QMP command to allow users to specify how to behave when IO errors occur during copy-before-write operations. Previously, the behavior was fixed and could not be controlled by the user. The new 'on-cbw-error' option

[PATCH v5 02/17] exec/tswap: implement {ld, st}.*_p as functions instead of macros

2025-03-14 Thread Pierrick Bouvier
Defining functions allows to use them from common code, by not depending on TARGET_BIG_ENDIAN. Remove previous macros from exec/cpu-all.h. By moving them out of cpu-all.h, we'll be able to break dependency on cpu.h for memory related functions coming in next commits. Reviewed-by: Richard Henderson

Re: [PATCH v5 00/17] make system memory API available for common code

2025-03-14 Thread Pierrick Bouvier
Hi, one patch is missing review: [PATCH v5 12/17] hw/xen: add stubs for various functions. Regards, Pierrick On 3/14/25 10:31, Pierrick Bouvier wrote: The main goal of this series is to be able to call any memory ld/st function from code that is *not* target dependent. As a positive side effec

[PATCH v5 17/17] system/ioport: make compilation unit common

2025-03-14 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- system/ioport.c| 1 - system/meson.build | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/system/ioport.c b/system/ioport.c index 55c2a752396..89daae9d602 100644 --- a/system/ioport.c +++ b/system/ioport.

[PATCH v5 13/17] system/physmem: compilation unit is now common to all targets

2025-03-14 Thread Pierrick Bouvier
Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- system/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/meson.build b/system/meson.build index eec07a94513..bd82ef132e7 100644 --- a/system/meson.build +++ b/system/meson.build @@ -3,7 +3,6 @

[PATCH v5 10/17] system/kvm: make kvm_flush_coalesced_mmio_buffer() accessible for common code

2025-03-14 Thread Pierrick Bouvier
This function is used by system/physmem.c will be turn into common code in next commit. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- include/system/kvm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/system/kvm.h b/include/system/kvm.h i

Re: [PATCH 32/37] include/hw/intc: Remove ifndef CONFIG_USER_ONLY from armv7m_nvic.h

2025-03-14 Thread Richard Henderson
On 3/13/25 14:00, Pierrick Bouvier wrote: diff --git a/include/hw/intc/armv7m_nvic.h b/include/hw/intc/armv7m_nvic.h index 89fe8aedaa..7b9964fe7e 100644 --- a/include/hw/intc/armv7m_nvic.h +++ b/include/hw/intc/armv7m_nvic.h @@ -189,21 +189,7 @@ int armv7m_nvic_raw_execution_priority(NVICState *s

Re: [PATCH] host/include/loongarch64: Fix inline assembly compatibility with Clang

2025-03-14 Thread Richard Henderson
On 3/13/25 20:31, Yao Zi wrote: Clang on LoongArch only accepts fp register names in the dollar-prefixed form, while GCC allows omitting the dollar. Change registers in ASM clobbers to the dollar-prefixed form to make user emulators buildable with Clang on loongarch64. No functional change invovl

[PULL 4/4] hw/qxl: fix cpr

2025-03-14 Thread Fabiano Rosas
From: Steve Sistare During normal migration, new QEMU creates and initializes memory regions, then loads the preserved contents of the region from vmstate. During CPR, memory regions are preserved in place, then the realize method initializes the regions contents, losing the old contents. To fi

Re: [PATCH 0/2] gdb invalid memory access handling improvements

2025-03-14 Thread David Hildenbrand
On 14.03.25 08:41, Nicholas Piggin wrote: This adds .debug=1 attribute for GDB's phys mem access mode, adds memory transaction error handling for it so it reports cannot access memory instead of silent success, and silences warning logs for invalid memory access coming from the debugger. Nothin

Re: [PATCH 32/37] include/hw/intc: Remove ifndef CONFIG_USER_ONLY from armv7m_nvic.h

2025-03-14 Thread Pierrick Bouvier
On 3/14/25 13:59, Richard Henderson wrote: On 3/14/25 13:34, Pierrick Bouvier wrote: On 3/14/25 13:03, Richard Henderson wrote: I'm not quite sure what you're arguing for here. A build-time error is vastly preferable to a run-time error. Even though this specific patch is safe (code calling

  1   2   >