qemu-cr16/hw/ppc
Fabiano Rosas 639ffcbd64 target/ppc: Fix env->quiesced migration
The commit referenced (from QEMU 10.0) has changed the way the pseries
machine marks a cpu as quiesced. Previously, the cpu->halted value
from QEMU common cpu code was (incorrectly) used. With the fix, the
env->quiesced variable starts being used, which improves on the
original situation, but also causes a side effect after migration:

The env->quiesced is set at reset and never migrated, which causes the
destination QEMU to stop delivering interrupts and hang the machine.

To fix the issue from this point on, start migrating the env->quiesced
value.

For QEMU versions < 10.0, sending the new element on the stream would
cause migration to be aborted, so add the appropriate compatibility
property to omit the new subsection.

Independently of this patch, all migrations from QEMU versions < 10.0
would result in a hang since the older QEMU never migrates
env->quiesced. This is bad because it leaves machines already running
on the old QEMU without a migration path into newer versions.

As a workaround, use a few heuristics to infer the new value of
env->quiesced based on cpu->halted, LPCR and PSSCR bits that are
usually set/cleared along with quiesced.

Note that this was tested with -cpu power9 and -machine ic-mode=xive
due to another bug affecting migration of XICS guests. Tested both
forward and backward migration and savevm/loadvm from 9.2 and 10.0.

Also tested loadvm of a savevm image that contains a mix of cpus both
halted and not halted.

Reported-by: Fabian Vogt <fvogt@suse.de>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3079
Fixes: fb802acdc8 ("ppc/spapr: Fix RTAS stopped state")
Acked-by: Chinmay Rath <rathc@linux.ibm.com>
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Link: https://lore.kernel.org/qemu-devel/20260109123519.28703-2-farosas@suse.de
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
(cherry picked from commit 628bda1ab7596a7cceb1c5356d23a92001c7a8c5)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2026-01-13 11:07:34 +03:00
..
amigaone.c hw/ppc: Pass error_fatal to load_image_targphys() 2025-10-28 08:19:18 +01:00
e500-ccsr.h Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
e500.c hw/ppc: Pass error_fatal to load_image_targphys() 2025-10-28 08:19:18 +01:00
e500.h hw/ppc/e500: Move clock and TB frequency to machine class 2025-06-10 12:59:09 +02:00
e500plat.c hw/ppc/e500: Move clock and TB frequency to machine class 2025-06-10 12:59:09 +02:00
fdt.c
fw_cfg.c hw/ppc: Implement fw_cfg_arch_key_name() 2019-05-23 14:10:31 +02:00
Kconfig hw/ppc/pegasos2: Rename to pegasos 2025-10-30 13:40:38 +05:30
mac_newworld.c hw/ppc: Pass error_fatal to load_image_targphys() 2025-10-28 08:19:18 +01:00
mac_oldworld.c hw/ppc: Pass error_fatal to load_image_targphys() 2025-10-28 08:19:18 +01:00
meson.build hw/ppc/pegasos2: Rename to pegasos 2025-10-30 13:40:38 +05:30
mpc8544_guts.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
mpc8544ds.c hw/ppc/e500: Move clock and TB frequency to machine class 2025-06-10 12:59:09 +02:00
pef.c qom: remove redundant typedef when use OBJECT_DECLARE_SIMPLE_TYPE 2025-10-28 08:08:04 +01:00
pegasos.c hw/ppc/pegasos: Fix memory leak 2025-11-09 16:54:44 +05:30
pnv.c hw/ppc: Pass error_fatal to load_image_targphys() 2025-10-28 08:19:18 +01:00
pnv_adu.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pnv_bmc.c ppc/pnv: Move the PNOR LPC address into struct PnvPnor 2025-03-20 19:58:10 +10:00
pnv_chiptod.c ppc/pnv: Add ChipTOD model for Power11 2025-09-28 23:22:06 +05:30
pnv_core.c ppc/pnv: Introduce Pnv11Chip 2025-09-28 23:21:58 +05:30
pnv_homer.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
pnv_i2c.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pnv_lpc.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pnv_n1_chiplet.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pnv_nest_pervasive.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pnv_occ.c hw/ppc/pnv_occ: skip automatic zero-init of large struct 2025-06-12 13:40:16 -04:00
pnv_pnor.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
pnv_psi.c qom: Make InterfaceInfo[] uses const 2025-04-25 17:00:41 +02:00
pnv_sbe.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
pnv_xscom.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
ppc.c cpus: properly kick CPUs out of inner execution loop 2025-09-17 19:00:55 +02:00
ppc4xx_devs.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
ppc4xx_sdram.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
ppc440.h ppc440: Remove ppc460ex_pcie_init legacy init function 2023-07-07 04:47:49 -03:00
ppc440_bamboo.c hw/ppc: Pass error_fatal to load_image_targphys() 2025-10-28 08:19:18 +01:00
ppc440_uc.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
ppc_booke.c hw/ppc: Support for an IBM PPE42 CPU decrementer 2025-09-28 23:39:19 +05:30
ppce500_spin.c hw/ppc: Do not open-code cpu_resume() in spin_kick() 2025-10-13 21:00:09 +02:00
ppe42_machine.c hw/ppc: Add a test machine for the IBM PPE42 CPU 2025-09-28 23:39:52 +05:30
prep.c audio: move audio.h under include/qemu/ 2025-10-30 22:56:51 +04:00
prep_systemio.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
rs6000_mc.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
sam460ex.c hw/ppc/sam460ex: Update u-boot-sam460ex 2025-10-30 12:33:10 +05:30
spapr.c target/ppc: Fix env->quiesced migration 2026-01-13 11:07:34 +03:00
spapr_caps.c ppc/spapr: remove deprecated machine pseries-4.0 2025-10-23 17:37:33 +05:30
spapr_cpu_core.c qom: Constify TypeInfo::class_data 2025-04-25 17:00:41 +02:00
spapr_drc.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
spapr_events.c hw/ppc/spapr: Inline few SPAPR_IRQ_* uses 2025-10-23 17:37:31 +05:30
spapr_fadump.c hw/ppc: Fix memory leak in get_cpu_state_data() 2025-10-30 13:37:18 +05:30
spapr_hcall.c ppc/spapr: remove deprecated machine pseries-3.1 2025-10-23 17:37:31 +05:30
spapr_iommu.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
spapr_irq.c ppc/spapr: Cleanup MSI IRQ number handling 2025-10-30 12:45:32 +05:30
spapr_nested.c include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
spapr_numa.c spapr: Remove support for NVIDIA V100 GPU with NVLink2 2023-09-18 07:25:28 -03:00
spapr_nvdimm.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
spapr_ovec.c exec/cpu-all: remove system/memory include 2025-04-23 15:04:57 -07:00
spapr_pci.c ppc/spapr: Cleanup MSI IRQ number handling 2025-10-30 12:45:32 +05:30
spapr_pci_vfio.c include/hw/vfio/vfio-container.h: rename file to vfio-container-legacy.h 2025-09-25 17:55:19 +02:00
spapr_rng.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
spapr_rtas.c char: rename CharBackend->CharFrontend 2025-10-28 14:49:52 +01:00
spapr_rtas_ddw.c spapr/ddw: Implement 64bit query extension 2022-07-06 10:22:37 -03:00
spapr_rtc.c qom: Have class_init() take a const data argument 2025-04-25 17:00:41 +02:00
spapr_tpm_proxy.c hw/ppc/spapr_tpm_proxy: skip automatic zero-init of large arrays 2025-06-12 13:40:16 -04:00
spapr_vhyp_mmu.c target/ppc: Unexport some functions from mmu-book3s-v3.h 2024-07-26 09:51:34 +10:00
spapr_vio.c ppc/spapr: remove deprecated machine pseries-3.0 2025-10-23 17:37:16 +05:30
spapr_vof.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
trace-events ppc/pnv: Begin a more complete ADU LPC model for POWER9/10 2024-07-26 09:21:06 +10:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
virtex_ml507.c hw/ppc: Pass error_fatal to load_image_targphys() 2025-10-28 08:19:18 +01:00
vof.c ppc/vof: Make nextprop behave more like Open Firmware 2025-10-23 17:37:35 +05:30