qemu-patch-raspberry4/target/ppc
Thomas Huth df58713396 hw/ppc/spapr: Check for valid page size when hot plugging memory
On POWER, the valid page sizes that the guest can use are bound
to the CPU and not to the memory region. QEMU already has some
fancy logic to find out the right maximum memory size to tell
it to the guest during boot (see getrampagesize() in the file
target/ppc/kvm.c for more information).
However, once we're booted and the guest is using huge pages
already, it is currently still possible to hot-plug memory regions
that does not support huge pages - which of course does not work
on POWER, since the guest thinks that it is possible to use huge
pages everywhere. The KVM_RUN ioctl will then abort with -EFAULT,
QEMU spills out a not very helpful error message together with
a register dump and the user is annoyed that the VM unexpectedly
died.
To avoid this situation, we should check the page size of hot-plugged
DIMMs to see whether it is possible to use it in the current VM.
If it does not fit, we can print out a better error message and
refuse to add it, so that the VM does not die unexpectely and the
user has a second chance to plug a DIMM with a matching memory
backend instead.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1419466
Signed-off-by: Thomas Huth <thuth@redhat.com>
[dwg: Fix a build error on 32-bit builds with KVM]
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-22 14:28:53 +11:00
..
translate target-ppc: Add xscvqpudz and xscvqpuwz instructions 2017-02-22 11:28:28 +11:00
arch_dump.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
compat.c ppc: Add ppc_set_compat_all() 2017-01-31 10:10:14 +11:00
cpu-models.c target/ppc/cpu-models: Fix/remove bad CPU aliases 2017-01-31 13:46:26 +11:00
cpu-models.h powerpc/cpu-models: rename ISAv3.00 logical PVR definition 2017-01-31 10:10:14 +11:00
cpu-qom.h target/ppc/POWER9: Add ISAv3.00 MMU definition 2017-02-22 11:28:28 +11:00
cpu.h target/ppc/POWER9: Adapt LPCR handling for POWER9 2017-02-22 11:28:28 +11:00
dfp_helper.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
excp_helper.c ppc: Clean up and QOMify hypercall emulation 2017-01-31 10:10:13 +11:00
fpu_helper.c target-ppc: Add xscvqpudz and xscvqpuwz instructions 2017-02-22 11:28:28 +11:00
gdbstub.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
helper.h target-ppc: Add xscvqpudz and xscvqpuwz instructions 2017-02-22 11:28:28 +11:00
helper_regs.h cputlb: drop flush_global flag from tlb_flush 2017-01-13 14:24:37 +00:00
int_helper.c ppc: Implement bcdutrunc. instruction 2017-01-31 10:10:14 +11:00
internal.h target-ppc: implement load atomic instruction 2017-02-22 11:28:27 +11:00
kvm-stub.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
kvm.c hw/ppc/spapr: Check for valid page size when hot plugging memory 2017-02-22 14:28:53 +11:00
kvm_ppc.h hw/ppc/spapr: Check for valid page size when hot plugging memory 2017-02-22 14:28:53 +11:00
machine.c migration: extend VMStateInfo 2017-01-24 17:54:47 +00:00
Makefile.objs ppc: Rewrite ppc_set_compat() 2017-01-31 10:10:13 +11:00
mem_helper.c target-ppc: implement stxvll instructions 2017-01-31 10:10:13 +11:00
mfrom_table.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
mfrom_table_gen.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
misc_helper.c cputlb: drop flush_global flag from tlb_flush 2017-01-13 14:24:37 +00:00
mmu-hash32.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
mmu-hash32.h Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
mmu-hash64.c target/ppc/POWER9: Direct all instr and data storage interrupts to the hypv 2017-02-22 11:28:28 +11:00
mmu-hash64.h target/ppc/mmu_hash64: Fix incorrect shift value in amr calculation 2017-02-02 09:30:07 +11:00
mmu_helper.c target-ppc: fix Book-E TLB matching 2017-02-22 14:28:53 +11:00
monitor.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
STATUS Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
timebase_helper.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
trace-events Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
translate.c target-ppc: add wait instruction 2017-02-22 11:28:28 +11:00
translate_init.c target/ppc/POWER9: Adapt LPCR handling for POWER9 2017-02-22 11:28:28 +11:00
user_only_helper.c Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00