From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KdnHi-0005A1-9z for qemu-devel@nongnu.org; Thu, 11 Sep 2008 10:36:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KdnHg-00057l-Qu for qemu-devel@nongnu.org; Thu, 11 Sep 2008 10:36:38 -0400 Received: from [199.232.76.173] (port=48203 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdnHg-00057i-Oy for qemu-devel@nongnu.org; Thu, 11 Sep 2008 10:36:36 -0400 Received: from an-out-0708.google.com ([209.85.132.249]:28996) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KdnHg-0006Sr-GA for qemu-devel@nongnu.org; Thu, 11 Sep 2008 10:36:36 -0400 Received: by an-out-0708.google.com with SMTP id d18so39943and.130 for ; Thu, 11 Sep 2008 07:36:35 -0700 (PDT) Message-ID: <48C92CC0.8030606@codemonkey.ws> Date: Thu, 11 Sep 2008 09:35:44 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] split memory allocation References: <1221140541-24464-1-git-send-email-glommer@redhat.com> <48C928AF.1070208@aurel32.net> In-Reply-To: <48C928AF.1070208@aurel32.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Glauber Causta , qemu-devel@nongnu.org Aurelien Jarno wrote: > Glauber Costa a écrit : > >> Right now, kvm keeps the memory allocation split, so we can >> handle different areas in different ways. This schema works with qemu >> too, so it appears to be the common ground. >> >> This patch proposes using this common ground for everyone, by spliting >> raw qemu. >> >> Signed-off-by: Glauber Costa >> --- >> hw/pc.c | 16 ++++++++++++---- >> 1 files changed, 12 insertions(+), 4 deletions(-) >> >> diff --git a/hw/pc.c b/hw/pc.c >> index 435c7d4..d6084ee 100644 >> --- a/hw/pc.c >> +++ b/hw/pc.c >> @@ -777,16 +777,24 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, >> vmport_init(); >> >> /* allocate RAM */ >> - ram_addr = qemu_ram_alloc(ram_size); >> - cpu_register_physical_memory(0, below_4g_mem_size, ram_addr); >> + ram_addr = qemu_ram_alloc(0xa0000); >> + cpu_register_physical_memory(0, 0xa0000, ram_addr); >> + >> + ram_addr = qemu_ram_alloc(0x100000 - 0xa0000); /* hole */ >> > > What the point of allocating RAM for the memory hole if it is not mapped? > If you don't, you violate the phys_ram_base + PA assumption for all of memory. No code should rely on this but practically speaking, there is still some code in QEMU that does. Since the RAM is never touched, it doesn't actually impact the RSS size so it's not all that important. Regards, Anthony Liguori