qemu/hw
David Gibson db50f280cf spapr: Correct RAM size calculation for HPT resizing
In order to prevent the guest from forcing the allocation of large amounts
of qemu memory (or host kernel memory, in the case of KVM HV), we limit
the size of Hashed Page Table (HPT) it is allowed to allocated, based on
its RAM size.

However, the current calculation is not correct: it only adds up the size
of plugged memory, ignoring the base memory size.  This patch corrects it.

While we're there, use get_plugged_memory_size() instead of directly
calling pc_existing_dimms_capacity().  The only difference is that it
will abort on failure, which is right: a failure here indicates something
wrong within qemu.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
2017-10-17 10:34:01 +11:00
..
9pfs 9pfs: check the size of transport buffer before marshaling 2017-09-20 08:48:52 +02:00
acpi pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
adc STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00
alpha cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
arm hw/arm/xlnx-zynqmp: Mark the "xlnx, zynqmp" device with user_creatable = false 2017-10-06 16:46:47 +01:00
audio pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
block pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices 2017-10-15 05:54:42 +03:00
bt bt: stop the sdp memory allocation craziness 2017-08-01 17:27:33 +02:00
char pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
core fw_cfg: add write callback 2017-10-15 05:54:40 +03:00
cpu cpu: don't allow negative core id 2017-08-02 18:30:13 -03:00
cris cris: replace cpu_cris_init() with cpu_generic_init() 2017-09-01 11:54:24 -03:00
display pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
dma xilinx_axidma: Convert to DEFINE_PROP_LINK 2017-09-07 13:54:51 +01:00
gpio hw/gpio/omap_gpio.c: Don't use old_mmio 2017-09-21 16:34:27 +01:00
i2c pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
i386 pc: remove useless hot_add_cpu initialisation 2017-10-15 05:54:44 +03:00
ide macio: add missing registers to VMStateDescription 2017-10-17 10:34:00 +11:00
input virtio-input: send rel-wheel events for wheel buttons 2017-09-29 10:36:33 +02:00
intc nvic: Fix miscalculation of offsets into ITNS array 2017-10-12 16:33:16 +01:00
ipack pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
ipmi qom: enforce readonly nature of link's check callback 2017-07-14 12:04:42 +02:00
isa pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
lm32 cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
m68k cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
mem qmp: introduce query-memory-size-summary command 2017-09-14 15:52:10 +01:00
microblaze hw: Use new memory_region_init_{ram, rom, rom_device}() functions 2017-07-14 17:59:42 +01:00
mips pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
misc pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
moxie cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
net pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
nios2 nios2: replace cpu_nios2_init() with cpu_generic_init() 2017-09-01 11:54:24 -03:00
nvram fw_cfg: add write callback 2017-10-15 05:54:40 +03:00
openrisc cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
pci pci: Validate interfaces on base_class_init 2017-10-15 05:54:43 +03:00
pci-bridge hw/gen_pcie_root_port: make IO RO 0 on IO disabled 2017-10-15 05:54:43 +03:00
pci-host pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
pcmcia hw: Clean up includes 2016-01-29 15:07:25 +00:00
ppc spapr: Correct RAM size calculation for HPT resizing 2017-10-17 10:34:01 +11:00
s390x hw/s390x: Mark the "sclpquiesce" device with user_creatable = false 2017-10-06 10:53:02 +02:00
scsi pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
sd pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
sh4 pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
smbios stubs: move smbios stubs to hw/smbios 2017-01-16 17:52:35 +01:00
sparc cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
sparc64 pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
ssi msf2: Add Smartfusion2 SPI controller 2017-09-21 16:36:56 +01:00
timer migration: pre_save return int 2017-09-27 11:35:59 +01:00
tpm tpm: Added support for TPM emulator 2017-10-13 07:34:33 -04:00
tricore cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
unicore32 cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
usb pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
vfio pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
virtio virtio-pci: Replace modern_as with direct access to modern_bar 2017-10-15 05:54:44 +03:00
watchdog pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
xen xen/pt: Mark TYPE_XEN_PT_DEVICE as hybrid 2017-10-15 05:54:43 +03:00
xenpv xenfb: remove xen_init_display "temporary" hack 2017-07-07 11:10:03 -07:00
xtensa cpu: make cpu_generic_init() abort QEMU on error 2017-09-19 09:09:32 -03:00
Makefile.objs 9pfs: fix dependencies 2017-08-30 18:23:25 +02:00