From c6157749d725052d112cac710eccdef6d2ca6494 Mon Sep 17 00:00:00 2001 From: Marcelo Tosatti Date: Sun, 17 May 2009 10:43:08 -0500 Subject: [PATCH] Fixup 4GB+ memslot large page alignment Need to align the 4GB+ memslot after we know its address, not before. Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori --- hw/pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pc.c b/hw/pc.c index 57445febb0..1b8d47a32b 100644 --- a/hw/pc.c +++ b/hw/pc.c @@ -871,6 +871,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, /* above 4giga memory allocation */ if (above_4g_mem_size > 0) { + ram_addr = qemu_ram_alloc(above_4g_mem_size); if (hpagesize) { if (ram_addr & (hpagesize-1)) { unsigned long aligned_addr; @@ -879,7 +880,6 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, ram_addr = aligned_addr; } } - ram_addr = qemu_ram_alloc(above_4g_mem_size); cpu_register_physical_memory(0x100000000ULL, above_4g_mem_size, ram_addr); -- 2.11.4.GIT