Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KfGVf-0004Lw-OB for qemu-devel@nongnu.org; Mon, 15 Sep 2008 12:01:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KfGVd-0004L4-9z for qemu-devel@nongnu.org; Mon, 15 Sep 2008 12:01:06 -0400 Received: from [199.232.76.173] (port=50460 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KfGVb-0004Kl-C1 for qemu-devel@nongnu.org; Mon, 15 Sep 2008 12:01:04 -0400 Received: from savannah.gnu.org ([199.232.41.3]:56349 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KfGVb-0006do-DH for qemu-devel@nongnu.org; Mon, 15 Sep 2008 12:01:03 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KfGVa-0003jC-Hh for qemu-devel@nongnu.org; Mon, 15 Sep 2008 16:01:02 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KfGVa-0003j8-3t for qemu-devel@nongnu.org; Mon, 15 Sep 2008 16:01:02 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Mon, 15 Sep 2008 16:01:02 +0000 Subject: [Qemu-devel] [5228] Right now, kvm keeps the memory allocation split, so we can Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5228 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5228 Author: aliguori Date: 2008-09-15 16:01:01 +0000 (Mon, 15 Sep 2008) Log Message: ----------- 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 Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/hw/pc.c Modified: trunk/hw/pc.c =================================================================== --- trunk/hw/pc.c 2008-09-15 15:56:30 UTC (rev 5227) +++ trunk/hw/pc.c 2008-09-15 16:01:01 UTC (rev 5228) @@ -777,16 +777,28 @@ 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); + /* Allocate, even though we won't register, so we don't break the + * phys_ram_base + PA assumption. This range includes vga (0xa0000 - 0xc0000), + * and some bios areas, which will be registered later + */ + ram_addr = qemu_ram_alloc(0x100000 - 0xa0000); + ram_addr = qemu_ram_alloc(below_4g_mem_size - 0x100000); + cpu_register_physical_memory(0x100000, + below_4g_mem_size - 0x100000, + ram_addr); + /* above 4giga memory allocation */ if (above_4g_mem_size > 0) { - cpu_register_physical_memory((target_phys_addr_t) 0x100000000ULL, + ram_addr = qemu_ram_alloc(above_4g_mem_size); + cpu_register_physical_memory(0x100000000ULL, above_4g_mem_size, - ram_addr + below_4g_mem_size); + ram_addr); } + /* allocate VGA RAM */ vga_ram_addr = qemu_ram_alloc(vga_ram_size);