summaryrefslogtreecommitdiffstats
path: root/hw/pc.c
diff options
context:
space:
mode:
authorAlex Williamson2010-07-06 18:37:17 +0200
committerAnthony Liguori2010-07-13 16:06:58 +0200
commitbbe80adf29dbfe6118f8e0a27eea6e77b705df11 (patch)
treee1efe6d7a057493cf30b76f34f1f48e339c69951 /hw/pc.c
parentMerge remote branch 'mst/for_anthony' into staging (diff)
downloadqemu-bbe80adf29dbfe6118f8e0a27eea6e77b705df11.tar.gz
qemu-bbe80adf29dbfe6118f8e0a27eea6e77b705df11.tar.xz
qemu-bbe80adf29dbfe6118f8e0a27eea6e77b705df11.zip
pc: Avoid registering zero sized memory
No need to call cpu_register_physical_memory() for a zero sized area. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pc.c')
-rw-r--r--hw/pc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/pc.c b/hw/pc.c
index a96187f5b5..58dea57f8e 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -916,8 +916,10 @@ void pc_memory_init(ram_addr_t ram_size,
below_4g_mem_size - 0x100000,
ram_addr + 0x100000);
#if TARGET_PHYS_ADDR_BITS > 32
- cpu_register_physical_memory(0x100000000ULL, above_4g_mem_size,
- ram_addr + below_4g_mem_size);
+ if (above_4g_mem_size > 0) {
+ cpu_register_physical_memory(0x100000000ULL, above_4g_mem_size,
+ ram_addr + below_4g_mem_size);
+ }
#endif
/* BIOS load */