qemu-patch-raspberry4/hw
Suraj Jitindar Singh 70de096748 target/ppc: Set PSSCR_EC on cpu halt to prevent spurious wakeup
The processor stop status and control register (PSSCR) is used to
control the power saving facilities of the thread. The exit criterion
bit (EC) is used to specify whether the thread should be woken by any
interrupt (EC == 0) or only an interrupt enabled in the LPCR to wake the
thread (EC == 1).

The rtas facilities start-cpu and self-stop are used to transition a
vcpu between the stopped and running states. When a vcpu is stopped it
may only be started again by the start-cpu rtas call.

Currently a vcpu in the stopped state will start again whenever an
interrupt comes along due to PSSCR_EC being cleared, and while this is
architecturally correct for a hardware thread, a vcpu is expected to
only be woken by calling start-cpu. This means when performing a reboot
on a tcg machine that the secondary threads will restart while the
primary is still in slof, this is unsupported and causes call traces
like:

SLOF **********************************************************************
QEMU Starting
 Build Date = Jan 14 2019 18:00:39
 FW Version = git-a5b428e1c1eae703
 Press "s" to enter Open Firmware.

qemu: fatal: Trying to deliver HV exception (MSR) 70 with no HV support

NIP 6d61676963313230   LR 000000003dbe0308 CTR 6d61676963313233 XER 0000000000000000 CPU#1
MSR 0000000000000000 HID0 0000000000000000  HF 0000000000000000 iidx 3 didx 3
TB 00000026 115746031956 DECR 18446744073326238463
GPR00 000000003dbe0308 000000003e669fe0 000000003dc10700 0000000000000003
GPR04 000000003dc62198 000000003dc62178 000000003dc0ea48 0000000000000030
GPR08 000000003dc621a8 0000000000000018 000000003e466008 000000003dc50700
GPR12 c00000000093a4e0 c00000003ffff300 c00000003e533f90 0000000000000000
GPR16 0000000000000000 0000000000000000 000000003e466010 000000003dc0b040
GPR20 0000000000008000 000000000000f003 0000000000000006 000000003e66a050
GPR24 000000003dc06400 000000003dc0ae70 0000000000000003 000000000000f001
GPR28 000000003e66a060 ffffffffffffffff 6d61676963313233 0000000000000028
CR 28000222  [ E  L  -  -  -  E  E  E  ]             RES ffffffffffffffff
FPR00 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR04 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR08 0000000000000000 0000000000000000 0000000000000000 00000000311825e0
FPR12 00000000311825e0 0000000000000000 0000000000000000 0000000000000000
FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000
FPSCR 0000000000000000
 SRR0 000000003dbe06b0  SRR1 0000000000080000    PVR 00000000004e1200 VRSAVE 0000000000000000
SPRG0 000000003dbe0308 SPRG1 000000003e669fe0  SPRG2 00000000000000d8  SPRG3 000000003dbe0308
SPRG4 0000000000000000 SPRG5 0000000000000000  SPRG6 0000000000000000  SPRG7 0000000000000000
HSRR0 6d61676963313230 HSRR1 0000000000000000
 CFAR 000000003dbe3e64
 LPCR 0000000004020008
 PTCR 0000000000000000   DAR 0000000000000000  DSISR 0000000000000000
Aborted (core dumped)

To fix this, set the PSSCR_EC bit when a vcpu is stopped to disable it
from coming back online until the start-cpu rtas call is made.

Fixes: 21c0d66a9c ("target/ppc: Fix support for "STOP light" states on POWER9")

Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Message-Id: <20190516005744.24366-1-sjitindarsingh@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-05-29 11:39:45 +10:00
..
9pfs trace-events: Fix attribution of trace points to source 2019-03-22 16:18:07 +00:00
acpi acpi/pcihp: Add a few more trace points related to unplug 2019-05-20 18:40:02 -04:00
adc kconfig: introduce kconfig files 2019-03-07 21:45:53 +01:00
alpha * Kconfig improvements (msi_nonbroken, imply for default PCI devices) 2019-03-28 09:18:53 +00:00
arm hw/arm/mps2: Use object_initialize_child for correct reference counting 2019-05-24 15:29:02 -03:00
audio Revert "audio: fix pc speaker init" 2019-04-01 08:53:40 +02:00
block vhost-user-blk: Add support to reconnect backend 2019-05-20 18:40:02 -04:00
bt kconfig: introduce kconfig files 2019-03-07 21:45:53 +01:00
char Mostly bugfixes and cleanups, the most important being 2019-05-17 16:17:34 +01:00
core hw: report invalid disable-legacy|modern usage for virtio-1-only devs 2019-05-20 18:40:02 -04:00
cpu kconfig: introduce kconfig files 2019-03-07 21:45:53 +01:00
cris cris-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
display hw/display/ramfb: initialize fw-config space with xres/ yres 2019-05-24 09:10:29 +02:00
dma hw/dma: Compile the bcm2835_dma device as common object 2019-04-29 17:36:03 +01:00
gpio Pull request 2019-03-25 17:01:10 +00:00
hppa * Kconfig improvements (msi_nonbroken, imply for default PCI devices) 2019-03-28 09:18:53 +00:00
hyperv hyperv: express dependencies with kconfig 2019-03-07 21:45:53 +01:00
i2c hw/arm: Express dependencies of realview, versatile and vexpress with Kconfig 2019-05-13 09:36:31 +02:00
i386 hw/i386: Implement fw_cfg_arch_key_name() 2019-05-23 14:10:31 +02:00
ide Kconfig settings for the Arm machines 2019-05-13 16:52:56 +01:00
input hw/input: Add a CONFIG_PS2 switch for the ps2.c file 2019-05-15 11:56:53 +02:00
intc Fix typo on "info pic" monitor cmd output for xive 2019-05-29 11:39:45 +10:00
ipack build: convert pci.mak to Kconfig 2019-03-07 21:45:53 +01:00
ipmi ipmi: express dependencies with kconfig 2019-03-07 21:45:53 +01:00
isa hw/ppc/40p: Move the MC146818 RTC to the board where it belongs 2019-05-29 11:39:44 +10:00
lm32 pflash: Clean up after commit 368a354f02, part 2 2019-03-11 22:53:44 +01:00
m68k m68k-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
mem trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
microblaze hw/microblaze/zynqmp: Use object_initialize_child for correct ref. counting 2019-05-24 15:29:02 -03:00
mips Various testing updates 2019-05-28 17:38:32 +01:00
misc hw/misc/macio: Use object_initialize_child for correct ref. counting 2019-05-24 15:29:02 -03:00
moxie moxie-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
net Mostly bugfixes and cleanups, the most important being 2019-05-17 16:17:34 +01:00
nios2 Add generic Nios II board. 2019-04-29 16:09:51 +01:00
nvram hw/nvram/fw_cfg: Store 'reboot-timeout' as little endian 2019-05-23 14:10:31 +02:00
openrisc target/openrisc: Fix LGPL information in the file headers 2019-05-08 17:45:54 +02:00
pci pci: msix: move 'MSIX_CAP_LENGTH' to header file 2019-05-22 17:35:27 +02:00
pci-bridge pci: Simplify pci_bus_is_root() 2019-05-20 18:40:02 -04:00
pci-host hw/pci-host: Use object_initialize_child for correct reference counting 2019-05-02 16:56:33 +02:00
pcmcia kconfig: introduce kconfig files 2019-03-07 21:45:53 +01:00
ppc target/ppc: Set PSSCR_EC on cpu halt to prevent spurious wakeup 2019-05-29 11:39:45 +10:00
rdma Clean up header guards that don't match their file name 2019-05-13 08:58:55 +02:00
riscv riscv: spike: Add a generic spike machine 2019-05-24 12:09:24 -07:00
s390x s390/css: handle CCW_FLAG_SKIP 2019-05-17 08:16:02 +02:00
scsi megasas: fix mapped frame size 2019-05-15 11:56:53 +02:00
sd Clean up header guards that don't match their file name 2019-05-13 08:58:55 +02:00
semihosting semihosting: enable chardev backed output for console 2019-05-28 10:28:50 +01:00
sh4 hw/usb/hcd-ohci: Move PCI-related code into a separate file 2019-05-02 08:42:17 +02:00
smbios kconfig: introduce kconfig files 2019-03-07 21:45:53 +01:00
sparc hw/sparc: Implement fw_cfg_arch_key_name() 2019-05-23 14:10:31 +02:00
sparc64 hw/sparc64: Implement fw_cfg_arch_key_name() 2019-05-23 14:10:31 +02:00
ssi hw/ssi/xilinx_spips: Avoid variable length array 2019-04-29 17:35:57 +01:00
timer grlib, gptimer: get rid of the old-style create function 2019-05-17 09:17:11 +01:00
tpm Clean up ill-advised or unusual header guards 2019-05-13 08:58:55 +02:00
tricore - qtest fixes 2019-03-08 16:31:34 +00:00
unicore32 unicore32-softmmu.mak: express dependencies with Kconfig 2019-03-07 21:46:19 +01:00
usb hw/usb: avoid format truncation warning when formatting port name 2019-05-03 08:56:58 +02:00
vfio hw/display/ramfb: initialize fw-config space with xres/ yres 2019-05-24 09:10:29 +02:00
virtio hw/virtio: Use object_initialize_child for correct reference counting 2019-05-24 15:29:02 -03:00
watchdog trace-events: Fix attribution of trace points to source 2019-03-22 16:18:07 +00:00
xen trace-events: Shorten file names in comments 2019-03-22 16:18:07 +00:00
xenpv xen: Replace few mentions of xend by libxl 2019-01-14 13:45:40 +00:00
xtensa Clean up ill-advised or unusual header guards 2019-05-13 08:58:55 +02:00
Kconfig semihosting: introduce CONFIG_SEMIHOSTING 2019-05-28 10:28:50 +01:00
Makefile.objs semihosting: move semihosting configuration into its own directory 2019-05-28 10:28:50 +01:00