]> git.ipfire.org Git - thirdparty/qemu.git/log
thirdparty/qemu.git
5 weeks agoMerge tag 'pull-ppc-for-10.2-d2-20251023-1' of https://gitlab.com/harshpb/qemu into...
Richard Henderson [Thu, 23 Oct 2025 18:16:45 +0000 (13:16 -0500)] 
Merge tag 'pull-ppc-for-10.2-d2-20251023-1' of https://gitlab.com/harshpb/qemu into staging

ppc queue for 10.2

* FADUMP Support for pSeries
* Pegasos II cleanup and Pegasos I emulation
* Deprecation of pseries 3.0 up till 4.2
* Coverity fix for amigaone (CID: 1641398)

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEa4EM1tK+EPOIPSFCRUTplPnWj7sFAmj6G24ACgkQRUTplPnW
# j7uSmA/+MECjSD6TTVaRFdE/+Cd9LVMp8HmlkteaT+Fp/MhJKUGAxF89eBrZKBsJ
# Ukecklx+6x1d6grmBIAaI3sGW3qJW42CcZL4Q1xuL+zsny8sZ3vpp3q/Haxn68WV
# j53LC46rqCUueBffWWRf0q3wRovjY1MiO3LmQn+sEPLcMGLgghvD4kl2WD2uI/Gy
# iYeZJq+FjroVp606xVXQHhymuQeXd/4txGEzU2x7+FpLtdhuoxKa7FD+YtJ4PP3a
# qgZtZy3y4Bs41Gm6uEjdUnuKINjfADOhjqSDzqY5JZF7tgYh5hK0ibd1MI+opvCt
# 39YTpDoN18ljtO2g509sBuywxkz+y/EDsI8pry42MpkXxys2bj8mXoAV45jBOp5s
# n/GHfJ0d//dm2gpDxGhOKFK5qvFldo8tX5msgbMAXirbXzke5PVHbMr/YXmM7kkW
# 4DaKnMjyRxPIDeyqPfjKspC8VnmF6Z6LzDSMYGYejHO/OKlNE7ZQqaYh5itNTaqE
# xkRC+WISGm98cGYpu57VvD/wE0VmygBZ2l+j5gYS5tDVniZW3B4dUAOAqo7JCbIO
# uMfRgmHaR0Jc2Xj5wf8J/D1ZzDok2OV2siabfwew5pvhJl7HiCoH/k+qzgovC5hO
# L/5P4n+7ZRJwLhP45ewXkEoOK5tWowofdq/5SsFjie7n8d3U5cU=
# =usd9
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 23 Oct 2025 07:11:26 AM CDT
# gpg:                using RSA key 6B810CD6D2BE10F3883D21424544E994F9D68FBB
# gpg: Good signature from "Harsh Prateek Bora <harsh.prateek.bora@gmail.com>" [undefined]
# gpg:                 aka "Harsh Prateek Bora <harshpb@linux.ibm.com>" [undefined]
# 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: 6B81 0CD6 D2BE 10F3 883D  2142 4544 E994 F9D6 8FBB

* tag 'pull-ppc-for-10.2-d2-20251023-1' of https://gitlab.com/harshpb/qemu: (32 commits)
  MAINTAINERS: Add entry for FADump (pSeries)
  tests/functional: Add test for fadump in PSeries
  hw/ppc: Enable fadump for PSeries
  hw/ppc: Pass dump-sizes property for fadump in device tree
  hw/ppc: Implement saving CPU state in Fadump
  hw/ppc: Preserve memory regions registered for fadump
  hw/ppc: Trigger Fadump boot if fadump is registered
  hw/ppc: Implement fadump register command
  hw/ppc/pegasos2: Add VOF support for pegasos1
  hw/ppc/pegasos2: Add Pegasos I emulation
  hw/ppc/pegasos2: Add bus frequency to machine state
  hw/ppc/pegasos2: Introduce abstract superclass
  hw/ppc/pegasos2: Move hardware specific parts out of machine reset
  hw/ppc/pegasos2: Move PCI IRQ routing setup to a function
  hw/ppc/pegasos2: Add south bridge pointer in the machine state
  hw/ppc/pegasos2: Rename mv field in machine state
  hw/ppc/pegasos2: Remove fdt pointer from machine state
  hw/ppc/pegasos2: Change device tree generation
  hw/ppc/pegasos2: Remove explicit name properties from device tree
  ppc/vof: Make nextprop behave more like Open Firmware
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
5 weeks agoMerge tag 'pull-loongarch-20251023' of https://github.com/bibo-mao/qemu into staging
Richard Henderson [Thu, 23 Oct 2025 18:16:24 +0000 (13:16 -0500)] 
Merge tag 'pull-loongarch-20251023' of https://github.com/bibo-mao/qemu into staging

loongarch queue

# -----BEGIN PGP SIGNATURE-----
#
# iHUEABYKAB0WIQQNhkKjomWfgLCz0aQfewwSUazn0QUCaPoVJAAKCRAfewwSUazn
# 0V1sAP4xtZMCEK9XuKApu4ZyTfPAtl0WLmhEQUKuEn3A6lNfowD9EUTMW3ksiyY/
# hZRb4D8WIJGj3nEIWvLiTg3a+wBT1AI=
# =sB19
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 23 Oct 2025 06:44:36 AM CDT
# gpg:                using EDDSA key 0D8642A3A2659F80B0B3D1A41F7B0C1251ACE7D1
# gpg: Good signature from "bibo mao <maobibo@loongson.cn>" [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: 7044 3A00 19C0 E97A 31C7  13C4 8E86 8FB7 A176 9D4C
#      Subkey fingerprint: 0D86 42A3 A265 9F80 B0B3  D1A4 1F7B 0C12 51AC E7D1

* tag 'pull-loongarch-20251023' of https://github.com/bibo-mao/qemu:
  target/loongarch: Add bit A/D checking in TLB entry with PTW supported
  target/loongarch: Update matched ptw bit A/D with PTW supported
  target/loongarch: Add basic hardware PTW support
  target/loongarch: Add common interface update_tlb_index()
  target/loongarch: Add field tlb_index to record TLB search info
  target/loongarch: Move last PTE lookup into page table walker loop
  target/loongarch: Reserve higher 48 bit PTE attribute with huge page
  target/loongarch: Add debug parameter with loongarch_page_table_walker()
  target/loongarch: Add MMUContext parameter in fill_tlb_entry()
  target/loongarch: target/loongarch: Add common function get_tlb_random_index()
  target/loongarch: Add function sptw_prepare_tlb before adding tlb entry
  target/loongarch: Add present and write bit with pte entry
  target/loongarch: Add CSR_PWCH write helper function
  target/loongarch: Use auto method with PTW feature

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
5 weeks agoMAINTAINERS: Add entry for FADump (pSeries)
Aditya Gupta [Tue, 21 Oct 2025 13:48:18 +0000 (19:18 +0530)] 
MAINTAINERS: Add entry for FADump (pSeries)

Add maintainer and reviewer for fadump subsystem.

Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Acked-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Tested-by: Shivang Upadhyay <shivangu@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021134823.1861675-9-adityag@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agotests/functional: Add test for fadump in PSeries
Aditya Gupta [Tue, 21 Oct 2025 13:48:17 +0000 (19:18 +0530)] 
tests/functional: Add test for fadump in PSeries

Add testcases for testing fadump with PSeries and PSeries+KVM
combinations

It tests if fadump is successfully detected and registered in the first
kernel boot. Then crashes the kernel, and verifies whether we have a
/proc/vmcore in the 2nd boot

Also introduce 'wait_for_regex_console_pattern' to check for cases where
there is a single success message, but can have multiple failure
messages.

This is particularly useful for cases such as fadump, where the
success message is
    "Reserved 1024MB ... successfully"
But at the same point, it can fail with multiple errors such as
    "Not supported" or "Allocation failed"

'wait_for_regex_console_pattern' also has a timeout, for cases when we
know the success/failure should appear in a short amount of time,
instead of waiting for the much longer test timeout, such as kernels
with support of fadump will print the success/failure in earlyboot of
the kernel, while kernel without support of fadump won't print anything
for long time, and without a timeout the testcase keeps waiting till
longer test timeout

Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Tested-by: Shivang Upadhyay <shivangu@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021134823.1861675-8-adityag@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc: Enable fadump for PSeries
Aditya Gupta [Tue, 21 Oct 2025 13:48:16 +0000 (19:18 +0530)] 
hw/ppc: Enable fadump for PSeries

With all support in place for preserving memory regions, enable fadump by
exporting the "ibm,kernel-dump" property in the device tree, representing
the fadump dump information, in case of a crash.

Currently "ibm,configure-kernel-dump" RTAS call is already registered,
which tells the kernel that the platform (QEMU) supports fadump.

Now, in case of a crash, if fadump was registered, we also pass
"ibm,kernel-dump" in device tree, which tells the kernel that the fadump
dump is active.

Pass "fadump=on" to enable Linux to use firmware assisted dump.

Logs of a linux boot with firmware assisted dump:

    $ ./build/qemu-system-ppc64 -M pseries,x-vof=on --cpu power10 --smp 4 -m 4G -kernel some-vmlinux -initrd some-initrd -append "debug fadump=on crashkernel=1G" -nographic

    [    0.000000] fadump: Reserved 1024MB of memory at 0x00000040000000 (System RAM: 4096MB)
    [    0.000000] fadump: Initialized 0x40000000 bytes cma area at 1024MB from 0x400102a8 bytes of memory reserved for firmware-assisted dump
    ...
    [    1.084686] rtas fadump: Registration is successful!
    ...
    # cat /sys/kernel/debug/powerpc/fadump_region
    CPU :[0x00000040000000-0x000000400013df] 0x13e0 bytes, Dumped: 0x0
    HPTE:[0x000000400013e0-0x000000400013df] 0x0 bytes, Dumped: 0x0
    DUMP: Src: 0x00000000000000, Dest: 0x00000040010000, Size: 0x40000000, Dumped: 0x0 bytes

    [0x0000000921a000-0x0000000921a7ff]: cmdline append: ''
    # echo c > /proc/sysrq-trigger

The fadump boot after crash:

    [    0.000000] rtas fadump: Firmware-assisted dump is active.
    [    0.000000] fadump: Updated cmdline: debug fadump=on crashkernel=1G
    [    0.000000] fadump: Firmware-assisted dump is active.
    [    0.000000] fadump: Reserving 3072MB of memory at 0x00000040000000 for preserving crash data
    ....
    # file /proc/vmcore
    /proc/vmcore: ELF 64-bit LSB core file, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (SYSV), SVR4-style

Analysing the vmcore with crash-utility:

          KERNEL: vmlinux-6.14-rc2
        DUMPFILE: vmcore-fc92fb373aa0
            CPUS: 4
            DATE: Wed Mar 12 23:39:23 CDT 2025
          UPTIME: 00:00:22
    LOAD AVERAGE: 0.13, 0.03, 0.01
           TASKS: 95
        NODENAME: buildroot
         RELEASE: 6.12.0-rc4+
         VERSION: #1 SMP Fri Jan  3 00:15:17 IST 2025
         MACHINE: ppc64le  (1000 Mhz)
          MEMORY: 4 GB
           PANIC: "Kernel panic - not syncing: sysrq triggered crash"
             PID: 269
         COMMAND: "sh"
            TASK: c00000000a050b00  [THREAD_INFO: c00000000a050b00]
             CPU: 0
           STATE: TASK_RUNNING (PANIC)

Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Tested-by: Shivang Upadhyay <shivangu@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021134823.1861675-7-adityag@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc: Pass dump-sizes property for fadump in device tree
Aditya Gupta [Tue, 21 Oct 2025 13:48:15 +0000 (19:18 +0530)] 
hw/ppc: Pass dump-sizes property for fadump in device tree

Platform (ie. QEMU) is expected to pass few device tree properties for
details for fadump:

  * "ibm,configure-kernel-dump-sizes": Space required to store dump data
    for firmware provided dump sections (ie. CPU & HPTE regions)
  * "ibm,configure-kernel-dump-version": Versions of fadump supported

Pass the above device tree nodes so that kernel can reserve sufficient
space for preserving the CPU state data

Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Tested-by: Shivang Upadhyay <shivangu@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021134823.1861675-6-adityag@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc: Implement saving CPU state in Fadump
Aditya Gupta [Tue, 21 Oct 2025 13:48:14 +0000 (19:18 +0530)] 
hw/ppc: Implement saving CPU state in Fadump

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 respectively.

The CPUSTRT and CPUEND register entry also has 4-byte logical CPU ID,
thus storing the CPU ID corresponding to the array of register entries.

Each register, and CPUSTRT, CPUEND has a predefined identifier.
Implement calculating identifier for a given register in
'fadump_str_to_u64', which has been taken from the linux kernel

Similarly GPRs also have predefined identifiers, and a corresponding
64-bit resiter value (split into two 32-bit cells). Implement
calculation of GPR identifiers with 'fadump_gpr_id_to_u64'

PAPR has restrictions on particular order of few registers, and is
free to be in any order for other registers.
Some registers mentioned in PAPR have not been exported as they are not
implemented in QEMU / don't make sense in QEMU.

Implement saving of CPU state according to the PAPR document

Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Tested-by: Shivang Upadhyay <shivangu@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021134823.1861675-5-adityag@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc: Preserve memory regions registered for fadump
Aditya Gupta [Tue, 21 Oct 2025 13:48:13 +0000 (19:18 +0530)] 
hw/ppc: Preserve memory regions registered for fadump

While the first kernel boots, it registers memory regions for fadump
such as:
    * CPU state data  (has to be populated by the platform)
    * HPTE state data (has to be populated by the platform)
    * Real Mode Regions (platform should copy it to requested
      destination addresses)
    * OS defined regions (such as parameter save area)

Platform is also expected to modify the 'bytes_dumped' to the length of
data preserved/copied by platform (ideally same as the source length
passed by kernel).

The kernel passes source address and length for the memory regions, and
a destination address to where the memory is to be copied.

Implement the preserving/copying of the Real Mode Regions and the
Parameter Save Area in QEMU Pseries

The regions are copied in chunks instead of copying all at once.

Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Tested-by: Shivang Upadhyay <shivangu@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021134823.1861675-4-adityag@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc: Trigger Fadump boot if fadump is registered
Aditya Gupta [Tue, 21 Oct 2025 13:48:12 +0000 (19:18 +0530)] 
hw/ppc: Trigger Fadump boot if fadump is registered

According to PAPR:

    R1–7.3.30–3. When the platform receives an ibm,os-term RTAS call, or
    on a system reset without an ibm,nmi-interlock RTAS call, if the
    platform has a dump structure registered through the
    ibm,configure-kernel-dump call, the platform must process each
    registered kernel dump section as required and, when available,
    present the dump structure information to the operating system
    through the “ibm,kernel-dump” property, updated with status for each
    dump section, until the dump has been invalidated through the
    ibm,configure-kernel-dump RTAS call.

If Fadump has been registered, trigger an Fadump boot (memory preserving
boot), if QEMU recieves a 'ibm,os-term' rtas call.

Implementing the fadump boot as:
    * pause all vcpus (will need to save registers later)
    * preserve memory regions specified by fadump (will be implemented
      in future)
    * do a memory preserving reboot (GUEST_RESET in QEMU doesn't clear
      the memory)

Memory regions registered by fadump will be handled in a later patch.

Note: Preserving memory regions is not implemented yet so on an
"ibm,os-term" call will just trigger a reboot in QEMU if fadump is
registered, and the second kernel will boot as a normal boot (not
fadump boot)

Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Tested-by: Shivang Upadhyay <shivangu@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021134823.1861675-3-adityag@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc: Implement fadump register command
Aditya Gupta [Tue, 21 Oct 2025 13:48:11 +0000 (19:18 +0530)] 
hw/ppc: Implement fadump register command

Add skeleton to handle "ibm,configure-kernel-dump" rtas call in QEMU,
including register, unregister and invalidate commands.

The register just verifies the structure of the fadump memory structure
passed by kernel, and set fadump_registered in spapr state to true.

Verify basic details mandated by the PAPR, such as number of
inputs/output, and add handling for the three fadump commands:
regiser/unregister/invalidate.

The checks are based on the table in following requirement in PAPR v2.13:
    "R1–7.3.30–1. For the Configure Platform Assisted Kernel Dump option ..."

Relevant section for the register command in PAPR is:
    Section 7.3.30: "ibm,configure-kernel-dump RTAS call" (PAPR v2.13)

Note: Any modifications made by the kernel to the fadump memory
structure after the 'ibm,configure-kernel-dump' RTAS call returns will
not be reflected in QEMU, as QEMU retains the fadump memory structure
that was provided during fadump registration.

The kernel must unregister and re-register fadump to apply any changes
to the fadump memory structure.

Signed-off-by: Aditya Gupta <adityag@linux.ibm.com>
Reviewed-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Tested-by: Shivang Upadhyay <shivangu@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021134823.1861675-2-adityag@linux.ibm.com
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/pegasos2: Add VOF support for pegasos1
BALATON Zoltan [Thu, 23 Oct 2025 00:06:19 +0000 (02:06 +0200)] 
hw/ppc/pegasos2: Add VOF support for pegasos1

When running without firmware ROM using Virtual Open Firmware we need
to do some hardware initialisation and provide the device tree as the
machine firmware would normally do.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/d2d7f173dbd436b47382f384d5a93eb7e713424e.1761176219.git.balaton@eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/pegasos2: Add Pegasos I emulation
BALATON Zoltan [Thu, 23 Oct 2025 00:06:18 +0000 (02:06 +0200)] 
hw/ppc/pegasos2: Add Pegasos I emulation

The Pegasos II is a redesign of the original Pegasos (later marked I)
that replaces the north bridge and has updated firmware but otherwise
these are very similar. The Pegasos uses the same north bridge that
AmigaOne used which we already emulate so we can also easily emulate
Pegasos I.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/8f5bd07553b41d83a54f9df0bb93b76b22dea5c5.1761176219.git.balaton@eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/pegasos2: Add bus frequency to machine state
BALATON Zoltan [Thu, 23 Oct 2025 00:06:17 +0000 (02:06 +0200)] 
hw/ppc/pegasos2: Add bus frequency to machine state

Store the bus frequency in the machine state and set it from instance
init method.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/b69e21e353b7d7f22a34db5f13443f60f51c7238.1761176219.git.balaton@eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/pegasos2: Introduce abstract superclass
BALATON Zoltan [Thu, 23 Oct 2025 00:06:16 +0000 (02:06 +0200)] 
hw/ppc/pegasos2: Introduce abstract superclass

Rename machine state struct to PegasosMachineState as it will be used
for pegasos1 too.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/a09590a5da4572c9d392542f5c3793e6eb08ab9e.1761176219.git.balaton@eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/pegasos2: Move hardware specific parts out of machine reset
BALATON Zoltan [Thu, 23 Oct 2025 00:06:15 +0000 (02:06 +0200)] 
hw/ppc/pegasos2: Move hardware specific parts out of machine reset

Move the pegasos2 specific chipset reset out from machine reset to a
separate function and move generic parts that are not pegasos2
specific from build_fdt to machine reset so now build_fdt only
contains pegasos2 specific parts and can be renamed accordingly.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/f6633a68a72aad4fefb8d2373b52561f8ca8d41d.1761176219.git.balaton@eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/pegasos2: Move PCI IRQ routing setup to a function
BALATON Zoltan [Thu, 23 Oct 2025 00:06:14 +0000 (02:06 +0200)] 
hw/ppc/pegasos2: Move PCI IRQ routing setup to a function

Collect steps of setting up PCI IRQ routing in one function.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/f5ff16a6933ab6e1f9e194d16ef85364ac3cf6df.1761176219.git.balaton@eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/pegasos2: Add south bridge pointer in the machine state
BALATON Zoltan [Thu, 23 Oct 2025 00:06:13 +0000 (02:06 +0200)] 
hw/ppc/pegasos2: Add south bridge pointer in the machine state

Add field for the south bridge in machine state to have both north and
south bridges in it.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/654d3223b418d5bb2ba08a2b014375c2abf341aa.1761176219.git.balaton@eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/pegasos2: Rename mv field in machine state
BALATON Zoltan [Thu, 23 Oct 2025 00:06:12 +0000 (02:06 +0200)] 
hw/ppc/pegasos2: Rename mv field in machine state

Use more generic name for the field used to store the north bridge in
the machine state.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/f1c189f16a260377abe0d270e778f2738649446a.1761176219.git.balaton@eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/pegasos2: Remove fdt pointer from machine state
BALATON Zoltan [Thu, 23 Oct 2025 00:06:10 +0000 (02:06 +0200)] 
hw/ppc/pegasos2: Remove fdt pointer from machine state

The machine class has a field for storing the fdt so we don't need our
own and can use that instead.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/f4355b8d2889aba19d28001e61ac3f9937fc5250.1761176219.git.balaton@eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/pegasos2: Change device tree generation
BALATON Zoltan [Thu, 23 Oct 2025 00:06:09 +0000 (02:06 +0200)] 
hw/ppc/pegasos2: Change device tree generation

We generate a flattened device tree programmatically for VOF. Change
this to load the static parts from a device tree blob and only
generate the parts that depend on run time conditions such as CPU
type, memory size and PCI devices. Moving the static parts in a dts
makes the board code simpler and more generic.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/383891fc2696609b27d2de9773efe1b4f493e333.1761176219.git.balaton@eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/pegasos2: Remove explicit name properties from device tree
BALATON Zoltan [Thu, 23 Oct 2025 00:06:08 +0000 (02:06 +0200)] 
hw/ppc/pegasos2: Remove explicit name properties from device tree

These are not needed any more now that VOF can handle it.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/fa36ab5a04e10c6acb89583f646aad83df2b0b13.1761176219.git.balaton@eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agoppc/vof: Make nextprop behave more like Open Firmware
BALATON Zoltan [Thu, 23 Oct 2025 00:06:07 +0000 (02:06 +0200)] 
ppc/vof: Make nextprop behave more like Open Firmware

The FDT does not normally store name properties but reconstructs it
from path but Open Firmware specification says each node should at
least have this property. This is correctly handled in getprop but
nextprop should also return it even if not present as a property.

Explicit name properties are still allowed because they are needed
e.g. on the root node that guests expect to have specific names as
seen on real machines instead of being empty so sometimes the node
name may need to be overriden. For example on pegasos MorphOS checks
the name of "/" and expects to find bplan,Pegasos2 which is how it
identifies the machine.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Link: https://lore.kernel.org/qemu-devel/366f14ce852415cc079727c54ac21a2aa6ff3917.1761176219.git.balaton@eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agoppc/amigaone: Free allocated struct
BALATON Zoltan [Wed, 22 Oct 2025 21:07:47 +0000 (23:07 +0200)] 
ppc/amigaone: Free allocated struct

In create_bd_info function a bd_info struct is allocated but never
freed. Mark it g_autofree to avoid leaking it.

Fixes: 34f053d86b (ppc/amigaone: Add kernel and initrd support)
Resolves: Coverity CID 1641398
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251022211649.9A09E5972E5@zero.eik.bme.hu
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agoppc/spapr: remove deprecated machine pseries-4.2
Harsh Prateek Bora [Tue, 21 Oct 2025 08:43:45 +0000 (10:43 +0200)] 
ppc/spapr: remove deprecated machine pseries-4.2

Remove the pseries-4.2 machine specific logic as had been deprecated and
due for removal now as per policy.

Suggested-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20251021084346.73671-12-philmd@linaro.org
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agoppc/spapr: remove deprecated machine pseries-4.1
Harsh Prateek Bora [Tue, 21 Oct 2025 08:43:44 +0000 (10:43 +0200)] 
ppc/spapr: remove deprecated machine pseries-4.1

Remove the pseries-4.1 machine specific logic as had been deprecated and
due for removal now as per policy.

Suggested-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20251021084346.73671-11-philmd@linaro.org
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/spapr: Remove SpaprMachineClass::phb_placement callback
Philippe Mathieu-Daudé [Tue, 21 Oct 2025 08:43:43 +0000 (10:43 +0200)] 
hw/ppc/spapr: Remove SpaprMachineClass::phb_placement callback

The SpaprMachineClass::phb_placement callback was only used by
the pseries-4.0 machine, which got removed. Remove it as now
unused, directly calling spapr_phb_placement().
Move spapr_phb_placement() definition to avoid forward declaration.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Chinmay Rath <rathc@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021084346.73671-10-philmd@linaro.org
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agoppc/spapr: remove deprecated machine pseries-4.0
Harsh Prateek Bora [Tue, 21 Oct 2025 08:43:42 +0000 (10:43 +0200)] 
ppc/spapr: remove deprecated machine pseries-4.0

pseries-4.0 had been deprecated and due for removal now as per policy.
Also remove pre-4.1 migration hacks which were introduced for backward
compatibility.

Suggested-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
[PMD: Remove SpaprMachineClass::pre_4_1_migration field]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20251021084346.73671-9-philmd@linaro.org
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agotarget/ppc/kvm: Remove kvmppc_get_host_model() as unused
Philippe Mathieu-Daudé [Tue, 21 Oct 2025 08:43:41 +0000 (10:43 +0200)] 
target/ppc/kvm: Remove kvmppc_get_host_model() as unused

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Chinmay Rath <rathc@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021084346.73671-8-philmd@linaro.org
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agotarget/ppc/kvm: Remove kvmppc_get_host_serial() as unused
Philippe Mathieu-Daudé [Tue, 21 Oct 2025 08:43:40 +0000 (10:43 +0200)] 
target/ppc/kvm: Remove kvmppc_get_host_serial() as unused

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Chinmay Rath <rathc@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021084346.73671-7-philmd@linaro.org
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/spapr: Inline few SPAPR_IRQ_* uses
Philippe Mathieu-Daudé [Tue, 21 Oct 2025 08:43:39 +0000 (10:43 +0200)] 
hw/ppc/spapr: Inline few SPAPR_IRQ_* uses

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Chinmay Rath <rathc@linux.ibm.com>
Link: https://lore.kernel.org/qemu-devel/20251021084346.73671-6-philmd@linaro.org
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/spapr: Inline spapr_dtb_needed()
Philippe Mathieu-Daudé [Tue, 21 Oct 2025 08:43:38 +0000 (10:43 +0200)] 
hw/ppc/spapr: Inline spapr_dtb_needed()

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20251021084346.73671-5-philmd@linaro.org
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agoppc/spapr: remove deprecated machine pseries-3.1
Harsh Prateek Bora [Tue, 21 Oct 2025 08:43:37 +0000 (10:43 +0200)] 
ppc/spapr: remove deprecated machine pseries-3.1

pseries-3.1 had been deprecated and due for removal now as per policy.
Also remove backward compatibility flags and related code introduced for
pre pseries-4.0 machines.

Suggested-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20251021084346.73671-4-philmd@linaro.org
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agohw/ppc/spapr: Remove SpaprMachineClass::nr_xirqs field
Philippe Mathieu-Daudé [Tue, 21 Oct 2025 08:43:36 +0000 (10:43 +0200)] 
hw/ppc/spapr: Remove SpaprMachineClass::nr_xirqs field

The SpaprMachineClass::nr_xirqs field was only used by the
pseries-3.0 machine, which got removed. Remove it as now unused.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20251021084346.73671-3-philmd@linaro.org
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agoppc/spapr: remove deprecated machine pseries-3.0
Harsh Prateek Bora [Tue, 21 Oct 2025 08:43:35 +0000 (10:43 +0200)] 
ppc/spapr: remove deprecated machine pseries-3.0

pseries-3.0 had been deprecated and due for removal now as per policy.
Also remove legacy irq support which existed for pre pseries-3.1 machines.

Suggested-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20251021084346.73671-2-philmd@linaro.org
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
5 weeks agotarget/loongarch: Add bit A/D checking in TLB entry with PTW supported
Bibo Mao [Fri, 10 Oct 2025 03:11:07 +0000 (11:11 +0800)] 
target/loongarch: Add bit A/D checking in TLB entry with PTW supported

With read/write access, add bit A/D checking if hardware PTW is
supported. If no matched, hardware page table walk is called. And
then bit A/D is updated in PTE entry and TLB entry is updated also.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: Update matched ptw bit A/D with PTW supported
Bibo Mao [Wed, 27 Aug 2025 07:04:33 +0000 (15:04 +0800)] 
target/loongarch: Update matched ptw bit A/D with PTW supported

With hardware PTE supported, bit A will be set if there is read access
or instruction fetch, and bit D will be set with write access.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: Add basic hardware PTW support
Bibo Mao [Thu, 23 Oct 2025 09:23:09 +0000 (17:23 +0800)] 
target/loongarch: Add basic hardware PTW support

However with hardware PTW supported, hardware will search page table
with TLB miss. Also if there is no TLB miss however bit Present is not set,
hardware PTW will happen also. Because there is odd/even page in one TLB
entry on LoongArch system, for example in the first time odd TLB entry is
valid and even TLB entry is 0. When software accesses with address within
even page, there is no TLB miss only that TLB entry is 0. In this
condition, hardwre PTW will happen also.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: Add common interface update_tlb_index()
Bibo Mao [Thu, 9 Oct 2025 06:54:33 +0000 (14:54 +0800)] 
target/loongarch: Add common interface update_tlb_index()

Common API update_tlb_index() is added here, it is to update TLB entry
with specified index. It is called by helper_tlbwr() now, also it can
be used by HW PTW when adding new TLB entry.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: Add field tlb_index to record TLB search info
Bibo Mao [Tue, 30 Sep 2025 02:41:23 +0000 (10:41 +0800)] 
target/loongarch: Add field tlb_index to record TLB search info

With hardware PTW function, TLB entry will be searched at first.
If there is odd/even page on one TLB entry, and odd page is valid and
even page is none. When software access memory with address in even
page, hardware PTW will happen and fill new entry in the same TLB entry.

Here add field tlb_index to record TLB index when search TLB tables.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: Move last PTE lookup into page table walker loop
Bibo Mao [Wed, 27 Aug 2025 04:11:02 +0000 (12:11 +0800)] 
target/loongarch: Move last PTE lookup into page table walker loop

The last PTE lookup sentence is much similiar with the whole page
table walker loop, move it into the whole loop.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: Reserve higher 48 bit PTE attribute with huge page
Bibo Mao [Wed, 27 Aug 2025 03:53:07 +0000 (11:53 +0800)] 
target/loongarch: Reserve higher 48 bit PTE attribute with huge page

With PTE entry, high bit 48-63 is valid HW bit for PTE attribute,
for example bit 63 is RPLV and bit 62 is NX. With page directory table,
it is physical address of page table from view of HW, so high bit
48-63 need be discarded.

Here reverve high bit 48-63 with huge page since it is PTE entry, and
only discard it with page directory table.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: Add debug parameter with loongarch_page_table_walker()
Bibo Mao [Tue, 30 Sep 2025 02:19:15 +0000 (10:19 +0800)] 
target/loongarch: Add debug parameter with loongarch_page_table_walker()

Add debug parameter with function loongarch_page_table_walker(),
in debug mode it is only to get physical address. And It used in
future HW PTW usage, bit dirty and access will be updated in HW
PTW mode.

Also function loongarch_page_table_walker() is renamed as
loongarch_ptw() for short.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: Add MMUContext parameter in fill_tlb_entry()
Bibo Mao [Tue, 30 Sep 2025 02:16:22 +0000 (10:16 +0800)] 
target/loongarch: Add MMUContext parameter in fill_tlb_entry()

Function fill_tlb_entry() can be used with hardware PTW in future,
here add input parameter MMUContext in fill_tlb_entry().

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: target/loongarch: Add common function get_tlb_random_index()
Bibo Mao [Thu, 9 Oct 2025 03:37:32 +0000 (11:37 +0800)] 
target/loongarch: target/loongarch: Add common function get_tlb_random_index()

With software PTW system, tlb index is calculated randomly when new
TLB entry is added. For hardware PTW, it is the same logic to add
new TLB entry.

Here common function get_tlb_random_index() is added to get random
tlb index when adding new TLB entry.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: Add function sptw_prepare_tlb before adding tlb entry
Bibo Mao [Tue, 30 Sep 2025 01:43:56 +0000 (09:43 +0800)] 
target/loongarch: Add function sptw_prepare_tlb before adding tlb entry

With software page table walker, tlb entry comes from CSR registers.
however with hardware page table walker, tlb entry comes from page
table entry information directly, TLB CSR registers are not necessary.

Here add function sptw_prepare_context(), get tlb entry information
from TLB CSR registers.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: Add present and write bit with pte entry
Bibo Mao [Thu, 9 Oct 2025 03:32:43 +0000 (11:32 +0800)] 
target/loongarch: Add present and write bit with pte entry

With hardware PTW feature enabled, Present bit and Write bit is checked
by hardware, rather Valid bit and Dirty bit. Bit P means that the page is
valid and present, and bit W means that the page is writable.

The original V bit is treated as access bit, hardware sets this bit if
there is a read or write access. Bit D bit is updated by hardware if
there is a write access.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: Add CSR_PWCH write helper function
Bibo Mao [Wed, 16 Jul 2025 03:23:13 +0000 (11:23 +0800)] 
target/loongarch: Add CSR_PWCH write helper function

Bit HPTW_EN in register CSR_PWCH controls enabling hardware page
table walker feature when PTW feature is enabled. Otherwise it is
reserved bit.

Here add register CSR_PWCH write helper function.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
5 weeks agotarget/loongarch: Use auto method with PTW feature
Bibo Mao [Tue, 30 Sep 2025 01:14:58 +0000 (09:14 +0800)] 
target/loongarch: Use auto method with PTW feature

PTW is short for page table walker, it is hardware page table walker
function. With PTW supported, hardware MMU will parse page table
table and update TLB entries automatically.

This patch adds type OnOffAuto for PTW feature setting.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
6 weeks agoMerge tag 'pull-vfio-20251022' of https://github.com/legoater/qemu into staging
Richard Henderson [Wed, 22 Oct 2025 13:01:21 +0000 (08:01 -0500)] 
Merge tag 'pull-vfio-20251022' of https://github.com/legoater/qemu into staging

vfio queue:

* Fix CPR transfer
* Add support for VFIO_DMA_UNMAP_FLAG_ALL
* Fix vfio-user documentation
* Update Alex Williamson's email address
* Fix for vfio-region cache for the vGPU use case

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAmj4y4QACgkQUaNDx8/7
# 7KFGOw/8DRo/tRCW5q5uQj8T5DPQqL7QSBsZ50Zbtxn31xAstx8d30waxNCYGyMz
# /LzKHATb/MFKtM4pZnQS9fVQRXsHaiFyokIx58u+xZpbxrAs8WeBsBgepftkid9+
# Mv88plvFdMRZuIiEmAZOvuIcCWjAMjDwJ60o/InykQR6Y2a+LawAy2Jp30wAp5q4
# 7RH4+CkjKP4G00WAjhi1cRZjjBOa8xA+BvD5CDMlZKpURnSivjK0K5XQARWpj3aG
# X0Ggg8LVsE98iJtq7g/+233QfCiuHe+c7FvVd+c6svg18n0uEYzfUUI0MGJPUtWS
# zxUlhDcNoy0XCVIb5Dd3QG+8NfetMV5T4oNrhZADRBjKHBk+OuJfI9yZFwAzXlKl
# n9hVRk/HVIsdi2f5OtRgUNJYhuph0gkryNPQQRDgPb8XLip/OeLRQJ4qUyZ4XuYA
# nfU3vZWFwfPdhfbqU6koa49VTIJTx2TGj/naFAeqLhJolGVTdjgXoJTIS62y58gd
# eKxJwkB0sVv7em8VvjhdsOPMdeosU/ZS82aM6B0u5PB/DepsG1tq5RSSkbmozgYJ
# 6muXwOsSwMQbvsf2KVy70kQCuTb5sKyWr2BlS8tvya5LV7BPbNNlOqtnapekCh+B
# C2cP1MAVs2LcKNQwI2avrDrb7mun6uupFtA3Ci7gxxbBulMQZTA=
# =O4HA
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 22 Oct 2025 07:18:12 AM CDT
# gpg:                using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1
# gpg: Good signature from "Cédric Le Goater <clg@redhat.com>" [full]
# gpg:                 aka "Cédric Le Goater <clg@kaod.org>" [full]

* tag 'pull-vfio-20251022' of https://github.com/legoater/qemu:
  vfio: only check region info cache for initial regions
  vfio: rename field to "num_initial_regions"
  MAINTAINERS: Update Alex Williamson's email address
  docs/system/devices/vfio-user: fix formatting
  vfio/listener: Add an assertion for unmap_all
  vfio/iommufd: Support unmap all in one ioctl()
  vfio/container: Support unmap all in one ioctl()
  accel/kvm: Fix an erroneous check on coalesced_mmio_ring
  vfio/iommufd: Restore vbasedev's reference to hwpt after CPR transfer
  vfio/iommufd: Set cpr.ioas_id on source side for CPR transfer
  vfio/cpr-legacy: drop an erroneous assert
  vfio/container: Remap only populated parts in a section

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agoMerge tag 'pull-aspeed-20251022' of https://github.com/legoater/qemu into staging
Richard Henderson [Wed, 22 Oct 2025 13:00:52 +0000 (08:00 -0500)] 
Merge tag 'pull-aspeed-20251022' of https://github.com/legoater/qemu into staging

aspeed queue:

* Improve AST2700 co-processor models
* Add vbootrom support to the ast2700fc multi-soc machine
* Bump SDK version to v09.08 for the ast2700fc machine
* Add 32 bits property for Aspeed GPIOs
* Change ast2600-evb machine flash model to w25q512jv

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAmj4ziMACgkQUaNDx8/7
# 7KFBBxAAy6LnSZDA9XncZsqVe1Vk254OLdwHAlOVgFD7pBDXp12qNBMJHyjw8QmV
# sxxQXyyLARq4z+P58HMdEBvqdwtdyrieo7lv7QsR8zhYa/HSJtFQmnwRVFKA9lS5
# vAJ1TRi+B29ff24DC2CVBjnAgjrvE0lxmcXoLhObFdc2gU4Gzd+Oia91Nbgf35gA
# NjfgIjMs1wKLO5SICCGDhW5bsdm2jYS+b5dP35VuvizfSihlUQMAbdnSXzLk2aT+
# iimik/aOAv/Tu3nV8G6RmQ/aWZhRNvuTGfBnK0AnSCWnQP6/9a9y+gp61mDzD8ht
# 6hpLgEbBTwldjdrvaejg1iYQ04szYNiIYRTxT7ral4sIkCEi0tg4yzOcpHLfSnr1
# 1YT3Z1+Z2z7w3jAsd/SqMfQXksLQR3G/51tGkatxHMJ4IScdt/cASZWXK3RlhXH1
# YrQjiF5GuanM0oMcbyhgoq+sWNXP4EIWC3i6ER7H6MSRlfIjG+27kuxfnzJuZtDU
# iAq4YD0tckoivhixvdv2OiT9IdYCDAeb/TMRy+5Xdf36D8NOhyoQUBgHeIhow6yJ
# nCNPyCkM4HnpgkF0C+fyPBTqUP2AQ8NiTzBQA1bLorSjEN/9LMKvY9lwkEammp8/
# VnfeoIzNHIupeEcFCO+vgomHBKo/i4DeetrQYGDGkicvR7ztP8k=
# =mivB
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 22 Oct 2025 07:29:23 AM CDT
# gpg:                using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1
# gpg: Good signature from "Cédric Le Goater <clg@redhat.com>" [full]
# gpg:                 aka "Cédric Le Goater <clg@kaod.org>" [full]

* tag 'pull-aspeed-20251022' of https://github.com/legoater/qemu:
  hw/arm/aspeed: Remove ast2700fc self-aliasing
  hw/arm/aspeed: ast2600-evb: Use w25q512jv flash model
  tests/qtest: Add qtest for for ASPEED GPIO gpio-set property
  hw/gpio: Add property for ASPEED GPIO in 32 bits basis
  tests/functional/aarch64/ast2700fc: Add vbootrom test
  tests/functional/aarch64/ast2700fc: Move coprocessor image loading to common function
  tests/functional/aarch64/ast2700fc: Add eth2 network interface check in PCIe test
  tests/functional/aarch64/ast2700fc: Update test ASPEED SDK v09.08
  hw/arm/aspeed_ast27x0-fc: Add VBOOTROM support
  hw/arm/aspeed_ast27x0-fc: Map FMC0 flash contents into CA35 boot ROM
  hw/arm/ast27x0: Share single UART set across PSP, SSP, and TSP
  hw/arm/ast27x0: Share single SCU instance across PSP, SSP, and TSP
  hw/arm/ast27x0: Add SRAM link and alias mapping for TSP coprocessor
  hw/arm/ast27x0: Add SRAM link and alias mapping for SSP coprocessor
  hw/arm/aspeed_ast27x0-tsp: Add SDRAM region and fix naming and size to 512MB
  hw/arm/aspeed_ast27x0-ssp: Add SDRAM region and fix naming and size to 512MB

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agoMerge tag 'uefi-20251022-pull-request' of https://gitlab.com/kraxel/qemu into staging
Richard Henderson [Wed, 22 Oct 2025 13:00:31 +0000 (08:00 -0500)] 
Merge tag 'uefi-20251022-pull-request' of https://gitlab.com/kraxel/qemu into staging

uefi: add firmware log monitor commands

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmj4uSUACgkQTLbY7tPo
# cTiV7BAA2lRC9GkqIJ6E73Dmrbr9OPccN9YK+G4wccYa0BYlSJOW5FDxzSnLTPCQ
# y9AbsRCLCy2ou8PrVpRQYO/U0Y2zxy07Wzu1YGcVNh7IxxOd3B47mNpzD18YCKnH
# merlQrRdkMID4kVKNfXWvOoCgl7z/XnELQLz2fvMSNGlGD4PTAKKxm+46wxA7gTb
# uKoOX7uclMVYAP4r/dHMOr4T9PAmbhRZCmr4FZpp0EA4+aVWv3GP0KK2VB0mI2Nr
# aZpPo81iFjL+XQJh6A3El9Ez3JOJ+3qDt1+x9vLmTJxQyxUu6MvlCT8T+9v0ZuAi
# V1Gh6qKHCzmfEZLsw1h8sZ2bh7GXsgzGuETPn7sY7cIt7R+qzQxYXs+wLDkC4zcT
# YxRQu7SDS7ImoTvL6LQ9ksIZtC4Xml8dPNG7+r6so0AcKUVPPvaDO6Rd583fk/3X
# ztZ6gymPjVLldMhty+D0A2XxGndIxtFK05ugDHrWQxqLP13aRXrBBbO239h619Ia
# orNzSyHglUtpo6Q8fHb6JHGi3l4uE88kufQGAtltBAtdn3g+OxuinxgOzZTnfm7H
# 5uasQM/ykdf8LLAqcTztti78I1Rnv8rusiVU+fq5qYsn5cPvixQqt2fCZBd9MXBk
# CD2fVwHedNBpAUJnflkAMQ188tEWpf+Le1AgI7/n5MIe2rexJEg=
# =h5Tv
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 22 Oct 2025 05:59:49 AM CDT
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [unknown]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [unknown]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [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: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* tag 'uefi-20251022-pull-request' of https://gitlab.com/kraxel/qemu:
  hw/uefi/ovmf-log: add maxsize parameter
  hw/uefi: add 'info firmware-log' hmp monitor command.
  hw/uefi: add query-firmware-log monitor command

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agoMerge tag 'hw-misc-20251021' of https://github.com/philmd/qemu into staging
Richard Henderson [Wed, 22 Oct 2025 12:59:40 +0000 (07:59 -0500)] 
Merge tag 'hw-misc-20251021' of https://github.com/philmd/qemu into staging

Misc HW patches

- Replace compile-time checks by runtime ones to build virtio-mem.c once
- Cleanups in Raven PCI host bridge, audio and PC devices
- Allow machine dynamic registration of valid CPU types
- Introduce DEFINE_MACHINE_WITH_INTERFACE[_ARRAY]() macros
- Set DDR2 minimum write recovery time in EEPROM SPD
- Have PPCe500 machines abort gracefully when using invalid CPU
- Prevent buffer overflow in openrisc_sim_init()
- Pass PCI domain to Xen xc_physdev_map_pirq_msi()
- Fix register API leaks
- Simplify Xilinx CANFD model
- Unconditionally create System I/O on PReP machine
- Update documentation around '-soundhw' command line option

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmj4k3QACgkQ4+MsLN6t
# wN7dTw/9EIt8F4b0Y8fYgXngAPyNm4GxVPNJt1ULUIbG/D8NSPcXmbTyFwC+1HL+
# KtDp5Dxs460BSWBVQUH1BYlrcJTkl2UP/hB31md3S5E3GtKLp7dN+W96RtAENqlc
# jcGkNtNftozuA939eNmGgoxdRN8UYnHB1y423aKrZ7SpMu1AZU+XKaiF2/x5RAZJ
# hyKqEvNK8DIy+1dF8O4xJ2v8w59kmIMeptpqEIhkIkS2bsPKt6nJ1/Rw7TG9z4L5
# inIcKvYP1fRu+P0BHTUakTjkzyQtbtTNzbxJfAZ/z6/gSxbdfWOI4N0dslhxzo7Z
# thjV5O52fr+dOkHEKOvUNOKZCXNtvUlbjqZQz8GfOwvneEca6LpJwZu0ZikHx7vY
# y7e1d8FzC3qDSwLzXu4f1a/HiuPPAeYpLz7kfW5q3Y43ahtp+SurDswv2kBKk8GK
# ZbgMO0bw0C5rV/bnoqItG4Ce+MzROkY/CWDNAy9AcjwzTL/SmMryXTFcKHcpHEoL
# ya4hADwNR5df2ItquZ/YkNFkmpWHUM3cMlWQYDpQe2hgmIyObSGCluUJ/hlwyEJY
# nlTypsC2ui+eH+CkB3fWcjOCcYo/FFRKOn4MLWcXczTgMnI41n6VyUlcO7vyhEXD
# 2xTSvGe0+7z/C0KDqWYDOWab1GuPVAjjInD8Ygo0u3CBU2jCR1M=
# =Tz8F
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 22 Oct 2025 03:19:00 AM CDT
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.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: FAAB E75E 1291 7221 DCFD  6BB2 E3E3 2C2C DEAD C0DE

* tag 'hw-misc-20251021' of https://github.com/philmd/qemu: (45 commits)
  docs: Update mentions of removed '-soundhw' command line option
  docs: update -soundhw -> -device list
  MAINTAINERS: Add missing machine name in the Alpha section
  qemu/target-info: Include missing 'qapi-types-common.h' header
  hw/ppc/spapr: Rename resize_hpt_err to errp
  hw/audio: replace AUD_log() usage
  hw/pcspk: check the "pit" is set
  hw/pcspk: make 'pit' a class property
  hw/pcspk: use explicitly the required PIT types
  hw/audio: remove global pcspk
  hw/audio: rename model list function
  hw/audio: improve error reports
  tests/qtest/ds1338: Reuse from_bcd()
  hw/intc/apic: Pass APICCommonState to apic_register_{read,write}
  hw/i386/apic: Ensure own APIC use in apic_msr_{read,write}
  hw/i386/apic: Prefer APICCommonState over DeviceState
  hw/ide/ide-internal: Move dma_buf_commit() into ide "namespace"
  hw/rtc/mc146818rtc: Assert correct usage of mc146818rtc_set_cmos_data()
  hw/rtc/mc146818rtc: Use ARRAY_SIZE macro
  hw/rtc/mc146818rtc: Convert CMOS_DPRINTF() into trace events
  ...

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
6 weeks agohw/uefi/ovmf-log: add maxsize parameter
Gerd Hoffmann [Fri, 17 Oct 2025 11:50:05 +0000 (13:50 +0200)] 
hw/uefi/ovmf-log: add maxsize parameter

Allow limiting the amount of log output sent.  Allow up to 1 MiB.
In case the guest log buffer is larger than 1 MiB limit the output
instead of throwing an error.

Acked-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20251017115006.2696991-4-kraxel@redhat.com>

6 weeks agohw/uefi: add 'info firmware-log' hmp monitor command.
Gerd Hoffmann [Fri, 17 Oct 2025 11:50:04 +0000 (13:50 +0200)] 
hw/uefi: add 'info firmware-log' hmp monitor command.

This adds the hmp variant of the query-firmware-log qmp command.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20251017115006.2696991-3-kraxel@redhat.com>

6 weeks agohw/uefi: add query-firmware-log monitor command
Gerd Hoffmann [Fri, 17 Oct 2025 11:50:03 +0000 (13:50 +0200)] 
hw/uefi: add query-firmware-log monitor command

Starting with the edk2-stable202508 tag OVMF (and ArmVirt too) have
optional support for logging to a memory buffer.  There is guest side
support -- for example in linux kernels v6.17+ -- to read that buffer.
But that might not helpful if your guest stops booting early enough that
guest tooling can not be used yet.  So host side support to read that
log buffer is a useful thing to have.

This patch implements the query-firmware-log qmp monitor command to
read the firmware log.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-ID: <20251017115006.2696991-2-kraxel@redhat.com>

6 weeks agodocs: Update mentions of removed '-soundhw' command line option
Philippe Mathieu-Daudé [Tue, 21 Oct 2025 13:11:07 +0000 (15:11 +0200)] 
docs: Update mentions of removed '-soundhw' command line option

The `-soundhw` CLI was removed in commit 039a68373c4 ("introduce
-audio as a replacement for -soundhw"). Remove outdated comments
and update the document mentioning the old usage.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20251021131825.99390-2-philmd@linaro.org>

6 weeks agodocs: update -soundhw -> -device list
Marc-André Lureau [Tue, 21 Oct 2025 09:02:38 +0000 (13:02 +0400)] 
docs: update -soundhw -> -device list

(note: I wonder if pcspk was really an option when -soundhw was
available, since it was not user-creatable)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20251021090317.425409-8-marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agoMAINTAINERS: Add missing machine name in the Alpha section
Thomas Huth [Mon, 20 Oct 2025 14:04:24 +0000 (16:04 +0200)] 
MAINTAINERS: Add missing machine name in the Alpha section

Without a machine name here, get_maintainers.pl uses the "-----..."
separator for describing what the maintainer is taking care of:

 $ scripts/get_maintainer.pl -f hw/alpha/dp264.c
 Richard Henderson <richard.henderson@linaro.org> (maintainer:--------------)
 qemu-devel@nongnu.org (open list:All patches CC here)

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251020140425.45003-1-thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agoqemu/target-info: Include missing 'qapi-types-common.h' header
Philippe Mathieu-Daudé [Tue, 13 May 2025 11:33:29 +0000 (12:33 +0100)] 
qemu/target-info: Include missing 'qapi-types-common.h' header

When adding the TargetInfo::@endianness field in commit a37aec2e7d8,
we neglected to include the "qapi-types-common.h" header to get the
EndianMode enum definition. Fix that.

Fixes: a37aec2e7d8 ("qemu/target-info: Add target_endian_mode()")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-Id: <20251020220941.65269-10-philmd@linaro.org>

6 weeks agohw/ppc/spapr: Rename resize_hpt_err to errp
Vishal Chourasia [Tue, 21 Oct 2025 10:54:44 +0000 (16:24 +0530)] 
hw/ppc/spapr: Rename resize_hpt_err to errp

Rename resize_hpt_err to standard errp naming convention.

Signed-off-by: Vishal Chourasia <vishalc@linux.ibm.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251021105442.1474602-9-vishalc@linux.ibm.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agohw/audio: replace AUD_log() usage
Marc-André Lureau [Tue, 21 Oct 2025 09:03:02 +0000 (13:03 +0400)] 
hw/audio: replace AUD_log() usage

AUD_log() is just printf(stderr, "prefix: "..), we can use
error_report() or warn_report() appropriately instead.

Ideally it should be converted to traces, but there are many places to
convert, this is left for another day.

Avoid bit-rot by using conditionals.

The patch could be splitted if necessary.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251021090317.425409-32-marcandre.lureau@redhat.com>
[PMD: Fixed checkpatch.pl issues]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agohw/pcspk: check the "pit" is set
Marc-André Lureau [Tue, 21 Oct 2025 09:02:37 +0000 (13:02 +0400)] 
hw/pcspk: check the "pit" is set

We don't let the user create a "isa-pcspk" via -device yet (in theory,
we could, and fallback on a lookup PIT), but we can add some safety
checks that the property was correctly set nonetheless.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251021090317.425409-7-marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agohw/pcspk: make 'pit' a class property
Marc-André Lureau [Tue, 21 Oct 2025 09:02:36 +0000 (13:02 +0400)] 
hw/pcspk: make 'pit' a class property

This should be functionally equivalent. (for some reason, the device
property was convert to an object instance property in commit 873b4d3f0571)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20251021090317.425409-6-marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agohw/pcspk: use explicitly the required PIT types
Marc-André Lureau [Tue, 21 Oct 2025 09:02:35 +0000 (13:02 +0400)] 
hw/pcspk: use explicitly the required PIT types

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251021090317.425409-5-marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agohw/audio: remove global pcspk
Marc-André Lureau [Tue, 21 Oct 2025 09:02:34 +0000 (13:02 +0400)] 
hw/audio: remove global pcspk

It is no longer used since commit 6033b9ecd4 ("pc: remove -soundhw pcspk")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251021090317.425409-4-marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agohw/audio: rename model list function
Marc-André Lureau [Tue, 21 Oct 2025 09:02:33 +0000 (13:02 +0400)] 
hw/audio: rename model list function

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251021090317.425409-3-marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agohw/audio: improve error reports
Marc-André Lureau [Tue, 21 Oct 2025 09:02:32 +0000 (13:02 +0400)] 
hw/audio: improve error reports

The -audiodev argument is 'model=..', use same terminology.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251021090317.425409-2-marcandre.lureau@redhat.com>
[PMD: Fixed checkpatch.pl issues]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agotests/qtest/ds1338: Reuse from_bcd()
Bernhard Beschow [Sun, 19 Oct 2025 21:03:03 +0000 (23:03 +0200)] 
tests/qtest/ds1338: Reuse from_bcd()

from_bcd() is a public API function which can be unit-tested. Reuse it to avoid
code duplication.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Message-ID: <20251019210303.104718-11-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agohw/arm/aspeed: Remove ast2700fc self-aliasing
Philippe Mathieu-Daudé [Tue, 21 Oct 2025 11:04:27 +0000 (13:04 +0200)] 
hw/arm/aspeed: Remove ast2700fc self-aliasing

Remove pointless alias to the very same machine:

  $ qemu-system-aarch64 -M help | fgrep ast2700fc
  ast2700fc            ast2700 full core support (alias of ast2700fc)
  ast2700fc            ast2700 full core support

Fixes: a74faf35efc ("hw/arm: Introduce ASPEED AST2700 A1 full core machine")
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251021110427.93991-1-philmd@linaro.org
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agohw/arm/aspeed: ast2600-evb: Use w25q512jv flash model
Cédric Le Goater [Thu, 16 Oct 2025 21:24:37 +0000 (23:24 +0200)] 
hw/arm/aspeed: ast2600-evb: Use w25q512jv flash model

The ast2600-evb machine model is using the "mx66u51235f" flash model,
which has issues with recent Linux kernels (6.15+) when reading SFDP
data.

Change the flash model to "w25q512jv", which is the model present on
some ast2600a3 EVB board and is known to work correctly with recent
kernels. Adjust the corresponding qtest to reflect the new JEDEC ID of
the w25q512jv flash.

Reviewed-by: Jamin Lin <jamin_lin@aspeedtech.com>
Link: https://lore.kernel.org/qemu-devel/20251016212437.1046135-1-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agotests/qtest: Add qtest for for ASPEED GPIO gpio-set property
Felix Wu [Wed, 15 Oct 2025 01:18:26 +0000 (01:18 +0000)] 
tests/qtest: Add qtest for for ASPEED GPIO gpio-set property

 - Added qtests to test gpio-set property for ASPEED.
 - Added function to get uint in qdict.

Signed-off-by: Felix Wu <flwu@google.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015011830.1688468-3-lixiaoyan@google.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agohw/gpio: Add property for ASPEED GPIO in 32 bits basis
Felix Wu [Wed, 15 Oct 2025 01:18:25 +0000 (01:18 +0000)] 
hw/gpio: Add property for ASPEED GPIO in 32 bits basis

Added 32 bits property for ASPEED GPIO. Previously it can only be
access in bitwise manner.

The changes to qobject is to index gpios with array indices on top of
accessing with registers.  This allows for easier gpio access,
especially in tests with complex behaviors that requires large number
of gpios at a time, like fault injection and networking behaviors.

Indexing multiple gpios at once allows qmp/side band client to no
longer hardcode and populate register names and manipulate them
faster.

Signed-off-by: Felix Wu <flwu@google.com>
Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Link: https://lore.kernel.org/qemu-devel/20251015011830.1688468-2-lixiaoyan@google.com
[ clg: wrapped commit log lines ]
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agotests/functional/aarch64/ast2700fc: Add vbootrom test
Jamin Lin [Wed, 15 Oct 2025 06:22:07 +0000 (14:22 +0800)] 
tests/functional/aarch64/ast2700fc: Add vbootrom test

Add start_ast2700fc_test_vbootrom() which boots the ast2700fc machine
with -bios ast27x0_bootrom.bin and reuses the coprocessor loader.

Add test_aarch64_ast2700fc_sdk_vbootrom_v09_08() to test the vbootrom
with ast2700fc machine.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-13-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agotests/functional/aarch64/ast2700fc: Move coprocessor image loading to common function
Jamin Lin [Wed, 15 Oct 2025 06:22:06 +0000 (14:22 +0800)] 
tests/functional/aarch64/ast2700fc: Move coprocessor image loading to common function

This removes duplicate code in start_ast2700fc_test() and prepares for reuse in
upcoming VBOOTROM tests.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-12-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agotests/functional/aarch64/ast2700fc: Add eth2 network interface check in PCIe test
Jamin Lin [Wed, 15 Oct 2025 06:22:05 +0000 (14:22 +0800)] 
tests/functional/aarch64/ast2700fc: Add eth2 network interface check in PCIe test

Enhance the AST2700 functional PCIe test to verify the network interface
configuration for eth2. This adds an additional command to check the IP
address assignment on eth2 to ensure network functionality is correctly
initialized in the test environment.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-11-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agotests/functional/aarch64/ast2700fc: Update test ASPEED SDK v09.08
Jamin Lin [Wed, 15 Oct 2025 06:22:04 +0000 (14:22 +0800)] 
tests/functional/aarch64/ast2700fc: Update test ASPEED SDK v09.08

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-10-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agohw/arm/aspeed_ast27x0-fc: Add VBOOTROM support
Jamin Lin [Wed, 15 Oct 2025 06:22:03 +0000 (14:22 +0800)] 
hw/arm/aspeed_ast27x0-fc: Add VBOOTROM support

Introduces support for loading a vbootrom image into the dedicated vbootrom
memory region in the AST2700 Full Core machine.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-9-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agohw/arm/aspeed_ast27x0-fc: Map FMC0 flash contents into CA35 boot ROM
Jamin Lin [Wed, 15 Oct 2025 06:22:02 +0000 (14:22 +0800)] 
hw/arm/aspeed_ast27x0-fc: Map FMC0 flash contents into CA35 boot ROM

This patch introduces a dedicated ca35_boot_rom memory region and
copies the FMC0 flash data into it.

The motivation is to support the upcoming vbootrom. The vbootrom
replaces the existing BOOTMCU (RISC-V 32 SPL) flow, which currently reads
the "image-bmc" from FMC_CS0 and loads the following components
into DRAM:

- Trusted Firmware-A
- OP-TEE OS
- u-boot-nodtb.bin
- u-boot.dtb

After loading, BOOTMCU releases the CA35 reset so that CA35 can start
executing Trusted Firmware-A.

The vbootrom follows the same sequence: CA35 fetches "image-bmc" from FMC0
flash at the SPI boot ROM base address (0x100000000), parses the FIT image,
loads each component into its designated DRAM location, and then jumps to
Trusted Firmware-A.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-8-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agohw/arm/ast27x0: Share single UART set across PSP, SSP, and TSP
Jamin Lin [Wed, 15 Oct 2025 06:22:01 +0000 (14:22 +0800)] 
hw/arm/ast27x0: Share single UART set across PSP, SSP, and TSP

In the original model, each subsystem (PSP, SSP, and TSP) created its own
set of 13 UART devices, resulting in a total of 39 UART instances. However,
on real AST2700 hardware, there is only one set of 13 UARTs shared among
all processors.

This commit reworks the UART handling to correctly model the shared
hardware design. The PSP now creates the full set of 13 UART instances,
while the SSP and TSP link to the corresponding shared UART device
through object properties.

Changes include:
- Add "DEFINE_PROP_LINK("uart", ...)" and "DEFINE_PROP_INT32("uart-dev", ...)"
  to allow each coprocessor to reference a specific shared UART instance.
- Modify SSP to link to PSP’s UART4, and TSP to link to PSP’s UART7.
- Introduce "uart_alias" to remap the UART’s MMIO region into the coprocessor’s
  memory space.
- Redirect the UART interrupt to the coprocessor’s NVIC, replacing the
  default routing to the PSP’s GIC.

With this change, only one set of 13 UART devices is instantiated by the PSP,
while the SSP and TSP reuse them via aliasing and shared interrupt routing,
matching the real AST2700 hardware behavior.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-7-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agohw/arm/ast27x0: Share single SCU instance across PSP, SSP, and TSP
Jamin Lin [Wed, 15 Oct 2025 06:22:00 +0000 (14:22 +0800)] 
hw/arm/ast27x0: Share single SCU instance across PSP, SSP, and TSP

AST2700 has a single SCU hardware block, memory-mapped at
0x12C02000–0x12C03FFF from the perspective of the main CA35 processor (PSP).
The SSP and TSP coprocessors access this same SCU block at different
addresses: 0x72C02000–0x72C03FFF.

Previously, each subsystem (PSP, SSP, and TSP) instantiated its own SCU
device, resulting in three independent SCU instances in the QEMU model.
In real hardware, however, only a single SCU exists and is shared among
all processors.

This commit reworks the SCU model to correctly reflect the hardware
behavior by allowing SSP and TSP to reference the PSP’s SCU instance.
The following changes are introduced:

- Add a scu property to AspeedCoprocessorState for linking the
  coprocessor to the PSP’s SCU instance.
- Replace per-coprocessor SCU instantiation with a shared SCU link.
- Add "MemoryRegion scu_alias" to model address remapping for SSP and TSP.
- Create SCU alias regions in both SSP and TSP coprocessors and map
  them at 0x72C02000 to mirror the PSP’s SCU registers.
- Ensure the SCU device in PSP is realized before SSP/TSP alias setup.

With this change, PSP, SSP, and TSP now share a consistent SCU state,
matching the single-SCU hardware design of AST2700.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-6-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agohw/arm/ast27x0: Add SRAM link and alias mapping for TSP coprocessor
Jamin Lin [Wed, 15 Oct 2025 06:21:59 +0000 (14:21 +0800)] 
hw/arm/ast27x0: Add SRAM link and alias mapping for TSP coprocessor

AST2700 has a 128KB SRAM, physically mapped at 0x10000000–0x1001FFFF for
the PSP (CA35) processor. The TSP coprocessor shares this same SRAM but
accesses it through a different address window at 0x70000000–0x7001FFFF.

To model this shared-memory behavior in QEMU, this commit introduces a
linked SRAM property and alias mapping between the PSP and TSP subsystems.

Changes include:
- Add the SRAM alias mapping at 0x70000000 in aspeed_ast27x0-tsp.c.
- In aspeed_ast27x0-fc.c, connect the TSP coprocessor’s "sram" link to
  the PSP’s SRAM region.
- Ensure the alias region is initialized during TSP SoC realization so
  the TSP can correctly access shared SRAM through its own address space.

This ensures that the TSP and PSP share the same physical SRAM backing.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-5-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agohw/arm/ast27x0: Add SRAM link and alias mapping for SSP coprocessor
Jamin Lin [Wed, 15 Oct 2025 06:21:58 +0000 (14:21 +0800)] 
hw/arm/ast27x0: Add SRAM link and alias mapping for SSP coprocessor

AST2700 has a 128KB SRAM, physically mapped at 0x10000000–0x1001FFFF for
the PSP (CA35) processor. The SSP coprocessor shares this same SRAM but
accesses it through a different address window at 0x70000000–0x7001FFFF.

To model this shared-memory behavior in QEMU, this commit introduces a
linked SRAM property and alias mapping between the PSP and SSP subsystems.

Changes include:
- Add a "MemoryRegion *sram" link and "MemoryRegion sram_alias" to
  AspeedCoprocessorState.
- Register the new "sram" property in aspeed_coprocessor_common.c.
- In aspeed_ast27x0-fc.c, connect the SSP coprocessor’s "sram" link to
  the PSP’s SRAM region.
- In aspeed_ast27x0-ssp.c, create an alias mapping for SRAM at
  0x70000000 – 0x7001FFFF in the SSP’s memory map.

This ensures that the SSP can correctly access the shared SRAM contents
through its own address space while maintaining a consistent physical
backing region. It also guarantees that the SRAM is realized before the
SSP device, ensuring successful alias setup.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-4-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agohw/arm/aspeed_ast27x0-tsp: Add SDRAM region and fix naming and size to 512MB
Jamin Lin [Wed, 15 Oct 2025 06:21:57 +0000 (14:21 +0800)] 
hw/arm/aspeed_ast27x0-tsp: Add SDRAM region and fix naming and size to 512MB

Previously, the TSP memory was incorrectly modeled as "SRAM" with
a 32 MB size. Rename from SRAM to SDRAM and correct size from 32MB
to 512MB to match hardware.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-3-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agohw/arm/aspeed_ast27x0-ssp: Add SDRAM region and fix naming and size to 512MB
Jamin Lin [Wed, 15 Oct 2025 06:21:56 +0000 (14:21 +0800)] 
hw/arm/aspeed_ast27x0-ssp: Add SDRAM region and fix naming and size to 512MB

Previously, the SSP memory was incorrectly modeled as "SRAM" with
a 32 MB size. This change introduces a new sdram field in
AspeedCoprocessorState and updates the realization logic accordingly.
Rename from SRAM to SDRAM and correct size from 32MB to 512MB to match
hardware.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251015062210.3128710-2-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agovfio: only check region info cache for initial regions
John Levon [Tue, 14 Oct 2025 15:12:27 +0000 (17:12 +0200)] 
vfio: only check region info cache for initial regions

It is semantically valid for a VFIO device to increase the number of
regions after initialization. In this case, we'd attempt to check for
cached region info past the size of the ->reginfo array. Check for the
region index and skip the cache in these cases.

This also works around some VGPU use cases which appear to be a bug,
where VFIO_DEVICE_QUERY_GFX_PLANE returns a region index beyond the
reported ->num_regions.

Fixes: 95cdb024 ("vfio: add region info cache")
Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Alex Williamson <alex@shazbot.org>
Link: https://lore.kernel.org/qemu-devel/20251014151227.2298892-3-john.levon@nutanix.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agovfio: rename field to "num_initial_regions"
John Levon [Tue, 14 Oct 2025 15:12:26 +0000 (17:12 +0200)] 
vfio: rename field to "num_initial_regions"

We set VFIODevice::num_regions at initialization time, and do not
otherwise refresh it. As it is valid in theory for a VFIO device to
later increase the number of supported regions, rename the field to
"num_initial_regions" to better reflect its semantics.

Signed-off-by: John Levon <john.levon@nutanix.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Alex Williamson <alex@shazbot.org>
Link: https://lore.kernel.org/qemu-devel/20251014151227.2298892-2-john.levon@nutanix.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agoMAINTAINERS: Update Alex Williamson's email address
Alex Williamson [Mon, 13 Oct 2025 15:35:35 +0000 (09:35 -0600)] 
MAINTAINERS: Update Alex Williamson's email address

Switch to a personal email account as I'll be leaving Red Hat soon.

Signed-off-by: Alex Williamson <alex@shazbot.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251013153543.3091169-1-alex.williamson@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agodocs/system/devices/vfio-user: fix formatting
John Levon [Thu, 9 Oct 2025 14:02:06 +0000 (16:02 +0200)] 
docs/system/devices/vfio-user: fix formatting

The example QEMU argument was not rendering properly, as it was not
indented.

Signed-off-by: John Levon <john.levon@nutanix.com>
Fixes: c688cc165b ("docs: add vfio-user documentation")
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20251009140206.386249-1-john.levon@nutanix.com
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agovfio/listener: Add an assertion for unmap_all
Zhenzhong Duan [Thu, 9 Oct 2025 04:01:34 +0000 (00:01 -0400)] 
vfio/listener: Add an assertion for unmap_all

Currently the maximum of iommu address space is 64bit. So when a maximum
iommu memory section is deleted, it's in scope [0, 2^64). Add a
assertion for that.

Suggested-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251009040134.334251-4-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agovfio/iommufd: Support unmap all in one ioctl()
Zhenzhong Duan [Thu, 9 Oct 2025 04:01:33 +0000 (00:01 -0400)] 
vfio/iommufd: Support unmap all in one ioctl()

IOMMUFD kernel uAPI supports unmapping whole address space in one call with
[iova, size] set to [0, UINT64_MAX], this can simplify iommufd_cdev_unmap()
a bit. See iommufd_ioas_unmap() in kernel for details.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251009040134.334251-3-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agovfio/container: Support unmap all in one ioctl()
Zhenzhong Duan [Thu, 9 Oct 2025 04:01:32 +0000 (00:01 -0400)] 
vfio/container: Support unmap all in one ioctl()

VFIO type1 kernel uAPI supports unmapping whole address space in one call
since commit c19650995374 ("vfio/type1: implement unmap all"). Use the
unmap_all variant whenever it's supported in kernel.

Opportunistically pass VFIOLegacyContainer pointer in low level function
vfio_legacy_dma_unmap_one().

Co-developed-by: John Levon <levon@movementarian.org>
Signed-off-by: John Levon <levon@movementarian.org>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20251009040134.334251-2-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agoaccel/kvm: Fix an erroneous check on coalesced_mmio_ring
Zhenzhong Duan [Sun, 28 Sep 2025 08:54:31 +0000 (04:54 -0400)] 
accel/kvm: Fix an erroneous check on coalesced_mmio_ring

According to KVM uAPI, coalesced mmio page is KVM_COALESCED_MMIO_PAGE_OFFSET
offset from kvm_run pages. For x86 it's 2 pages offset, for arm it's 1 page
offset currently. We shouldn't presume it's hardcoded 1 page or else
coalesced_mmio_ring will not be cleared in do_kvm_destroy_vcpu() in x86.

Fixes: 7ed0919119b0 ("migration: close kvm after cpr")
Cc: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
Link: https://lore.kernel.org/qemu-devel/20250928085432.40107-6-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agovfio/iommufd: Restore vbasedev's reference to hwpt after CPR transfer
Zhenzhong Duan [Sun, 28 Sep 2025 08:54:30 +0000 (04:54 -0400)] 
vfio/iommufd: Restore vbasedev's reference to hwpt after CPR transfer

After CPR transfer, if there are more than one VFIO devices, device is
not added to hwpt->device_list and its reference to hwpt isn't restored
on destination. We still need to call iommufd_cdev_attach_container() to
restore it after a matching container is found, or else SIGSEV triggers.

Fixes: 4296ee07455e ("vfio/iommufd: reconstruct device")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
Link: https://lore.kernel.org/qemu-devel/20250928085432.40107-5-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agovfio/iommufd: Set cpr.ioas_id on source side for CPR transfer
Zhenzhong Duan [Sun, 28 Sep 2025 08:54:29 +0000 (04:54 -0400)] 
vfio/iommufd: Set cpr.ioas_id on source side for CPR transfer

On source side, if there are more than one VFIO devices and they
attach to same container, only the first device sets cpr.ioas_id,
the others are bypassed. We should set it for each device, or
else only first device works.

Fixes: 4296ee07455e ("vfio/iommufd: reconstruct device")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
Link: https://lore.kernel.org/qemu-devel/20250928085432.40107-4-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agovfio/cpr-legacy: drop an erroneous assert
Zhenzhong Duan [Sun, 28 Sep 2025 08:54:28 +0000 (04:54 -0400)] 
vfio/cpr-legacy: drop an erroneous assert

vfio_legacy_cpr_dma_map() is not only used in post_load on destination
but also error recovery path on source side. Assert it for destination
is wrong.

Fixes: 7e9f21411302 ("vfio/container: restore DMA vaddr")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
Link: https://lore.kernel.org/qemu-devel/20250928085432.40107-3-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agovfio/container: Remap only populated parts in a section
Zhenzhong Duan [Sun, 28 Sep 2025 08:54:27 +0000 (04:54 -0400)] 
vfio/container: Remap only populated parts in a section

If there are multiple containers and unmap-all fails for some of them, we
need to remap vaddr for the other containers for which unmap-all succeeded.
When ram discard is enabled, we should only remap populated parts in a
section instead of the whole section.

Fixes: eba1f657cbb1 ("vfio/container: recover from unmap-all-vaddr failure")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Steven Sistare <steven.sistare@oracle.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20250928085432.40107-2-zhenzhong.duan@intel.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
6 weeks agohw/intc/apic: Pass APICCommonState to apic_register_{read,write}
Bernhard Beschow [Sun, 19 Oct 2025 21:03:02 +0000 (23:03 +0200)] 
hw/intc/apic: Pass APICCommonState to apic_register_{read,write}

As per the previous patch, the APIC instance is already available in
apic_msr_{read,write}, so it can be passed along. It turns out that
the call to cpu_get_current_apic() is only required in
apic_mem_{read,write}, so it has been moved there. Longer term,
cpu_get_current_apic() could be removed entirely if
apic_mem_{read,write} is tied to a CPU's local address space.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251019210303.104718-10-shentey@gmail.com>
[PMD: Move return after apic_send_msi() in apic_mem_write()]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agohw/i386/apic: Ensure own APIC use in apic_msr_{read,write}
Bernhard Beschow [Sun, 19 Oct 2025 21:03:01 +0000 (23:03 +0200)] 
hw/i386/apic: Ensure own APIC use in apic_msr_{read,write}

Avoids the `current_cpu` global and seems more robust by not "forgetting" the
own APIC and then re-determining it by cpu_get_current_apic() which uses the
global.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251019210303.104718-9-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agohw/i386/apic: Prefer APICCommonState over DeviceState
Bernhard Beschow [Sun, 19 Oct 2025 21:03:00 +0000 (23:03 +0200)] 
hw/i386/apic: Prefer APICCommonState over DeviceState

Makes the APIC API more type-safe by resolving quite a few APIC_COMMON
downcasts.

Like PICCommonState, the APICCommonState is now a public typedef while staying
an abstract datatype.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251019210303.104718-8-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
6 weeks agohw/ide/ide-internal: Move dma_buf_commit() into ide "namespace"
Bernhard Beschow [Sun, 19 Oct 2025 21:02:59 +0000 (23:02 +0200)] 
hw/ide/ide-internal: Move dma_buf_commit() into ide "namespace"

The identifier suggests that it is a generic DMA function while it is tied
to IDE. Fix this by adding an "ide_" prefix.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251019210303.104718-7-shentey@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>