From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=45809 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZkCH-0004dY-K7 for qemu-devel@nongnu.org; Fri, 16 Jul 2010 08:39:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZkCG-0004Ya-G9 for qemu-devel@nongnu.org; Fri, 16 Jul 2010 08:39:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45471) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZkCG-0004YA-9U for qemu-devel@nongnu.org; Fri, 16 Jul 2010 08:39:20 -0400 From: Alex Williamson In-Reply-To: <20100716110004.GA28018@redhat.com> References: <20100716110004.GA28018@redhat.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 16 Jul 2010 06:39:12 -0600 Message-ID: <1279283952.20397.293.camel@x201> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH] pc: unbreak vhost List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org On Fri, 2010-07-16 at 14:00 +0300, Michael S. Tsirkin wrote: > 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. Yep, I already submitted an identical patch too: http://lists.nongnu.org/archive/html/qemu-devel/2010-07/msg00364.html Alex > Signed-off-by: Michael S. Tsirkin > --- > 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 */