]> git.proxmox.com Git - mirror_qemu.git/commit - hw/ppc/spapr.c
spapr: Locate RTAS and device-tree based on real RMA
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 21 Jul 2014 03:02:04 +0000 (13:02 +1000)
committerAlexander Graf <agraf@suse.de>
Mon, 8 Sep 2014 10:50:48 +0000 (12:50 +0200)
commitb7d1f77adaab790d20232df261d4e2ff6a77f556
tree8d8dc8e0f5d377f7bc0919665c76e8f47e2ed375
parentea87616d6c44d998affef3d3b9fdfc49d14b8150
spapr: Locate RTAS and device-tree based on real RMA

We currently calculate the final RTAS and FDT location based on
the early estimate of the RMA size, cropped to 256M on KVM since
we only know the real RMA size at reset time which happens much
later in the boot process.

This means the FDT and RTAS end up right below 256M while they
could be much higher, using precious RMA space and limiting
what the OS bootloader can put there which has proved to be
a problem with some OSes (such as when using very large initrd's)

Fortunately, we do the actual copy of the device-tree into guest
memory much later, during reset, late enough to be able to do it
using the final RMA value, we just need to move the calculation
to the right place.

However, RTAS is still loaded too early, so we change the code to
load the tiny blob into qemu memory early on, and then copy it into
guest memory at reset time. It's small enough that the memory usage
doesn't matter.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
[aik: fixed errors from checkpatch.pl, defined RTAS_MAX_ADDR]
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
[agraf: fix compilation on 32bit hosts]
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/ppc/spapr.c
include/hw/ppc/spapr.h