qemu-cr16/target/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
..
translate target/ppc: use MAKE_64BIT_MASK for mcrfs exception clear mask 2025-09-28 23:50:36 +05:30
arch_dump.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
compat.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
cpu-models.c target/ppc: Remove the unusable e200 CPUs 2025-10-30 12:39:33 +05:30
cpu-models.h target/ppc: Remove the unusable e200 CPUs 2025-10-30 12:39:33 +05:30
cpu-param.h tcg: Remove the TCG_GUEST_DEFAULT_MO definition globally 2025-04-23 15:07:32 -07:00
cpu-qom.h target/ppc: Use GDBFeature for dynamic XML 2024-02-28 09:09:25 +00:00
cpu.c include/exec: Split out watchpoint.h 2025-04-23 14:08:36 -07:00
cpu.h target/ppc: Fix env->quiesced migration 2026-01-13 11:07:34 +03:00
cpu_init.c target/ppc: Fix env->quiesced migration 2026-01-13 11:07:34 +03:00
cpu_init.h target/ppc: Add Power11 DD2.0 processor 2024-11-04 09:12:42 +10:00
dfp_helper.c target/ppc: replace assert(0) with g_assert_not_reached() 2024-09-24 13:53:35 +02:00
excp_helper.c target/ppc: call plugin trap callbacks 2025-10-29 14:12:43 +00:00
fpu_helper.c target/ppc: Move floating-point compare instructions to decodetree. 2025-09-28 23:47:36 +05:30
gdbstub.c target/ppc: Fix GDB register indexing on secondary CPUs 2024-03-30 18:50:24 +10:00
helper.h target/ppc: Move floating-point compare instructions to decodetree. 2025-09-28 23:47:36 +05:30
helper_regs.c target/ppc: Support for IBM PPE42 MMU 2025-09-28 23:26:52 +05:30
helper_regs.h codebase: prepare to remove cpu.h from exec/exec-all.h 2025-04-23 13:52:25 -07:00
insn32.decode target/ppc: Move remaining floating-point move instructions to decodetree. 2025-09-28 23:47:37 +05:30
insn64.decode target/ppc: Implemented [pm]xvbf16ger2* 2022-05-26 17:11:33 -03:00
int_helper.c target/ppc: Move VMX integer add/sub saturate insns to decodetree. 2024-07-26 09:51:33 +10:00
internal.h accel/tcg: Move cpu_get_tb_cpu_state to TCGCPUOps 2025-04-30 12:45:05 -07:00
Kconfig ppc: switch boards to "default y" 2024-05-03 15:47:47 +02:00
kvm.c target/ppc/kvm: Remove kvmppc_get_host_model() as unused 2025-10-23 17:37:32 +05:30
kvm_ppc.h target/ppc/kvm: Remove kvmppc_get_host_model() as unused 2025-10-23 17:37:32 +05:30
machine.c target/ppc: Fix env->quiesced migration 2026-01-13 11:07:34 +03:00
mem_helper.c accel/tcg: Split out accel/tcg/helper-retaddr.h 2025-04-30 12:45:06 -07:00
meson.build target/ppc: Move TCG specific exception handlers to tcg-excp_helper.c 2025-03-11 22:43:31 +10:00
misc_helper.c hw/ppc: Fix build error with CONFIG_POWERNV disabled 2025-09-02 17:57:05 +02:00
mmu-book3s-v3.c exec/cpu-all: remove system/memory include 2025-04-23 15:04:57 -07:00
mmu-book3s-v3.h target/ppc: Remove includes from mmu-book3s-v3.h 2024-07-26 09:51:34 +10:00
mmu-booke.c target/ppc: Move out BookE and related MMU functions from mmu_common.c 2024-05-24 09:43:13 +10:00
mmu-booke.h target/ppc: Move out BookE and related MMU functions from mmu_common.c 2024-05-24 09:43:13 +10:00
mmu-books.h
mmu-hash32.c include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
mmu-hash32.h exec/cpu-all: remove system/memory include 2025-04-23 15:04:57 -07:00
mmu-hash64.c include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
mmu-hash64.h qemu: Declare all load/store helper in 'qemu/bswap.h' 2025-07-15 02:56:39 -04:00
mmu-radix64.c include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
mmu-radix64.h target/ppc/mmu-radix64: Remove externally unused parts from header 2024-07-26 09:51:34 +10:00
mmu_common.c include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
mmu_helper.c include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
power8-pmu-regs.c.inc target/ppc: Add new hflags to support BHRB 2024-05-24 08:57:50 +10:00
power8-pmu.c include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
power8-pmu.h target/ppc: Add recording of taken branches to BHRB 2024-05-24 09:33:06 +10:00
ppc-qmp-cmds.c qapi: make most CPU commands unconditionally available 2025-05-28 18:55:50 +02:00
spr_common.h ppc: Enable 2nd DAWR support on Power10 PowerNV machine 2025-03-11 22:43:32 +10:00
tcg-excp_helper.c target/ppc: Add IBM PPE42 exception model 2025-09-28 23:26:52 +05:30
tcg-stub.c hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prep 2024-02-23 23:24:42 +10:00
timebase_helper.c include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00
trace-events target/ppc: Improve KVM hypercall trace 2022-04-20 18:00:30 -03:00
trace.h
translate.c accel/tcg: Name gen_goto_tb()'s TB slot index as @tb_slot_idx 2025-10-16 10:33:33 +02:00
user_only_helper.c include: Remove 'exec/exec-all.h' 2025-04-30 12:45:05 -07:00