]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
3 weeks agohvf: only call hvf_sync_vtimer() when running without the platform vGIC
Mohamed Mediouni [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
hvf: only call hvf_sync_vtimer() when running without the platform vGIC

When running with the Apple vGIC, the EL1 vtimer is handled by the platform.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Reviewed-by: Mads Ynddal <mads@ynddal.dk>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260429190532.26538-7-mohamed@unpredictable.fr
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agohw/arm, target/arm: nested virtualisation on HVF
Mohamed Mediouni [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
hw/arm, target/arm: nested virtualisation on HVF

Add hvf_arm_el2_supported for querying EL2 availability.
An hvf_nested_virt_enable workaround is added as nested virt has
to be enabled early on HVF.

And adds hvf_nested_virt_enabled.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Message-id: 20260429190532.26538-6-mohamed@unpredictable.fr
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm: hvf: instantiate GIC early
Mohamed Mediouni [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
target/arm: hvf: instantiate GIC early

While figuring out a better spot for it, put it in hv_arch_vm_create().

After hv_vcpu_create is documented as too late, and deferring
vCPU initialization isn't enough either.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260429190532.26538-5-mohamed@unpredictable.fr
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agoaccel, hw/arm, include/system/hvf: infrastructure changes for HVF vGIC
Mohamed Mediouni [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
accel, hw/arm, include/system/hvf: infrastructure changes for HVF vGIC

Misc changes needed for HVF vGIC enablement.

Note: x86_64 macOS exposes interrupt controller virtualisation since macOS 12.
Keeping an #ifdef here in case we end up supporting that...

However, given that x86_64 macOS is on its way out, it'll probably (?)
not be supported in QEMU.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Message-id: 20260429190532.26538-4-mohamed@unpredictable.fr
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agohw/intc: arm_gicv3_hvf: save/restore Apple GIC state
Mohamed Mediouni [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
hw/intc: arm_gicv3_hvf: save/restore Apple GIC state

On HVF, some of the GIC state is in an opaque Apple-provided structure.

Save/restore that state to be able to save/restore VMs that use the hardware GIC.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Message-id: 20260429190532.26538-3-mohamed@unpredictable.fr
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agohw/intc: Add hvf vGIC interrupt controller support
Mohamed Mediouni [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
hw/intc: Add hvf vGIC interrupt controller support

This opens up the door to nested virtualisation support.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Message-id: 20260429190532.26538-2-mohamed@unpredictable.fr
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm/kvm: Cache host CPU probe failure
Akihiko Odaki [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
target/arm/kvm: Cache host CPU probe failure

kvm_arm_set_cpu_features_from_host() does not properly handle host CPU
probe failure with caching. The current algorithm can be summarized as
follows:

    If dtb_compatible is not cached:
        If kvm_arm_create_scratch_host_vcpu() fails:
            Report failure

        Cache dtb_compatible

        If getting register values fails:
            Report failure

    Report success

This algorithm has the following problems:

- If kvm_arm_create_scratch_host_vcpu() fails, probing may be repeated.
- If getting register values fails, later invocations incorrectly report
  success.

Make two changes to fix them:

- Cache dtb_compatible whenever a probe is attempted.
- Record probe failure by assigning QEMU_KVM_ARM_TARGET_NONE to
  arm_host_cpu_features.target.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260428-features-v1-1-1841b39da7e6@rsg.ci.i.u-tokyo.ac.jp
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agohw/intc/arm_gicv3: Fix NS write to ICC_AP1Rn_EL1 when prebits < 7
liugan1 [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
hw/intc/arm_gicv3: Fix NS write to ICC_AP1Rn_EL1 when prebits < 7

The existing code uses a blanket `regno < 2` check to make
ICC_AP1R0_EL1 and ICC_AP1R1_EL1 writes from Non-secure code WI
(Write Ignore) when EL3 is present. This is intended to prevent
NS code from claiming active interrupts in the Secure priority
range, which could block Secure interrupt delivery.

However, that check assumes prebits=7 (4 APR registers), where the
NS priority range (128..255) maps entirely to AP1R2/AP1R3. Since
commit 39f29e599355 ("hw/intc/arm_gicv3: Use correct number of
priority bits for the CPU", first in 7.1), all QEMU AArch64 CPUs
are initialised with gic_pribits=5 (one APR register), so NS
priorities map to AP1R0 bits [16:31]. Blanket WI of the entire
AP1R0 register prevents NS code from clearing its own NS active
priority bits. Machines using hw_compat_7_0 (e.g. virt-7.0) still
force pribits=8 via force-8-bit-prio and are therefore unaffected.

A concrete consequence observed in virtualisation scenarios: when
a guest VM acknowledges an SPI interrupt but does not perform EOI,
is force-killed and restarted, the new guest's attempt to clear
the residual active state by writing ICC_AP1R0_EL1=0 is silently
ignored. The running priority (RPR) remains stuck at the old
interrupt's priority, preventing all equal-or-lower priority
interrupts (including timer interrupts) from being delivered, and
hanging the guest.

Fix this by computing the exact Secure/NS boundary within the APR
bank based on prebits. For registers entirely in the Secure range,
keep the WI behaviour. For the register that straddles the
boundary, preserve only the Secure bits while allowing NS bits to
be modified. For registers entirely in the NS range, allow full
write access.

The new logic produces identical behaviour to the old code when
prebits=7, preserving existing behaviour for machines that use
force-8-bit-prio.

Fixes: 39f29e599355 ("hw/intc/arm_gicv3: Use correct number of priority bits for the CPU")
Cc: qemu-stable@nongnu.org
Signed-off-by: liugan1 <liugan1@lixiang.com>
Message-id: 20260428083119.1400110-1-gs_liugan@163.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agohw/net/allwinner-sun8i-emac: Flush queued packets when rx is enabled
宋文武 [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
hw/net/allwinner-sun8i-emac: Flush queued packets when rx is enabled

The RX_CTL_0 register includes the RX_EN receive-enable bit,
which allwinner_sun8i_emac_can_receive() checks. That means that
if the guest sets it we need to call qemu_flush_queued_packets()
as we might now be able to handle them.

This fixes a bug where networking didn't work in u-boot on the
orangepi-pc machine.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3459
Signed-off-by: 宋文武 <iyzsong@member.fsf.org>
Message-id: 20260430040753.3337-1-iyzsong@envs.net
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: expanded commit message, removed unneeded RX_EN test]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agodocs/devel/decodetree: Fix formatting in "field examples" table
Peter Maydell [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
docs/devel/decodetree: Fix formatting in "field examples" table

The rST syntax for a table uses ASCII art to draw the cell
boundaries; then inside each cell the text is treated as a body
element, so it is rendered the same way as text at the top level of a
document.

The "field examples" table was assuming a "literal document" format
for its cell bodies; this meant that the single line cells were being
rendered in plain text, not a fixed width font, and the multi line
cells were rendered as definition-lists because of their "second and
subsequent lines are indented" layout.

Fix this by consistently using inline-code markup for the left column
and literal blocks for the right column.  (We want to be consistent
within each column because a literal block renders differently to
inline-code, with a green background.)

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotests/tcg/aarch64/system/rme_gdi.c: Very basic test of GDI
Jim MacArthur [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
tests/tcg/aarch64/system/rme_gdi.c: Very basic test of GDI

Simply tests GDI's prerequisites; that if GDI is enabled then
so are FEAT_RME and FEAT_RME_GPC2.

Signed-off-by: Jim MacArthur <jim.macarthur@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20260421-jmac-feat_rme_gdi-v3-4-ecd20c77eae1@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm/ptw.c: Add GDI spaces to the granule protection case
Jim MacArthur [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
target/arm/ptw.c: Add GDI spaces to the granule protection case

System Agent, Non-secure Protected and two other GPI field encodings.

These are explicitly denied access for any processing element when
the relevant GPCCR bit is set, and reserved values when the relevant
GPCCR bit is zero.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Jim MacArthur <jim.macarthur@linaro.org>
Message-id: 20260421-jmac-feat_rme_gdi-v3-3-ecd20c77eae1@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm/cpu.h: New GPCCR fields
Jim MacArthur [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
target/arm/cpu.h: New GPCCR fields

Add SA, NSP, NA6, NA7 for GDI and GPCBW for good measure.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Jim MacArthur <jim.macarthur@linaro.org>
Message-id: 20260421-jmac-feat_rme_gdi-v3-2-ecd20c77eae1@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agotarget/arm/cpu-features.c: New fields in AA64MMFR4
Jim MacArthur [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
target/arm/cpu-features.c: New fields in AA64MMFR4

Added RMEGDI for FEAT_RME_GDI and other new fields.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Jim MacArthur <jim.macarthur@linaro.org>
Message-id: 20260421-jmac-feat_rme_gdi-v3-1-ecd20c77eae1@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agoqemu-options: Improve description for -smb option
Pali Rohár [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
qemu-options: Improve description for -smb option

Add #PRE and #NOFNR flags to LMHOSTS example line.
Include information about LMHOSTS path on Windows 3.x.

Windows NT 3.1 requires #NOFNR flag for successful hostname resolving as
described in MS article Q103765 because qemu/smbd does not respond to
netbios name verification queries. #PRE is suggested in that article too
and decrease delay on Windows 3.x for the first connection.

Signed-off-by: Pali Rohár <pali@kernel.org>
[PMM: Expand documentation to note what these flags do, and
 clarify Windows LMHOSTS paths for different Windows versions,
 based on discussion in patch review, fix existing grammar nit]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agolinux-user/arm: Restrict regpairs_aligned
Richard Henderson [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
linux-user/arm: Restrict regpairs_aligned

The function regpairs_aligned is for extracting a 64-bit
quantity from a pair of 32-bit registers and does not
apply to AArch64.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-id: 20260409035015.132370-2-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agoRevert "sysbus: add irq_routing_notifier"
Bernhard Beschow [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
Revert "sysbus: add irq_routing_notifier"

The callback has been introduced in commit 715ca691daca ("sysbus: add
irq_routing_notifier") for use in VFIO platform. Meanwhile, VFIO
platform has been removed via commit 762c85543948 ("vfio: Remove 'vfio-
platform'") which was its only user. Remove this unused code.

This reverts commit 715ca691daca081108b33306faa6fa102f0df8d8.

cc: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Message-id: 20260308203516.160103-6-shentey@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agohw/arm/fsl-imx8mp: Fix parent of ocram memory region
Bernhard Beschow [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
hw/arm/fsl-imx8mp: Fix parent of ocram memory region

Rather than having a NULL parent, let the containing SoC object be the
parent. This cleans up the QOM composition tree a bit.

Fixes: 1aaf3478684f ("hw/arm/fsl-imx8mp: Add on-chip RAM")
cc: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 20260308203516.160103-3-shentey@gmail.com

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agohw/arm/fsl-imx8mp: Do not create redundant unimplemented devices
Bernhard Beschow [Tue, 5 May 2026 08:25:21 +0000 (09:25 +0100)] 
hw/arm/fsl-imx8mp: Do not create redundant unimplemented devices

The GPT devices are implemented. No need to create redundant
unimplemented devices.

Fixes: f8b26121762c ("hw/arm/fsl-imx8mp: Implement general purpose
timers")
cc: Gaurav Sharma <gaurav.sharma_7@nxp.com>
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20260308203516.160103-2-shentey@gmail.com

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
3 weeks agoMerge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
Stefan Hajnoczi [Fri, 1 May 2026 18:41:49 +0000 (14:41 -0400)] 
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

* hw/qdev: Consolidate qdev_get_printable_name() into qdev_get_human_name()
* target/i386: add new models for GMET, MMIO/GDS/RFDS mitigation and MBEC
* whpx improvements
* bump meson to 1.11.1
* tests: add test for json-streamer.c error recovery
* kconfig cleanups
* target/arm/hvf, target/i386/hvf: Pass MR-relative offset to memory_region_set_dirty()

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCgAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmnze1oUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroM1Bgf7BvK8Vvix46/LARl8sxhwSBdz3UfH
# KFq4N8ghUVVCyitghN4iMXvGHSBMJQo3BaV/a24gxGKjmGtYaX1PyR+v5t8HO50W
# 0iyQTjXMxBBEBvxLsGVuGTptcVstM3IbXko9wszOui42qtOqfymGgI628bc4lc5G
# yq8TjyhdEYgFLkafbSlKi8B9wtCcna8DU+Hv5Tfau3pKbtQJpxthdLKPFf0phJky
# Pgb/NdKSXoj97GHMI9IwA6dsqzNELx2Q/Pw0rW00xqYj0juKC0e+dQOeNndA3xFB
# vxCCogOqplP+dQazFxhjIL4FE0wB8QdwK3D544iYsBWCqd4C07OYGR7CWA==
# =v3J9
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 30 Apr 2026 11:55:06 EDT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu: (58 commits)
  whpx: i386: documentation update
  whpx: i386: add SeparateSecurityDomain flag and make default
  whpx: i386: add feature to intercept #GP MSR accesses
  whpx: i386: update migration blocker message
  whpx: i386: set APIC ID only when APIC present
  whpx: xsave support
  target/i386: add de/compaction to xsave_helper
  target/i386: make xsave_buf present unconditionally
  target/i386: emulate: use exception_payload for fault address
  whpx: i386: Pause VM on fatal exception to be able to inspect state
  whpx: i386: set WHvX64RegisterInitialApicId
  whpx: i386: some x2APIC awareness
  whpx: i386: add HV_X64_MSR_GUEST_IDLE when !kernel-irqchip
  target: i386: HLT type that ignores EFLAGS.IF
  whpx: i386: ignore vpassist when kernel-irqchip=off
  whpx: i386: tighten APIC base validity check
  target/i386: emulate, hvf: rdmsr/wrmsr GPF handling
  whpx: i386: don't increment eip on MSR access raising GPF
  whpx: i386: unknown MSR configurability
  whpx: i386: enable GuestIdleReg enlightenment
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
3 weeks agoMerge tag 's390x-20260430' of https://gitlab.com/cohuck/qemu into staging
Stefan Hajnoczi [Fri, 1 May 2026 18:41:37 +0000 (14:41 -0400)] 
Merge tag 's390x-20260430' of https://gitlab.com/cohuck/qemu into staging

First batch of s390x updates for 11.1:
- disable legacy virtio-pci from now on by default (did not work anyway)
- add a new boot test
- simplifications and cleanups

# -----BEGIN PGP SIGNATURE-----
#
# iIgEABYKADAWIQRpo7U29cv8ZSCAJsHeiLtWQd5mwQUCafN76BIcY29odWNrQHJl
# ZGhhdC5jb20ACgkQ3oi7VkHeZsF/wQD/e47lpTFAt0YPXQbQsAoDKKRXc5XKfxvn
# ToE/FECxBiUBALEqCh2xDaF8DVb5H18CcNocS/IEoAOV4/W3h4q+no4J
# =1KeS
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 30 Apr 2026 11:57:28 EDT
# gpg:                using EDDSA key 69A3B536F5CBFC65208026C1DE88BB5641DE66C1
# gpg:                issuer "cohuck@redhat.com"
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [unknown]
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [unknown]
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
#      Subkey fingerprint: 69A3 B536 F5CB FC65 2080  26C1 DE88 BB56 41DE 66C1

* tag 's390x-20260430' of https://gitlab.com/cohuck/qemu:
  tests/functional/s390x: Update expected virtio-pci IDs
  hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)
  MAINTAINERS: Update s390 trees
  target/s390x: Prefer MO_128 definition over magic value
  tests/functional/s390x: Add test for booting from a disk with 4k sectors
  configs/targets: Restrict the legacy ldst_phys() API on s390x target
  target/s390x: Replace legacy ld/st_phys -> address_space_ld/st (kvm)
  target/s390x: Replace legacy ld/st_phys -> address_space_ld/st (tcg)
  target/s390x: Replace legacy ld/st_phys -> address_space_ld/st (mmu)
  target/s390x: Replace legacy ld/st_phys -> address_space_ld/st (cpu)
  target/s390x/kvm: Simplify the async pfault handling code

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4 weeks agowhpx: i386: documentation update
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:25 +0000 (23:42 +0200)] 
whpx: i386: documentation update

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-38-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: add SeparateSecurityDomain flag and make default
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:24 +0000 (23:42 +0200)] 
whpx: i386: add SeparateSecurityDomain flag and make default

For workloads where isolation is less important, -accel whpx,ssd=off
will provide significantly higher MMIO performance.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-37-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: add feature to intercept #GP MSR accesses
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:22 +0000 (23:42 +0200)] 
whpx: i386: add feature to intercept #GP MSR accesses

It turns out they're not that uncommon, so have
a feature around to log those.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-35-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: update migration blocker message
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:19 +0000 (23:42 +0200)] 
whpx: i386: update migration blocker message

Quite a part of it is from older times...

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-32-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: set APIC ID only when APIC present
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:18 +0000 (23:42 +0200)] 
whpx: i386: set APIC ID only when APIC present

-M isapc doesn't have an APIC

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-31-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: xsave support
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:17 +0000 (23:42 +0200)] 
whpx: xsave support

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-30-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agotarget/i386: add de/compaction to xsave_helper
Magnus Kulke [Wed, 22 Apr 2026 21:42:16 +0000 (23:42 +0200)] 
target/i386: add de/compaction to xsave_helper

HyperV use XSAVES which stores extended state in compacted format in
which components are packed contiguously, while QEMU's internal XSAVE
representation use the standard format in which each component is places
at a fixed offset. Hence for this purpose we add two conversion fn's to
the xsave helper to roundtrip XSAVE state in a migration.

- decompact_xsave_area(): converts compacted format to standard.
  XSTATE_BV is masked to host XCR0 since IA32_XSS is managed
  by the hypervisor.

- compact_xsave_area(): converts standard format back to compacted
  format. XCOMP_BV is set from the host's CPUID 0xD.0 rather than the
  guest's XCR0, as this is what the hypervisor expects.

Both functions use the host's CPUID leaf 0xD subleaves to determine component
sizes, offsets, and alignment requirements.

There are situations when the host advertises features that we want to
disable for the guest, e.g. AMX TILE. In this case we cannot rely on the
host's xcr0, but instead we use the feature mask that has been generated
in as part of the CPU realization process (x86_cpu_expand_features).

Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com>
[Fixup: made xsave_offset a size_t to fix macOS and OpenBSD builds]

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-29-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agotarget/i386: make xsave_buf present unconditionally
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:15 +0000 (23:42 +0200)] 
target/i386: make xsave_buf present unconditionally

This is necessary for the xsave_helper helpers to compile.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-28-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agotarget/i386: emulate: use exception_payload for fault address
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:14 +0000 (23:42 +0200)] 
target/i386: emulate: use exception_payload for fault address

Instead of directly putting it in cr[2], put it in exception_payload.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-27-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: Pause VM on fatal exception to be able to inspect state
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:13 +0000 (23:42 +0200)] 
whpx: i386: Pause VM on fatal exception to be able to inspect state

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-26-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: set WHvX64RegisterInitialApicId
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:12 +0000 (23:42 +0200)] 
whpx: i386: set WHvX64RegisterInitialApicId

Keep Hyper-V aware of the initial APIC ID chosen.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-25-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: some x2APIC awareness
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:11 +0000 (23:42 +0200)] 
whpx: i386: some x2APIC awareness

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-24-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: add HV_X64_MSR_GUEST_IDLE when !kernel-irqchip
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:10 +0000 (23:42 +0200)] 
whpx: i386: add HV_X64_MSR_GUEST_IDLE when !kernel-irqchip

Add support for an oddball HV_X64_MSR_GUEST_IDLE not-quite-an-HLT
that wakes the vCPU even if EFLAGS.IF is set.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-23-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agotarget: i386: HLT type that ignores EFLAGS.IF
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:09 +0000 (23:42 +0200)] 
target: i386: HLT type that ignores EFLAGS.IF

The TLFS says:

> A partition which possesses the AccessGuestIdleMsr privilege may trigger
> entry into the virtual processor idle sleep state through a read to the
> hypervisor-defined MSR HV_X64_MSR_GUEST_IDLE. The virtual processor will
> be woken when an interrupt arrives, regardless of whether the interrupt
> is enabled on the virtual processor or not.

Meanwhile, Windows 24H2+ calls this MSR anyway without the privilege being set.

Add the infrastructure to support it on the generic QEMU side.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-22-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: ignore vpassist when kernel-irqchip=off
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:08 +0000 (23:42 +0200)] 
whpx: i386: ignore vpassist when kernel-irqchip=off

Linux tries to set vpassist even when none of the enlightenments
using it are available.

So ignore the page it sets.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-21-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: tighten APIC base validity check
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:07 +0000 (23:42 +0200)] 
whpx: i386: tighten APIC base validity check

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-20-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agotarget/i386: emulate, hvf: rdmsr/wrmsr GPF handling
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:21 +0000 (23:42 +0200)] 
target/i386: emulate, hvf: rdmsr/wrmsr GPF handling

In that case, the instruction pointer mustn't be incremented.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-34-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: don't increment eip on MSR access raising GPF
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:20 +0000 (23:42 +0200)] 
whpx: i386: don't increment eip on MSR access raising GPF

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-33-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: unknown MSR configurability
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:05 +0000 (23:42 +0200)] 
whpx: i386: unknown MSR configurability

Add an option to inject back a GPF for unknown MSRs.

Keep it on by default for now as Linux expects accesses to some
AMD-specific MSRs to always succeed when on an AMD host.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-18-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: enable GuestIdleReg enlightenment
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:06 +0000 (23:42 +0200)] 
whpx: i386: enable GuestIdleReg enlightenment

This corresponds to HV_X64_MSR_GUEST_IDLE (0x400000f0).

This enlightenment is only available by the HV when using the Hyper-V LAPIC.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-19-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: set apicbase value only on success
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:04 +0000 (23:42 +0200)] 
whpx: i386: set apicbase value only on success

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-17-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: fix CPUID[1:EDX].APIC reporting
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:03 +0000 (23:42 +0200)] 
whpx: i386: fix CPUID[1:EDX].APIC reporting

Hyper-V always has CPUID[1:EDX].APIC set, even when the APIC isn't enabled yet.

Work around this by also using the APICBASE trap for kernel-irqchip=on.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-16-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agohw/intc: apic: disallow APIC reads when disabled
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:02 +0000 (23:42 +0200)] 
hw/intc: apic: disallow APIC reads when disabled

!APICBASE_ENABLE + attempting to read xAPIC registers is not an allowed combination.

And neither is x2APIC enabled + attempting to read xAPIC registers

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-15-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: interrupt priority support
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:01 +0000 (23:42 +0200)] 
whpx: i386: interrupt priority support

Implement APIC IRR interrupt priorities.

Even with kernel-irqchip=off, Hyper-V is aware of interrupt priorities
and implements CR8/TPR, with the InterruptPriority field being followed.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-14-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: disable enlightenments and LAPIC for isapc
Mohamed Mediouni [Wed, 22 Apr 2026 21:42:00 +0000 (23:42 +0200)] 
whpx: i386: disable enlightenments and LAPIC for isapc

The isapc machine doesn't have an APIC. And Hyper-V enlightenments
don't sound too useful to have there so disable those.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-13-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: IO port fast path cleanup
Mohamed Mediouni [Wed, 22 Apr 2026 21:41:59 +0000 (23:41 +0200)] 
whpx: i386: IO port fast path cleanup

vmport calls synchronise_state within an I/O port read.
Support that properly.

What was there before worked because of a side effect of
whpx_get_reg synchronising context if cpu->vcpu_dirty.

Remove that whpx_get_reg call in whpx_bump_rip too as it's no longer
needed now.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-12-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: disable kernel-irqchip on Windows 10 when PIC enabled
Mohamed Mediouni [Wed, 22 Apr 2026 21:41:58 +0000 (23:41 +0200)] 
whpx: i386: disable kernel-irqchip on Windows 10 when PIC enabled

Move WHvCapabilityCodeProcessorPerfmonFeatures queries
as that's how we distinguish if on a legacy OS.

Now that Windows guests are booting, disable kernel-irqchip=on
by default for Windows 10 when the PIC is enabled.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-11-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: use WHvX64RegisterCr8 only when kernel-irqchip=off
Mohamed Mediouni [Wed, 22 Apr 2026 21:41:57 +0000 (23:41 +0200)] 
whpx: i386: use WHvX64RegisterCr8 only when kernel-irqchip=off

When kernel-irqchip=on, manage TPR as part of the APIC state instead entirely.

This fixes some failure to set state errors.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-10-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: kernel-irqchip=off fixes
Mohamed Mediouni [Wed, 22 Apr 2026 21:41:56 +0000 (23:41 +0200)] 
whpx: i386: kernel-irqchip=off fixes

This was really... quite broken. After fixing this,
Windows boots with kernel-irqchip=off.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-9-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: introduce proper cpuid support
Mohamed Mediouni [Wed, 22 Apr 2026 21:41:55 +0000 (23:41 +0200)] 
whpx: i386: introduce proper cpuid support

Unlike the implementation in QEMU 10.2, this one works.

It's not optimal though as it doesn't use the Hyper-V support for this.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-8-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: reintroduce enlightenments for Windows 10
Mohamed Mediouni [Wed, 22 Apr 2026 21:41:54 +0000 (23:41 +0200)] 
whpx: i386: reintroduce enlightenments for Windows 10

Was removed in 2c08624 but it's still useful for
Windows 10 so reintroduce it there.

And this time, actually make it work by reporting
the hypervisor bit in CPUID.

Pretend to be vmware to be able to use vmport's functionality.

If the vmware frequency leaf is disabled, pretend to be
KVM, with the only capability reported being X2APIC support.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-7-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: enable x2apic by default for user-mode LAPIC
Mohamed Mediouni [Wed, 22 Apr 2026 21:41:53 +0000 (23:41 +0200)] 
whpx: i386: enable x2apic by default for user-mode LAPIC

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-6-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: disable TbFlushHypercalls for emulated LAPIC
Mohamed Mediouni [Wed, 22 Apr 2026 21:41:52 +0000 (23:41 +0200)] 
whpx: i386: disable TbFlushHypercalls for emulated LAPIC

AccessHypercallRegs was present twice so clean that up.

Remove TbFlushHypercalls (and its extended Gva range sub-feature)
from the user-mode LAPIC case as it behaves oddly there.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-5-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: wire up feature probing
Mohamed Mediouni [Wed, 22 Apr 2026 21:41:51 +0000 (23:41 +0200)] 
whpx: i386: wire up feature probing

Windows 10 doesn't have the API for this, so using this
only for Windows 11.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-4-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agowhpx: i386: x2apic emulation
Mohamed Mediouni [Wed, 22 Apr 2026 21:41:50 +0000 (23:41 +0200)] 
whpx: i386: x2apic emulation

Add x2apic emulation to WHPX for the kernel-irqchip=off case.

Unfortunately, it looks like there isn't a workaround available
for proper behavior of PIC interrupts when kernel-irqchip=on
for Windows 10. The OS is out of support outside of extended
security updates so this will not be addressed.

The performance boost is quite visible for multicore guests.

Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Link: https://lore.kernel.org/r/20260422214225.2242-3-mohamed@unpredictable.fr
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agotarget/i386: add new Intel models for MBEC enablement
Jon Kohler [Mon, 30 Mar 2026 19:34:28 +0000 (12:34 -0700)] 
target/i386: add new Intel models for MBEC enablement

Add models to expose Mode Based Execute Control (MBEC) support, which
is a Skylake++ feature.

Note: Future models can use VMX_SECONDARY_EXEC_MODE_BASED_EPT_EXEC to
easily add default support.

New models are:
- Skylake-Server-v6
- Cascadelake-Server-v7
- Icelake-Server-v9
- SapphireRapids-v8
- GraniteRapids-v7
- DiamondRapids-v2
- SierraForest-v6
- ClearwaterForest-v4

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
Link: https://lore.kernel.org/r/20260330193428.1663253-4-jon@nutanix.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agotarget/i386: add new Intel models for MMIO/GDS/RFDS mitigation status
Jon Kohler [Mon, 30 Mar 2026 19:34:27 +0000 (12:34 -0700)] 
target/i386: add new Intel models for MMIO/GDS/RFDS mitigation status

Add new bits to ARCH_CAPABILITIES MSR to enumerate the status of the
MMIO/GDS/RFDS mitigations on Cascade Lake, Ice Lake, Sapphire Rapids,
and Granite Rapids processors.

These have been advertised in Intel microcode updates for a while now,
but require user space to opt in to advertise them to guests.

New models are:
- Cascadelake-Server-v6
- Icelake-Server-v8
- SapphireRapids-v7 (note, already got MMIO fixes on commit [1])
- GraniteRapids-v6

[1] 3baf7ae63505 ("target/i386: Add few security fix bits in
                   ARCH_CAPABILITIES into SapphireRapids CPU model")

Cc: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Cc: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
Link: https://lore.kernel.org/r/20260330193428.1663253-3-jon@nutanix.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agotarget/i386: add new AMD EPYC models for GMET enablement
Jon Kohler [Mon, 30 Mar 2026 19:34:26 +0000 (12:34 -0700)] 
target/i386: add new AMD EPYC models for GMET enablement

Add models to expose Guest Mode Execute Trap (GMET) support,
and add CPUID_SVM_GMET header definition so that future EPYC
models can easily add default support.

New models are:
AMD EPYC-Milan-v4
AMD EPYC-Genoa-v3
AMD EPYC-Turin-v2

Cc: Babu Moger <babu.moger@amd.com>
Cc: Nikunj A Dadhania <nikunj@amd.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jon Kohler <jon@nutanix.com>
Link: https://lore.kernel.org/r/20260330193428.1663253-2-jon@nutanix.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agohw/qdev: Consolidate qdev_get_printable_name() into qdev_get_human_name()
Alessandro Ratti [Sat, 21 Mar 2026 10:04:05 +0000 (11:04 +0100)] 
hw/qdev: Consolidate qdev_get_printable_name() into qdev_get_human_name()

Rename qdev_get_printable_name() to qdev_get_human_name(), remove
the old qdev_get_human_name() implementation, and switch the three
qdev_get_printable_name() callers in hw/virtio/virtio.c.

qdev_get_printable_name() subsumes qdev_get_human_name(): both
return the device ID when set and fall back to the canonical QOM
path, but qdev_get_printable_name() also tries the bus-specific
path first, providing more informative output.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Alessandro Ratti <alessandro@0x65c.net>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Link: https://lore.kernel.org/r/20260321100405.1525059-4-alessandro@0x65c.net
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agohw/qdev: Prefix bus type in qdev_get_printable_name() device paths
Alessandro Ratti [Sat, 21 Mar 2026 10:04:04 +0000 (11:04 +0100)] 
hw/qdev: Prefix bus type in qdev_get_printable_name() device paths

Raw get_dev_path() output (e.g. "0000:00:04.0", "/1") is ambiguous
without knowing which bus produced it. Prefix the path with the bus
type name so error messages become self-describing.

Examples:
  - PCIE device 0000:00:04.0
  - virtio-pci-bus device 0000:00:03.0

Suggested-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Alessandro Ratti <alessandro@0x65c.net>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Link: https://lore.kernel.org/r/20260321100405.1525059-3-alessandro@0x65c.net
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agohw/qdev: Clarify fallback order in qdev_get_printable_name()
Alessandro Ratti [Sat, 21 Mar 2026 10:04:03 +0000 (11:04 +0100)] 
hw/qdev: Clarify fallback order in qdev_get_printable_name()

Replace the uninformative "<unknown device>" final fallback with the
canonical QOM path (e.g. /machine/peripheral-anon/device[0]).

Also clean up comments to accurately describe qdev_get_dev_path()
behavior, drop an unnecessary comment on the dev->id check, and rename
the @vdev parameter to @dev for consistency with surrounding code.

Update the doc comment in qdev.h to reflect the new fallback chain.

Signed-off-by: Alessandro Ratti <alessandro@0x65c.net>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Link: https://lore.kernel.org/r/20260321100405.1525059-2-alessandro@0x65c.net
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agominikconf: add mypy annotations
Paolo Bonzini [Fri, 24 Apr 2026 09:37:14 +0000 (11:37 +0200)] 
minikconf: add mypy annotations

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agominikconf: replace else with early return and avoid unnecessary else
Paolo Bonzini [Thu, 30 Apr 2026 08:59:17 +0000 (10:59 +0200)] 
minikconf: replace else with early return and avoid unnecessary else

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agominikconf: remove unnecessary semicolons
Paolo Bonzini [Thu, 30 Apr 2026 08:54:16 +0000 (10:54 +0200)] 
minikconf: remove unnecessary semicolons

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agominikconf: pull main program into a function
Paolo Bonzini [Thu, 30 Apr 2026 08:56:49 +0000 (10:56 +0200)] 
minikconf: pull main program into a function

Avoid pulluting the global namespace.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agotests/functional/s390x: Update expected virtio-pci IDs
Matthew Rosato [Fri, 24 Apr 2026 13:27:03 +0000 (09:27 -0400)] 
tests/functional/s390x: Update expected virtio-pci IDs

Now that legacy virtio-pci is disabled by default for s390x, adjust
existing testcases to look for appropriate device IDs.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20260424132703.833249-1-mjrosato@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4 weeks agohw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)
Jaehoon Kim [Mon, 20 Apr 2026 14:47:34 +0000 (09:47 -0500)] 
hw/s390x/ccw: Disable legacy virtio-pci by default (v11.1+)

On the s390 Linux kernel, IO_SPACE_LIMIT has been 0 since the initial
zPCI implementation (commit cd24834130ac "s390/pci: base support"),
making I/O BARs unusable.

However, when virtio-pci devices operate in transitional mode, QEMU
unconditionally exposes the legacy interface via BAR0. This results in
firmware warnings during PCI enumeration, such as:

  pci 0005:00:00.0: [Firmware Bug]: BAR 0: invalid; can't size

even though BAR0 is never usable on the s390 kernel.

Close this gap by disabling legacy virtio-pci support starting from
machine version 11.1. This effectively makes virtio-pci devices
non-transitional and prevents the creation of the unusable legacy I/O
BAR.

This introduces s390x-specific global compatibility properties that
set disable-legacy=on as the default for virtio-pci devices. Machine
versions v11.0 and earlier set disable-legacy=off to maintain their
original default behavior (legacy support enabled), ensuring VMs
created with those versions continue to work identically.

Users can override the default on the command line if needed:
  - On v11.1+: -global virtio-pci.disable-legacy=off (to enable legacy)
  - On v11.0-: -global virtio-pci.disable-legacy=on (to disable legacy)

Signed-off-by: Jaehoon Kim <jhkim@linux.ibm.com>
Reviewed-by: Mohamed Mediouni <mohamed@unpredictable.fr>
Reviewed-by: Halil Pasic <pasic@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20260420144759.2970726-2-jhkim@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4 weeks agoMAINTAINERS: Update s390 trees
Eric Farman [Fri, 17 Apr 2026 15:22:36 +0000 (17:22 +0200)] 
MAINTAINERS: Update s390 trees

Move Cornelia's git tree from virtio-ccw to the overall
s390 architecture group, since all the subgroups funnel
up through that.

Remove Christian's tree from the subgroups, since they are
not specified consistently across areas but also haven't
been used in ~6 years.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Acked-by: Halil Pasic <pasic@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Message-ID: <20260417152236.1305333-2-farman@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4 weeks agotarget/s390x: Prefer MO_128 definition over magic value
Philippe Mathieu-Daudé [Wed, 15 Apr 2026 22:03:57 +0000 (00:03 +0200)] 
target/s390x: Prefer MO_128 definition over magic value

The MO_128 definition was not existing when commit 6d841663be8
("s390x/tcg: Implement VECTOR GATHER ELEMENT") introduced the
ES_128 definition. It was added 2 years later in commit 4b473e0c60d
("tcg: Expand MO_SIZE to 3 bits"). Since it is now available,
replace the magic '4' by the more explicit 'MO_128'.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Message-ID: <20260415220358.93063-1-philmd@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4 weeks agotests/functional/s390x: Add test for booting from a disk with 4k sectors
Thomas Huth [Mon, 23 Mar 2026 17:14:23 +0000 (18:14 +0100)] 
tests/functional/s390x: Add test for booting from a disk with 4k sectors

The DASD disks on s390x have a different sector size (4k) and use
a different layout of the boot loader data compared to the usual
"SCSI"-style disks with 512 sectors that are used with most modern
guests. To make sure that there are no regressions with 4k disk
booting, add a test case that uses a disk image with these 4k sectors
and check that we can successfully show the boot menu and and load the
right kernel in all supported cases.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Message-ID: <20260323171423.112205-1-thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4 weeks agoconfigs/targets: Restrict the legacy ldst_phys() API on s390x target
Philippe Mathieu-Daudé [Thu, 19 Mar 2026 18:52:03 +0000 (19:52 +0100)] 
configs/targets: Restrict the legacy ldst_phys() API on s390x target

The s390x target doesn't use the legacy ldst_phys() API anymore.
Set the TARGET_NOT_USING_LEGACY_LDST_PHYS_API variable to hide
the legacy API to the qemu-system-loongarch64 binary, avoiding
further API uses to creep in.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20260319185203.11799-6-philmd@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4 weeks agotarget/s390x: Replace legacy ld/st_phys -> address_space_ld/st (kvm)
Philippe Mathieu-Daudé [Thu, 19 Mar 2026 18:52:02 +0000 (19:52 +0100)] 
target/s390x: Replace legacy ld/st_phys -> address_space_ld/st (kvm)

Prefer the address_space_ld/st API over the legacy ld_phys()
because it allow checking for bus access fault.
This code however doesn't check for fault, so we simply inline
the calls (not specifying any memory transaction attribute nor
expecting transation result). No logical change intended.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20260319185203.11799-5-philmd@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4 weeks agotarget/s390x: Replace legacy ld/st_phys -> address_space_ld/st (tcg)
Philippe Mathieu-Daudé [Thu, 19 Mar 2026 18:52:01 +0000 (19:52 +0100)] 
target/s390x: Replace legacy ld/st_phys -> address_space_ld/st (tcg)

Prefer the address_space_ld/st API over the legacy ld_phys()
because it allow checking for bus access fault.
This code however doesn't check for fault, so we simply inline
the calls (not specifying any memory transaction attribute nor
expecting transation result). No logical change intended.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20260319185203.11799-4-philmd@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4 weeks agotarget/s390x: Replace legacy ld/st_phys -> address_space_ld/st (mmu)
Philippe Mathieu-Daudé [Thu, 19 Mar 2026 18:52:00 +0000 (19:52 +0100)] 
target/s390x: Replace legacy ld/st_phys -> address_space_ld/st (mmu)

Prefer the address_space_ld/st API over the legacy ld_phys()
because it allow checking for bus access fault.
This code however doesn't check for fault, so we simply inline
the calls (not specifying any memory transaction attribute nor
expecting transation result). No logical change intended.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20260319185203.11799-3-philmd@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4 weeks agotarget/s390x: Replace legacy ld/st_phys -> address_space_ld/st (cpu)
Philippe Mathieu-Daudé [Thu, 19 Mar 2026 18:51:59 +0000 (19:51 +0100)] 
target/s390x: Replace legacy ld/st_phys -> address_space_ld/st (cpu)

Prefer the address_space_ld/st API over the legacy ld_phys()
because it allow checking for bus access fault.
This code however doesn't check for fault, so we simply inline
the calls (not specifying any memory transaction attribute nor
expecting transation result). No logical change intended.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-ID: <20260319185203.11799-2-philmd@linaro.org>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4 weeks agotarget/s390x/kvm: Simplify the async pfault handling code
Thomas Huth [Tue, 17 Mar 2026 13:45:31 +0000 (14:45 +0100)] 
target/s390x/kvm: Simplify the async pfault handling code

Since commit 126e7f78036 ("kvm: require KVM_CAP_IOEVENTFD and
KVM_CAP_IOEVENTFD_ANY_LENGTH") we require at least kernel v4.4 to
be able to use KVM. KVM_CAP_ASYNC_PF is available in the kernel
since v3.15 and KVM_SYNC_PFAULT is available since kernel v3.18,
so we can assume now that they are available in all supported
kernels. Thus simplify the code a little bit by removing the
checks for these features.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Message-ID: <20260317134531.460141-1-thuth@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
4 weeks agoMerge tag 'linux-user-next-pull-request' of https://github.com/hdeller/qemu-hppa...
Stefan Hajnoczi [Thu, 30 Apr 2026 14:33:15 +0000 (10:33 -0400)] 
Merge tag 'linux-user-next-pull-request' of https://github.com/hdeller/qemu-hppa into staging

Pull request for linux-user

Please pull 4 fixes for the linux-user target.
Two patches fix open bug reports regarding return error codes and allowed parameters.
One adds missing CDROM ioctls (and fixes a few), and the last patch is a leftover
from the previous pull request and helps flushing error strings at exit.

# -----BEGIN PGP SIGNATURE-----
#
# iHUEABYKAB0WIQS86RI+GtKfB8BJu973ErUQojoPXwUCafMCcAAKCRD3ErUQojoP
# XxaVAPsEXGQiK8DSTXx6h0FQ8wUkhCTOXCECVTjydYhk2kA0BwD+PXXBaODFLJwR
# b2Mtt0A7il8W5Iclvy/FCa6Pkm9vFw4=
# =zPZb
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 30 Apr 2026 03:19:12 EDT
# gpg:                using EDDSA key BCE9123E1AD29F07C049BBDEF712B510A23A0F5F
# gpg: Good signature from "Helge Deller <deller@gmx.de>" [unknown]
# gpg:                 aka "Helge Deller <deller@kernel.org>" [unknown]
# gpg:                 aka "Helge Deller <deller@debian.org>" [unknown]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 4544 8228 2CD9 10DB EF3D  25F8 3E5F 3D04 A7A2 4603
#      Subkey fingerprint: BCE9 123E 1AD2 9F07 C049  BBDE F712 B510 A23A 0F5F

* tag 'linux-user-next-pull-request' of https://github.com/hdeller/qemu-hppa:
  linux-user: Translate errno in IP_RECVERR and IPV6_RECVERR
  linux-user: Allow getsockopt() with NULL optval address
  linux-user: Flush errors by using exit() instead of _exit() in error path
  linux-user: Add missing CDROM ioctls

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4 weeks agoMerge tag 'pull-fpu-20260430' of https://gitlab.com/rth7680/qemu into staging
Stefan Hajnoczi [Thu, 30 Apr 2026 14:32:40 +0000 (10:32 -0400)] 
Merge tag 'pull-fpu-20260430' of https://gitlab.com/rth7680/qemu into staging

fpu: Drop PARTS_GENERIC_64_128{_256}
fpu: Drop FRAC_GENERIC_64_128{_256}
fpu: Constify frac{64,128,256}_* inputs
fpu: Return struct from *_unpack_canonical
fpu: Inline some *_unpack_raw into only caller
fpu: Change parts_float_to_float_narrow to parts128_to_parts64
fpu: Change parts_float_to_float_widen to parts64_to_parts128

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmnyhOMdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV864AgAjMAhRH1SfqWPr2yK
# 9hTvgA579zN1UmadpdQ/5RQp/XFx4h7n35vozI1pJTsgbNtnNR3VJFC7ORN6IlBU
# 3nL0TlRzmXTlW8jhdaVF3RJzTjoYuo4of+Q3RTmJ4gibxnmENkkPHOwLjFRFioxn
# X2Ae6bjZ+SXwRJh2bt/WpMs2npz+hkmGAmwmuNT1VD/x1VWNG6QTQPg10JLS623t
# OGqAdLzXRwb8hWQR/eJjTZgSjTRKFi7O3ty1GMlLrLvdQYa7MkfbSexda6mVqiaj
# MHMe6eFlPHv6wUR5Qzh4h1f/fPKIE/GndEahkUq2ztcFgrY3Yo3Fb9OYbOGvzNvF
# tU7piA==
# =6hiS
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 29 Apr 2026 18:23:31 EDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* tag 'pull-fpu-20260430' of https://gitlab.com/rth7680/qemu: (48 commits)
  fpu: Change parts_float_to_float_widen to parts64_to_parts128
  fpu: Change parts_float_to_float_narrow to parts128_to_parts64
  fpu: Return struct from float128_unpack_canonical
  fpu: Return struct from float128_unpack_raw
  fpu: Inline floatx80_unpack_raw into only caller
  fpu: Return struct from float{32,64}_unpack_canonical
  fpu: Inline float64_unpack_raw into callers
  fpu: Inline float32_unpack_raw into callers
  fpu: Return struct from bfloat16_unpack_canonical
  fpu: Inline bfloat16_unpack_raw into callers
  fpu: Return struct from float16_unpack_canonical
  fpu: Return struct from float16a_unpack_canonical
  fpu: Inline float16_unpack_raw into callers
  fpu: Return struct from float8_e5m2_unpack_canonical
  fpu: Return struct from float8_e4m3_unpack_canonical
  fpu: Return struct from float4_e2m1_unpack_canonical
  fpu: Return structure from unpack_raw64
  fpu: Constify frac{64,128,256}_* inputs
  fpu: Drop FRAC_GENERIC_64_128{_256}
  fpu: Drop PARTS_GENERIC_64_128{_256}
  ...

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4 weeks agoMerge tag 'pull-tcg-20260430' of https://gitlab.com/rth7680/qemu into staging
Stefan Hajnoczi [Thu, 30 Apr 2026 14:32:04 +0000 (10:32 -0400)] 
Merge tag 'pull-tcg-20260430' of https://gitlab.com/rth7680/qemu into staging

tcg/aarch64: Replacement of I3XXX names
tcg: Remove unused tcg_gen_vec_*_tl() API

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmnyfxsdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV8AJgf/bYQEtR4XwF/MOZOQ
# Iim8OtnqEzXcs2KlmO18s/osMEs4ARn2XGqimY+dILfKC5E5Mxx5pyPEh0a+X/fm
# UuLXEuQ0NvsuTHfJt2fo9VTtHC7gyN2tIZUbcwGgWq19Ht9h+lVZw4oskBpmXziO
# Nke6nzbh2QGZvlkruyyUYuXwFo8tE5jznBcVKg+aVEkRWGYBAAcYlnFpdjKTxCCt
# jIdxGytk5HgNaUrylKd41vSqW88Ajtwo6l68g3BppdD+QFBJ8a3kUDh32tFswdjL
# hdEgR9HyblRCuVfpDejRJrBJvYR2wzF3yZc6KAF6QQ+B8tvzCg0h+IcKCAauU7FO
# rRj7dw==
# =RF1H
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 29 Apr 2026 17:58:51 EDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* tag 'pull-tcg-20260430' of https://gitlab.com/rth7680/qemu:
  tcg: Remove unused tcg_gen_vec_*_tl() API
  tcg/aarch64/tcg-target.c.inc: Manual replace of I3310, I3313
  tcg/aarch64/tcg-target.c.inc: Replacement of I3XXX names

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4 weeks agoMerge tag 'pull-ppc-for-11.1-20260429' of https://gitlab.com/harshpb/qemu into staging
Stefan Hajnoczi [Thu, 30 Apr 2026 14:30:58 +0000 (10:30 -0400)] 
Merge tag 'pull-ppc-for-11.1-20260429' of https://gitlab.com/harshpb/qemu into staging

PPC PR for 11.1

* MPIPL support for PowerNV
* ppc/pnv: Add a nest MMU model
* hw/ssi/pnv_spi: Fix fifo8 memory leak on unrealize
* hw/intc/xics: Add a check for an invalid server id

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEa4EM1tK+EPOIPSFCRUTplPnWj7sFAmnySUMACgkQRUTplPnW
# j7veug/9ERfiOVoFLe9qYY+IRlAI7yWwieTW7gW1huXstcshk6e3y1tXH43DakE4
# CAN5hzqBo/iUwgx7QaSgQUxtOU4waLURkBFWQUQ0syZcKKIg2rENELm4VN6GJunz
# L5JOs0/55lcdLHCb4lJIhuW4AlYuVWYEzC9kGQD4dyliv7b9VygPnaYwWrmOM8KF
# BiPXumDpbBJAwqnuMec08x6IU/I8CGyJuj6pbsPbL4XAVKfXmB5xM3zbK2gUUhky
# cpD9AzdvPpeMCJCWwijYq3/s6ZqH4E4HrpEWqS8vVeorTvA4069bPw4ZBj6CFeJN
# V1WvTMOukTwC4u6QMKnjrIaoKgIvtvHtSCTTdy6QhfMQxmguksAGMeoIDqKDLlQu
# povwybYGh9viASpyPNaqkVM//ni1C68/rhsQ2wSk75f/D706M1JjGkTmAHclZRl3
# xWiw3LxkGNka2BRWkfJCP+e7ntK4+k9j/kGwnLDTn870c7CcYO6bUiBdrNbqvWcP
# 5Rg5NeZeAc7caHZL+Zju28V2ntGdR+9dPyynDSliDJvUzb/biOdVLFfAZzD9rwYT
# 0yeLahsIlG2CQpr4LmmrQa7si+ZrYDHEUf3mjNPVS3rEDpdaso+TnSzulsYguIEM
# fcmyhVw4cYqhaxn+nKpVQGfF/MQZfOHDmVi2DoEiTXr6xxTzLwc=
# =Y8PU
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 29 Apr 2026 14:09:07 EDT
# gpg:                using RSA key 6B810CD6D2BE10F3883D21424544E994F9D68FBB
# gpg: Good signature from "Harsh Prateek Bora <harsh.prateek.bora@gmail.com>" [full]
# gpg:                 aka "Harsh Prateek Bora <harshpb@linux.ibm.com>" [full]
# Primary key fingerprint: 6B81 0CD6 D2BE 10F3 883D  2142 4544 E994 F9D6 8FBB

* tag 'pull-ppc-for-11.1-20260429' of https://gitlab.com/harshpb/qemu:
  hw/intc/xics: Add a check for an invalid server id
  ppc/pnv: Add a nest MMU model
  hw/ssi/pnv_spi: Fix fifo8 memory leak on unrealize
  MAINTAINERS: Add entry for MPIPL (PowerNV)
  tests/functional: Add test for MPIPL in PowerNV
  pnv/mpipl: Enable MPIPL support
  pnv/mpipl: Write the preserved CPU and MDRT state
  pnv/mpipl: Set thread entry size to be allocated by firmware
  pnv/mpipl: Preserve CPU registers after crash
  pnv/mpipl: Preserve memory regions as per MDST/MDDT tables
  ppc/pnv: Handle stash command in PowerNV SBE
  ppc/mpipl: Implement S0 SBE interrupt
  ppc/pnv: Move SBE host doorbell function to top of file

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4 weeks agoMerge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging
Stefan Hajnoczi [Thu, 30 Apr 2026 14:30:22 +0000 (10:30 -0400)] 
Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging

Pull request

- Jaehoon Kim's AioContext polling CPU efficiency optimizations

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmnyTCEACgkQnKSrs4Gr
# c8jB2wf7BXoNAW73Qwd31vZO2/0ZSDCQI781aeKrO/zl0k6nBgWKYYxjel3ezSJs
# qfwLnu7RpLFp89i6s9fO3PgyPdq81YJBHqeu/AsqXFcNNkkLPMavzcGCr7YeY3xP
# VIprpNBBYI/v6AnuFeEMp04FtLrcFO82ZIvTMpq7FsssytdmmqcleqQRTlecIpbK
# 33z6aYKfPO/0VZRfpj5/NosQGaqU4y9ZgygPVoOvUlmPZgB0TpEReewtphqv7BHa
# LCJD03QBxJyTtsipD0ngcig+LeNzDsdla8fR7LD1hb/iqftxod6anaPIXWYvTu1v
# xC1fWyWZ+r1Nkv249Uzi+dEc4JkMmg==
# =rhl4
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 29 Apr 2026 14:21:21 EDT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [ultimate]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [ultimate]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* tag 'block-pull-request' of https://gitlab.com/stefanha/qemu:
  qapi/iothread: introduce poll-weight parameter for aio-poll
  aio-poll: refine iothread polling using weighted handler intervals
  aio-poll: avoid unnecessary polling time computation

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4 weeks agoMerge tag 'qtest-20260429-pull-request' of https://gitlab.com/farosas/qemu into staging
Stefan Hajnoczi [Thu, 30 Apr 2026 14:29:44 +0000 (10:29 -0400)] 
Merge tag 'qtest-20260429-pull-request' of https://gitlab.com/farosas/qemu into staging

QTest pull request

- New test: iommu-intel-test
- Improvement of QEMU binary name parsing

# -----BEGIN PGP SIGNATURE-----
#
# iQJEBAABCAAuFiEEqhtIsKIjJqWkw2TPx5jcdBvsMZ0FAmnyFWEQHGZhcm9zYXNA
# c3VzZS5kZQAKCRDHmNx0G+wxnRdxEADS6iedQ/w9FPyVsy0qJ6fBL/GQrPX2QuT5
# 8phBvqA4ZDZefvd7Jkp/z3KH7IK5L3h1AKow+F1YIMjPitd2Ju4zktHgrx6pdqIA
# QnWMVYn0nQtsHbS5GgP3iirjZfCToQLK4ohc92h2E32x3saet+itbeNYuo4G6MMZ
# 1C4vlcc5JYqpJZUZWv/nePnYRekvG9/TtRCuVQXU5iQo5xOgyGlS6W6RkwFngC09
# uZddGyZQzgQp+tgxVA6N0Yl/ySPzGMRlcq7sKEgSl5HenAL/+hPJ1UNjTPI2A05k
# 9d7VZVtOONSQG9ZvA15NBj778TrqEcJ3ACrlPd+UmO/BSMZ6Bt4dEhRgGEhRK8eh
# CLJjBK38HLjTj/YC7ATDj4rhFEdBBcE4EtUclTHxLb+mEOEaLZcqIav+wrl98y1Y
# XZRpeaeaelSbCqgIKoNvk5BKy+ihQyjIygJ5UUvmZ5KhdjHE8hR/9e5pCb/aolll
# NosDlZN+eSOh33TK0D3vecW6fEdecjXUles2IeHhG4rzkO/2sV0rQNEdbcUAxpMx
# Sb2Q/a5zSfc9dLOnfA1q7r+5QXnRjYXSbuakl0UCxQbh4K2lA53qambKbUUUWuMe
# FPBikiyf/j4nc959OPkmzw1vm2Wh65LnO6+xvxvozU7U8LRTbjRS8250j7Qca3EF
# qNHMwG4Hlw==
# =UYHh
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 29 Apr 2026 10:27:45 EDT
# gpg:                using RSA key AA1B48B0A22326A5A4C364CFC798DC741BEC319D
# gpg:                issuer "farosas@suse.de"
# gpg: Good signature from "Fabiano Rosas <farosas@suse.de>" [unknown]
# gpg:                 aka "Fabiano Almeida Rosas <fabiano.rosas@suse.com>" [unknown]
# gpg: WARNING: The key's User ID is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: AA1B 48B0 A223 26A5 A4C3  64CF C798 DC74 1BEC 319D

* tag 'qtest-20260429-pull-request' of https://gitlab.com/farosas/qemu:
  tests/qtest: Make qtest_get_arch() cleverer
  tests/qtest: Add Intel IOMMU bare-metal test
  tests/qtest/libqos: Add Intel IOMMU helper library

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4 weeks agominikconf: use .items()
Paolo Bonzini [Thu, 30 Apr 2026 08:53:56 +0000 (10:53 +0200)] 
minikconf: use .items()

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agominikconf: modernize handling of include chain
Paolo Bonzini [Thu, 30 Apr 2026 09:03:04 +0000 (11:03 +0200)] 
minikconf: modernize handling of include chain

Use a dataclass, and store it in the parser to avoid having to
save and restore it.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agominikconf: simplify self.tok
Paolo Bonzini [Fri, 24 Apr 2026 08:24:51 +0000 (10:24 +0200)] 
minikconf: simplify self.tok

Do not ever store a string in self.tok, only a finished token.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agominikconf: fix type mismatch in do_declaration
Paolo Bonzini [Fri, 24 Apr 2026 08:17:41 +0000 (10:17 +0200)] 
minikconf: fix type mismatch in do_declaration

The set stores strings, not Vars.  Because of this the duplicate
definition check did not work.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agominikconf: move command-line assignment out of the parser
Paolo Bonzini [Fri, 24 Apr 2026 08:08:34 +0000 (10:08 +0200)] 
minikconf: move command-line assignment out of the parser

KconfigParser.do_assignment() only exists to handle CONFIG_FOO=y/n
arguments from the command line; it is never invoked while parsing
a Kconfig source file.  Because main() called it on a parser that
had never been through parse_file(), a failing CONFIG_ check would
raise a KconfigParserError whose __init__ and location() touch
fields of "self" that do not exist yet.  The regex in main()
currently shields this, but it is fragile.

Move the prefix-stripping assignment to KconfigData as
do_cmdline_assignment(), simplify KconfigParser.parse() to accept
an existing KconfigData, and call it from main() so the parser is
only used for actual file parsing.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agominikconf: small cleanups and dead code removal
Paolo Bonzini [Fri, 24 Apr 2026 08:03:56 +0000 (10:03 +0200)] 
minikconf: small cleanups and dead code removal

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agominikconf: run through isort
Paolo Bonzini [Thu, 30 Apr 2026 08:58:41 +0000 (10:58 +0200)] 
minikconf: run through isort

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agokconfig: remove duplicate declaration of CONFIG_MIPS_BOSTON_AIA
Paolo Bonzini [Thu, 30 Apr 2026 08:42:10 +0000 (10:42 +0200)] 
kconfig: remove duplicate declaration of CONFIG_MIPS_BOSTON_AIA

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agokconfig: remove duplicate declaration of CONFIG_CXL
Paolo Bonzini [Thu, 30 Apr 2026 08:40:46 +0000 (10:40 +0200)] 
kconfig: remove duplicate declaration of CONFIG_CXL

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agotests: add test for json-streamer.c error recovery
Paolo Bonzini [Tue, 31 Mar 2026 08:22:12 +0000 (10:22 +0200)] 
tests: add test for json-streamer.c error recovery

Before rewriting the error recovery code to work in a push parsing
setup, make sure that we have tests for it.

Cover various cases of invalid JSON, to check that structural
recovery based on balanced brackets and braces works; and
lexer-based recovery which documents "\f" as a sure fire
way to reset the lexer.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agotarget/i386/tcg: simplify decoding of 0F 38 F0...FF
Paolo Bonzini [Tue, 31 Mar 2026 06:52:37 +0000 (08:52 +0200)] 
target/i386/tcg: simplify decoding of 0F 38 F0...FF

These lines are shown in the manual with a weird representation that
confers a special meaning to 0x66 0xF2 prefixes.  In reality, this is
just the CRC32 instruction (chosen by 0xF2) plus a data size override
prefix.  All other instruction in the range that use the 0xF2 prefix
are VEX-encoded and therefore they do not support multiple prefixes.
Because of this, it is possible to handle the four prefixes normally
using decode_by_prefix; the 0x66 0xF2 combination for CRC32 is handled
naturally by the "v" operand size.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agotarget/arm/hvf, target/i386/hvf: Pass MR-relative offset to memory_region_set_dirty()
Scott J. Goldman [Mon, 27 Apr 2026 23:21:15 +0000 (16:21 -0700)] 
target/arm/hvf, target/i386/hvf: Pass MR-relative offset to memory_region_set_dirty()

Both the arm and i386 hvf accelerators have the same bug in their
dirty-page logging path: the address fed to memory_region_set_dirty()
is computed as "<ipa,gpa>_page + xlat", but memory_region_set_dirty()
expects an offset relative to the start of the resolved MemoryRegion.
address_space_translate() already returns that offset in xlat, while
ipa_page / gpa_page is the guest-physical (system address space)
address.

Adding the two together produces a bogus offset that for any non-
trivial RAM size walks well past the end of the MemoryRegion's dirty
bitmap. With dirty logging active (e.g. live migration on a guest
with several GB of RAM), this triggers an out-of-bounds atomic write
inside bitmap_set_atomic() and crashes the source QEMU as soon as the
guest writes to RAM:

    Thread .. 'CPU N/HVF', stop reason = EXC_BAD_ACCESS ...
      bitmap_set_atomic at bitmap.c:213
      physical_memory_set_dirty_range at physmem.c:1038
      memory_region_set_dirty at memory.c:2191
      hvf_handle_exception at hvf.c

Fix it by passing only the MR-relative offset xlat. ipa_page /
gpa_page is still the right argument to hvf_unprotect_dirty_range(),
which works on the guest-physical address space.

Signed-off-by: Scott J. Goldman <scottjgo@gmail.com>
Link: https://lore.kernel.org/r/20260427232116.50586-2-scottjgo@gmail.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agopythondeps: bump to meson 1.11.1
Pierrick Bouvier [Wed, 29 Apr 2026 08:34:04 +0000 (10:34 +0200)] 
pythondeps: bump to meson 1.11.1

Prior to 1.11.0, build with rust didn't use link_args.
In QEMU case, it means that plugins could not work, since they rely on
link_args to expose symbols from QEMU binary.

https://mesonbuild.com/Release-notes-for-1-11-0.html#change-to-handling-of-linker-arguments-for-rust

With this change, QEMU built with --enable-rust can pass all CI tests,
including tests related to plugins.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
[Move from 1.11.0 to 1.11.1. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
4 weeks agolinux-user: Translate errno in IP_RECVERR and IPV6_RECVERR
Helge Deller [Wed, 29 Apr 2026 17:24:58 +0000 (19:24 +0200)] 
linux-user: Translate errno in IP_RECVERR and IPV6_RECVERR

Translate host error codes of IP_RECVERR and IPV6_RECVERR control messages to
target error codes before returning to the caller.
For example, this is important for architectures (e.g. hppa, alpha, sparc,
mips) on which the value of ECONNREFUSED is different to the value on a x86_64
host.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/602
Signed-off-by: Helge Deller <deller@gmx.de>
4 weeks agolinux-user: Allow getsockopt() with NULL optval address
Helge Deller [Tue, 28 Apr 2026 21:40:51 +0000 (23:40 +0200)] 
linux-user: Allow getsockopt() with NULL optval address

Some programs test availability of socket options by asking for the
value with an NULL optval address, which currenrly always trigger an
EFAULT in qemu.  Fix it by allowing a NULL address, in the same manner
as the Linux kernel on physical machines.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/2390
Signed-off-by: Helge Deller <deller@gmx.de>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
4 weeks agofpu: Change parts_float_to_float_widen to parts64_to_parts128
Richard Henderson [Sat, 25 Apr 2026 10:08:44 +0000 (20:08 +1000)] 
fpu: Change parts_float_to_float_widen to parts64_to_parts128

Rename and return FloatParts128 structure.
Use switch instead of 2 ifs.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
4 weeks agofpu: Change parts_float_to_float_narrow to parts128_to_parts64
Richard Henderson [Sat, 25 Apr 2026 09:59:44 +0000 (19:59 +1000)] 
fpu: Change parts_float_to_float_narrow to parts128_to_parts64

Rename and return FloatParts64 structure.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>