From patchwork Fri Jul 16 11:00:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 59093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3E37DB6F05 for ; Fri, 16 Jul 2010 21:06:46 +1000 (EST) Received: from localhost ([127.0.0.1]:39726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZikd-0002UR-C6 for incoming@patchwork.ozlabs.org; Fri, 16 Jul 2010 07:06:43 -0400 Received: from [140.186.70.92] (port=37183 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZijN-00027T-Jl for qemu-devel@nongnu.org; Fri, 16 Jul 2010 07:05:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZijM-0002ST-9f for qemu-devel@nongnu.org; Fri, 16 Jul 2010 07:05:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51875) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZijM-0002SD-1i for qemu-devel@nongnu.org; Fri, 16 Jul 2010 07:05:24 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6GB5LHG023278 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Jul 2010 07:05:22 -0400 Received: from redhat.com (vpn1-5-95.ams2.redhat.com [10.36.5.95]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id o6GB5Iwp015219; Fri, 16 Jul 2010 07:05:19 -0400 Date: Fri, 16 Jul 2010 14:00:04 +0300 From: "Michael S. Tsirkin" To: alex.williamson@redhat.com, Anthony Liguori , qemu-devel@nongnu.org Message-ID: <20100716110004.GA28018@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Mutt-Fcc: =sent User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] pc: unbreak vhost X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 */