]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
pc: Avoid registering zero sized memory
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 6 Jul 2010 16:37:17 +0000 (10:37 -0600)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 13 Jul 2010 14:06:58 +0000 (09:06 -0500)
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>
hw/pc.c

diff --git a/hw/pc.c b/hw/pc.c
index a96187f5b560dc7c47a7d5a284afe484e9bd8e99..58dea57f8e6cc58f34dcc6700ca3cd203526e2c0 100644 (file)
--- 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 */