qemu-e2k/hw
Greg Kurz 73598c75df spapr: Improve handling of memory unplug with old guests
Since commit 1e8b5b1aa1 ("spapr: Allow memory unplug to always succeed")
trying to unplug memory from a guest that doesn't support it (eg. rhel6)
no longer generates an error like it used to. Instead, it leaves the
memory around : only a subsequent reboot or manual use of drmgr within
the guest can complete the hot-unplug sequence. A flag was added to
SpaprMachineClass so that this new behavior only applies to the default
machine type.

We can do better. CAS processes all pending hot-unplug requests. This
means that we don't really care about what the guest supports if
the hot-unplug request happens before CAS.

All guests that we care for, even old ones, set enough bits in OV5
that lead to a non-empty bitmap in spapr->ov5_cas. Use that as a
heuristic to decide if CAS has already occured or not.

Always accept unplug requests that happen before CAS since CAS will
process them. Restore the previous behavior of rejecting them after
CAS when we know that the guest doesn't support memory hot-unplug.

This behavior is suitable for all machine types : this allows to
drop the pre_6_0_memory_unplug flag.

Fixes: 1e8b5b1aa1 ("spapr: Allow memory unplug to always succeed")
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <161012708715.801107.11418801796987916516.stgit@bahia.lan>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-01-19 10:20:29 +11:00
..
9pfs 9pfs: Fully restart unreclaim loop (CVE-2021-20181) 2021-01-15 08:44:28 +01:00
acpi acpi: Add addr offset in build_crs 2021-01-17 06:42:54 -05:00
adc hw/adc: Add an ADC module for NPCM7XX 2021-01-12 21:19:02 +00:00
alpha vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
arm hw/*: Use type casting for SysBusDevice in NPCM7XX 2021-01-12 21:19:02 +00:00
audio audio/via-ac97: Simplify code and set user_creatable to false 2021-01-04 23:24:44 +01:00
avr vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
block hw/block: m25p80: Implement AAI-WP command support for SST flashes 2021-01-16 10:57:21 -08:00
char Remove superfluous timer_del() calls 2021-01-08 15:13:38 +00:00
core clock: Define and use new clock_display_freq() 2021-01-04 23:24:44 +01:00
cpu cpu/core: Register core-id and nr-threads as class properties 2020-09-22 16:48:29 -04:00
cris cris: do not use ram_size global 2020-12-10 12:15:07 -05:00
display migration: Replace migration's JSON writer by the general one 2020-12-19 10:39:16 +01:00
dma hw/dma/xilinx_axidma: Rename StreamSlave as StreamSink 2020-12-10 12:15:04 -05:00
gpio nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
hppa hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h' 2021-01-04 23:24:44 +01:00
hyperv qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
i2c nomaintainer: Fix Lesser GPL version number 2020-11-15 17:04:40 +01:00
i386 acpi: Add addr offset in build_crs 2021-01-17 06:42:54 -05:00
ide hw/ide/ahci: Replace fprintf() by qemu_log_mask(GUEST_ERROR) 2021-01-18 11:51:26 +01:00
input Remove superfluous timer_del() calls 2021-01-08 15:13:38 +00:00
intc hw/intc/ppc-uic: Make default dcr-base 0xc0, not 0x30 2021-01-19 10:20:29 +11:00
ipack Use OBJECT_DECLARE_SIMPLE_TYPE when possible 2020-09-18 14:12:32 -04:00
ipmi Remove superfluous timer_del() calls 2021-01-08 15:13:38 +00:00
isa vt82c686: Rename superio config related parts 2021-01-04 23:24:44 +01:00
lm32 vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
m68k hw/m68k/q800.c: Make the GLUE chip an actual QOM device 2020-12-12 18:06:01 +01:00
mem hw/*: Use type casting for SysBusDevice in NPCM7XX 2021-01-12 21:19:02 +00:00
microblaze vl: make qemu_get_machine_opts static 2020-12-15 12:51:55 -05:00
mips docs/system: Remove deprecated 'fulong2e' machine alias 2021-01-14 17:13:54 +01:00
misc Trivial patches 20210118 2021-01-18 15:19:06 +00:00
moxie moxie: do not use ram_size global 2020-12-10 12:15:08 -05:00
net hw/net/lan9118: Add symbolic constants for register offsets 2021-01-12 21:19:02 +00:00
nios2 * New -action option and set-action QMP command (Alejandro) 2020-12-15 21:24:31 +00:00
nubus meson: convert hw/nubus 2020-08-21 06:30:25 -04:00
nvram hw/*: Use type casting for SysBusDevice in NPCM7XX 2021-01-12 21:19:02 +00:00
openrisc target/openrisc: Move pic_cpu code into CPU object proper 2020-12-15 12:04:30 +00:00
pci pci/shpc: don't push attention button when ejecting powered-off device 2021-01-13 09:06:37 -05:00
pci-bridge Kconfig: Compile PXB for ARM_VIRT 2021-01-17 06:42:54 -05:00
pci-host acpi/gpex: Exclude pxb's resources from PCI0 2021-01-17 06:42:54 -05:00
pcmcia pxa2xx: Move QOM macros to header 2020-08-27 14:04:55 -04:00
ppc spapr: Improve handling of memory unplug with old guests 2021-01-19 10:20:29 +11:00
rdma Machine queue, 2020-12-23 2021-01-01 22:57:15 +00:00
riscv riscv: Pass RISCVHartArrayState by pointer 2021-01-16 14:34:46 -08:00
rtc pl031: Use timer_free() in the finalize function to avoid memleaks 2021-01-18 11:51:26 +01:00
rx rx: move BIOS load from MCU to board 2020-12-10 12:15:06 -05:00
s390x Remove superfluous timer_del() calls 2021-01-08 15:13:38 +00:00
scsi virtio-scsi: trace events 2021-01-12 12:38:03 +01:00
sd Remove superfluous timer_del() calls 2021-01-08 15:13:38 +00:00
semihosting semihosting: Implement SYS_ISERROR 2021-01-18 10:05:06 +00:00
sh4 hw: Use the PCI_SLOT() macro from 'hw/pci/pci.h' 2021-01-04 23:24:44 +01:00
smbios i386: do not use ram_size global 2020-12-10 12:15:08 -05:00
sparc sun4m: don't connect two qemu_irqs directly to the same input 2021-01-06 11:41:37 +00:00
sparc64 vl: extract softmmu/datadir.c 2020-12-10 12:15:18 -05:00
ssi hw/*: Use type casting for SysBusDevice in NPCM7XX 2021-01-12 21:19:02 +00:00
timer hw/timer: Refactor NPCM7XX Timer to use CLK clock 2021-01-12 21:19:02 +00:00
tpm qdev: Move qdev_prop_tpm declaration to tpm_prop.h 2020-12-18 15:20:17 -05:00
tricore tricore tcg cpus: Fix Lesser GPL version number 2020-11-15 16:40:30 +01:00
unicore32 meson: convert hw/arch* 2020-08-21 06:30:33 -04:00
usb Remove superfluous timer_del() calls 2021-01-08 15:13:38 +00:00
vfio Remove superfluous timer_del() calls 2021-01-08 15:13:38 +00:00
virtio hw/virtio-pci: Replace error_report() by qemu_log_mask(GUEST_ERROR) 2021-01-18 11:51:26 +01:00
watchdog Remove superfluous timer_del() calls 2021-01-08 15:13:38 +00:00
xen qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
xenpv meson: convert hw/arch* 2020-08-21 06:30:33 -04:00
xtensa vl: make qemu_get_machine_opts static 2020-12-15 12:51:55 -05:00
Kconfig hw/net/can: Introduce Xilinx ZynqMP CAN controller 2020-12-10 11:30:44 +00:00
meson.build meson: convert hw/arch* 2020-08-21 06:30:33 -04:00