qemu/hw
Greg Kurz b1e8156743 spapr: Set compat mode in spapr_core_plug()
A recent change in spapr_machine_reset() showed that resetting the compat
mode in spapr_machine_reset() for the boot vCPU and in spapr_cpu_reset()
for all other vCPUs was fragile. The fix was thus to reset the compat mode
for all vCPUs in spapr_machine_reset(), but we still have to propagate
it to hot-plugged CPUs. This is still performed from spapr_cpu_reset(),
hence resulting in ppc_set_compat() being called twice for every vCPU at
machine reset. Apart from wasting cycles, which isn't really an issue
during machine reset, this seems to indicate that spapr_cpu_reset() isn't
the best place to set the compat mode.

A natural candidate for CPU-hotplug specific code is spapr_core_plug().
Also, it sits in the same file as spapr_machine_reset() : this makes
it easier for someone who wants to know when the compat PVR is set.

Call ppc_set_compat() from there. This doesn't need to be done for
initial vCPUs since the compat PVR is 0 and spapr_machine_reset() sets
the appropriate value later. No need to do this on manually added vCPUS
on the destination QEMU during migration since the compat PVR is
part of the migrated vCPU state. Both conditions can be checked with
spapr_drc_hotplugged().

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <156701285312.499757.7807417667750711711.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-08-29 09:46:07 +10:00
..
9pfs 9p: simplify source file selection 2019-08-20 17:26:19 +02:00
acpi hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
adc Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
alpha Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
arm Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
audio audio: remove audio_MIN, audio_MAX 2019-08-21 09:13:37 +02:00
block Block layer patches: 2019-08-16 16:43:46 +01:00
bt Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
char spapr: Implement better workaround in spapr-vty device 2019-08-21 17:17:39 +10:00
core Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
cpu hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
cris Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
display vga: a collection of ati fixes/improvements. 2019-08-22 16:13:17 +01:00
dma hw/dma/omap_dma: Move switch 'fall through' comment to correct place 2019-08-21 10:55:23 +02:00
gpio Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
hppa Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
hyperv Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
i2c Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
i386 xen: cleanup IOREQ server on exit 2019-08-27 14:18:28 +01:00
ide hw/ide/atapi: Use the ldst API 2019-08-16 19:14:04 -04:00
input sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
intc Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
ipack Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
ipmi hw/ipmi: Rewrite a fall through comment 2019-08-21 10:56:19 +02:00
isa hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
lm32 Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
m68k Include qemu/main-loop.h less 2019-08-16 13:31:52 +02:00
mem numa: Move remaining NUMA declarations from sysemu.h to numa.h 2019-08-16 13:31:53 +02:00
microblaze hw/misc: Add a config switch for the "unimplemented" device 2019-08-20 09:11:17 +02:00
mips target/mips: Style improvements in mips_mipssim.c 2019-08-19 19:53:37 +02:00
misc hw/core: Move cpu.c, cpu.h from qom/ to hw/core/ 2019-08-21 13:24:01 +02:00
moxie Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
net hw/net/e1000: Fix erroneous comment 2019-08-21 10:42:10 +02:00
nios2 Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
nvram sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
openrisc Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
pci Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
pci-bridge Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
pci-host hw/core: Add a config switch for the "or-irq" device 2019-08-20 09:11:17 +02:00
pcmcia Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
ppc spapr: Set compat mode in spapr_core_plug() 2019-08-29 09:46:07 +10:00
rdma sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
riscv Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
s390x hw: add compat machines for 4.2 2019-08-21 11:32:11 +10:00
scsi vhost-user-scsi: prevent using uninitialized vqs 2019-08-22 16:52:23 +01:00
sd Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
semihosting Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
sh4 sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
smbios Clean up inclusion of exec/cpu-common.h 2019-08-16 13:31:52 +02:00
sparc sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
sparc64 hw/misc: Add a config switch for the "unimplemented" device 2019-08-20 09:11:17 +02:00
ssi Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
timer Monitor patches for 2019-08-21 2019-08-22 10:31:21 +01:00
tpm Include hw/qdev-properties.h less 2019-08-16 13:31:53 +02:00
tricore Clean up inclusion of sysemu/sysemu.h 2019-08-16 13:31:53 +02:00
unicore32 Include hw/irq.h a lot less 2019-08-16 13:31:52 +02:00
usb usb: bugfixes and minor improvements. 2019-08-22 15:10:51 +01:00
vfio sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
virtio sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
watchdog sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
xen xen-bus: Avoid rewriting identical values to xenstore 2019-08-27 14:18:28 +01:00
xenpv Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
xtensa sysemu: Split sysemu/runstate.h off sysemu/sysemu.h 2019-08-16 13:37:36 +02:00
Kconfig hw/core: Add a config switch for the "register" device 2019-08-20 09:11:05 +02:00
Makefile.objs Makefile: do not repeat $(CONFIG_SOFTMMU) in hw/Makefile.objs 2019-07-15 20:58:37 +02:00