ppc/pnv: Fix direct controls quiesce
authorNicholas Piggin <npiggin@gmail.com>
Mon, 11 Nov 2024 05:23:29 +0000 (15:23 +1000)
committerNicholas Piggin <npiggin@gmail.com>
Tue, 26 Nov 2024 16:47:25 +0000 (02:47 +1000)
commit96746f7a95a6e32d6578d417ae41dc24c564fafa
tree5b519638e193c2b7f326822bddfec67ced21eeee
parentfa416ae6157a933ad3f7106090684759baaaf3c9
ppc/pnv: Fix direct controls quiesce

powernv CPUs have a set of control registers that can stop, start, and
do other things to control a thread's execution.

Using this interface to stop a thread puts it into a particular state
that can be queried, and is distinguishable from other things that might
stop the CPU (e.g., going idle, or being debugged via gdb, or stopped by
the monitor).

Add a new flag that can speficially distinguish this state where it is
stopped with control registers. This solves some hangs when rebooting
powernv machines when skiboot is modified to allow QEMU to use the CPU
control facility (that uses controls to bring all secondaries to a known
state).

Fixes: c8891955086 ("ppc/pnv: Implement POWER10 PC xscom registers for direct controls")
Reviewed-by: Glenn Miles <milesg@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
hw/ppc/pnv_core.c
target/ppc/cpu.h