From patchwork Tue Jul 6 16:37:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 58047 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 0FBFEB6EF3 for ; Wed, 7 Jul 2010 02:38:02 +1000 (EST) Received: from localhost ([127.0.0.1]:43546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWB9j-0002Yi-B9 for incoming@patchwork.ozlabs.org; Tue, 06 Jul 2010 12:37:59 -0400 Received: from [140.186.70.92] (port=43942 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWB9B-0002YZ-85 for qemu-devel@nongnu.org; Tue, 06 Jul 2010 12:37:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWB99-0002Qh-El for qemu-devel@nongnu.org; Tue, 06 Jul 2010 12:37:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2787) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWB99-0002Qc-46 for qemu-devel@nongnu.org; Tue, 06 Jul 2010 12:37:23 -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 o66GbIDj025521 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Jul 2010 12:37:20 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o66GbHo0029073; Tue, 6 Jul 2010 12:37:17 -0400 From: Alex Williamson To: qemu-devel@nongnu.org, anthony@codemonkey.ws Date: Tue, 06 Jul 2010 10:37:17 -0600 Message-ID: <20100706163700.7542.81367.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 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: alex.williamson@redhat.com Subject: [Qemu-devel] [PATCH] pc: Avoid registering zero sized memory 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 No need to call cpu_register_physical_memory() for a zero sized area. Signed-off-by: Alex Williamson --- hw/pc.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/pc.c b/hw/pc.c index a96187f..58dea57 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 */