hw/arm/virt: Dynamic memory map depending on RAM requirements
commit957e32cffa57e2578abbf7c1ec6e84db48921a18
authorEric Auger <eric.auger@redhat.com>
Mon, 4 Mar 2019 10:13:36 +0000 (4 11:13 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 5 Mar 2019 15:55:09 +0000 (5 15:55 +0000)
tree50c1cfc9d5d07f2c19b21bf4b925f418cec6207d
parentee6850110c627d904a11b8d3851257b4f01da20e
hw/arm/virt: Dynamic memory map depending on RAM requirements

Up to now the memory map has been static and the high IO region
base has always been 256GiB.

This patch modifies the virt_set_memmap() function, which freezes
the memory map, so that the high IO range base becomes floating,
located after the initial RAM and the device memory.

The function computes
- the base of the device memory,
- the size of the device memory,
- the high IO region base
- the highest GPA used in the memory map.

Entries of the high IO region are assigned a base address. The
device memory is initialized.

The highest GPA used in the memory map will be used at VM creation
to choose the requested IPA size.

Setting all the existing highmem IO regions beyond the RAM
allows to have a single contiguous RAM region (initial RAM and
possible hotpluggable device memory). That way we do not need
to do invasive changes in the EDK2 FW to support a dynamic
RAM base.

Still the user cannot request an initial RAM size greater than 255GB.

Signed-off-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-id: 20190304101339.25970-8-eric.auger@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/virt.c
include/hw/arm/virt.h