summaryrefslogtreecommitdiff
path: root/hw/i386
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2013-12-16 13:54:19 +0200
committerMichael S. Tsirkin <mst@redhat.com>2013-12-23 13:12:34 +0200
commitecdbfceb0f20a3ef784bf522ed7264660aa3d150 (patch)
tree5478cb14de59c0fbc502af41c6f039d39970341a /hw/i386
parentbb43d3839c29b17a2f5c122114cd4ca978065a18 (diff)
downloadqemu-ecdbfceb0f20a3ef784bf522ed7264660aa3d150.tar.gz
pc_piix: document gigabyte_align
Document the logic behind the below/above 4G split. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r--hw/i386/pc_piix.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index acb9445362..832e20c226 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -61,6 +61,10 @@ static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
static bool has_pci_info;
static bool has_acpi_build = true;
static bool smbios_type1_defaults = true;
+/* Make sure that guest addresses aligned at 1Gbyte boundaries get mapped to
+ * host addresses aligned at 1Gbyte boundaries. This way we can use 1GByte
+ * pages in the host.
+ */
static bool gigabyte_align = true;
/* PC hardware initialisation */
@@ -107,6 +111,13 @@ static void pc_init1(QEMUMachineInitArgs *args,
kvmclock_create();
}
+ /* Check whether RAM fits below 4G (leaving 1/2 GByte for IO memory).
+ * If it doesn't, we need to split it in chunks below and above 4G.
+ * In any case, try to make sure that guest addresses aligned at
+ * 1G boundaries get mapped to host addresses aligned at 1G boundaries.
+ * For old machine types, use whatever split we used historically to avoid
+ * breaking migration.
+ */
if (args->ram_size >= 0xe0000000) {
ram_addr_t lowmem = gigabyte_align ? 0xc0000000 : 0xe0000000;
above_4g_mem_size = args->ram_size - lowmem;