qemu-e2k/include/hw/ppc
Bharata B Rao d0e5a8f293 spapr: Ensure all LMBs are represented in ibm,dynamic-memory
Memory hotplug can fail for some combinations of RAM and maxmem when
DDW is enabled in the presence of devices like nec-usb-xhci. DDW depends
on maximum addressable memory returned by guest and this value is currently
being calculated wrongly by the guest kernel routine memory_hotplug_max().
While there is an attempt to fix the guest kernel, this patch works
around the problem within QEMU itself.

memory_hotplug_max() routine in the guest kernel arrives at max
addressable memory by multiplying lmb-size with the lmb-count obtained
from ibm,dynamic-memory property. There are two assumptions here:

- All LMBs are part of ibm,dynamic memory: This is not true for PowerKVM
  where only hot-pluggable LMBs are present in this property.
- The memory area comprising of RAM and hotplug region is contiguous: This
  needn't be true always for PowerKVM as there can be gap between
  boot time RAM and hotplug region.

To work around this guest kernel bug, ensure that ibm,dynamic-memory
has information about all the LMBs (RMA, boot-time LMBs, future
hotpluggable LMBs, and dummy LMBs to cover the gap between RAM and
hotpluggable region).

RMA is represented separately by memory@0 node. Hence mark RMA LMBs
and also the LMBs for the gap b/n RAM and hotpluggable region as
reserved and as having no valid DRC so that these LMBs are not considered
by the guest.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-06-14 13:20:01 +10:00
..
mac_dbdma.h macio: call dma_memory_unmap() at the end of each DMA transfer 2016-06-14 10:43:24 +10:00
openpic.h hw: cannot include hw/hw.h from user emulation 2016-05-19 16:42:28 +02:00
ppc4xx.h
ppc_e500.h intc/openpic: Build openpic only once 2013-07-09 21:33:02 +02:00
ppc.h ppc: use PowerPCCPU instead of CPUPPCState 2016-05-19 16:42:27 +02:00
spapr_drc.h spapr_drc: enable immediate detach for unsignalled devices 2016-04-05 10:47:03 +10:00
spapr_vio.h hw: do not use VMSTATE_*TL 2016-05-19 16:42:28 +02:00
spapr.h spapr: Ensure all LMBs are represented in ibm,dynamic-memory 2016-06-14 13:20:01 +10:00
xics.h xics: report errors with the QEMU Error API 2016-02-28 16:19:02 +11:00