summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAvi Kivity2010-02-24 22:11:19 +0100
committerMarcelo Tosatti2010-03-04 04:28:41 +0100
commit60e4c6317b8773d987729401aeca9d8c6b61b05f (patch)
tree910fd8cd4c4837775ce1c8be46d24b1c5f6775ad
parent(curses) Use more descriptive values (diff)
downloadqemu-60e4c6317b8773d987729401aeca9d8c6b61b05f.tar.gz
qemu-60e4c6317b8773d987729401aeca9d8c6b61b05f.tar.xz
qemu-60e4c6317b8773d987729401aeca9d8c6b61b05f.zip
Allocate memory below 4GB as one chunk
Instead of allocating a separate chunk for the first 640KB and another for 1MB+, allocate one large chunk. This plays well in terms of alignment and size with large pages. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
-rw-r--r--hw/pc.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 4f6a5228fd..bdc297f717 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -833,18 +833,11 @@ static void pc_init1(ram_addr_t ram_size,
vmport_init();
/* allocate RAM */
- ram_addr = qemu_ram_alloc(0xa0000);
+ ram_addr = qemu_ram_alloc(below_4g_mem_size);
cpu_register_physical_memory(0, 0xa0000, ram_addr);
-
- /* Allocate, even though we won't register, so we don't break the
- * phys_ram_base + PA assumption. This range includes vga (0xa0000 - 0xc0000),
- * and some bios areas, which will be registered later
- */
- ram_addr = qemu_ram_alloc(0x100000 - 0xa0000);
- ram_addr = qemu_ram_alloc(below_4g_mem_size - 0x100000);
cpu_register_physical_memory(0x100000,
below_4g_mem_size - 0x100000,
- ram_addr);
+ ram_addr + 0x100000);
/* above 4giga memory allocation */
if (above_4g_mem_size > 0) {