]> git.proxmox.com Git - mirror_qemu.git/commitdiff
q35: document gigabyte_align
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 16 Dec 2013 11:55:06 +0000 (13:55 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 26 Jan 2014 11:11:45 +0000 (13:11 +0200)
Document the logic behind the below/above 4G split.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/pc_q35.c

index 710464598ebf1370b67c6b3748b60fbf9a13d785..a7f626096a689b4889da2ab83231a02bd36e9ec4 100644 (file)
 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 */
@@ -93,6 +97,15 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
 
     kvmclock_create();
 
+    /* Check whether RAM fits below 4G (leaving 1/2 GByte for IO memory
+     * and 256 Mbytes for PCI Express Enhanced Configuration Access Mapping
+     * also known as MMCFG).
+     * 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 >= 0xb0000000) {
         ram_addr_t lowmem = gigabyte_align ? 0x80000000 : 0xb0000000;
         above_4g_mem_size = args->ram_size - lowmem;