qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] pc: unbreak vhost


From: Michael S. Tsirkin
Subject: [Qemu-devel] [PATCH] pc: unbreak vhost
Date: Fri, 16 Jul 2010 14:00:04 +0300
User-agent: Mutt/1.5.20 (2009-12-10)

Commit 44ae28f3152138e71ccad66c201d730b93374bc2 breaks vhost
on small guests as we get a zero-sized memory slot at >4G,
which that code does not expect.
The removal of if (above_4g_size > 0) seems unintentional
(commit log only mentions allocation memory in a single chunk)
so just put it back in.

Signed-off-by: Michael S. Tsirkin <address@hidden>
---
 hw/pc.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index 89bd4af..77b1592 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -920,8 +920,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 */
-- 
1.7.2.rc0.14.g41c1c



reply via email to

[Prev in Thread] Current Thread [Next in Thread]