From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43934) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7SA8-0004ZP-0f for qemu-devel@nongnu.org; Sun, 26 Jan 2014 11:02:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7SA1-000102-RF for qemu-devel@nongnu.org; Sun, 26 Jan 2014 11:02:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:61565) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7SA1-0000yq-Iw for qemu-devel@nongnu.org; Sun, 26 Jan 2014 11:02:13 -0500 Date: Sun, 26 Jan 2014 18:07:06 +0200 From: "Michael S. Tsirkin" Message-ID: <1390735289-15563-34-git-send-email-mst@redhat.com> References: <1390735289-15563-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1390735289-15563-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL v2 33/35] q35: gigabyte alignment for ram List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Anthony Liguori From: Gerd Hoffmann Map 2G (q35) of memory below 4G, so the RAM pieces are nicely aligned to gigabyte borders. Keep old memory layout for (a) old machine types and (b) in case all memory fits below 4G and thus we don't have to split RAM into pieces in the first place. The later makes sure this change doesn't take away memory from 32bit guests. Signed-off-by: Gerd Hoffmann Signed-off-by: Michael S. Tsirkin --- hw/i386/pc_q35.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 07f38ff..7104645 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -51,6 +51,7 @@ static bool has_pci_info; static bool has_acpi_build = true; static bool smbios_type1_defaults = true; +static bool gigabyte_align = true; /* PC hardware initialisation */ static void pc_q35_init(QEMUMachineInitArgs *args) @@ -93,8 +94,9 @@ static void pc_q35_init(QEMUMachineInitArgs *args) kvmclock_create(); if (args->ram_size >= 0xb0000000) { - above_4g_mem_size = args->ram_size - 0xb0000000; - below_4g_mem_size = 0xb0000000; + ram_addr_t lowmem = gigabyte_align ? 0x80000000 : 0xb0000000; + above_4g_mem_size = args->ram_size - lowmem; + below_4g_mem_size = lowmem; } else { above_4g_mem_size = 0; below_4g_mem_size = args->ram_size; @@ -228,6 +230,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args) static void pc_compat_1_7(QEMUMachineInitArgs *args) { smbios_type1_defaults = false; + gigabyte_align = false; } static void pc_compat_1_6(QEMUMachineInitArgs *args) -- MST