From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JKy7W-0000Vd-4c for qemu-devel@nongnu.org; Fri, 01 Feb 2008 10:48:02 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JKy7T-0000Pi-8q for qemu-devel@nongnu.org; Fri, 01 Feb 2008 10:48:01 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKy7S-0000On-ML for qemu-devel@nongnu.org; Fri, 01 Feb 2008 10:47:58 -0500 Received: from bzq-179-150-194.static.bezeqint.net ([212.179.150.194] helo=il.qumranet.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JKy7S-00064x-71 for qemu-devel@nongnu.org; Fri, 01 Feb 2008 10:47:58 -0500 Message-ID: <47A33721.4020600@qumranet.com> Date: Fri, 01 Feb 2008 17:13:37 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1201818980-27534-1-git-send-email-aliguori@us.ibm.com> <1201818980-27534-2-git-send-email-aliguori@us.ibm.com> <47A2F3C7.6060409@bellard.org> <47A32E40.3000204@us.ibm.com> In-Reply-To: <47A32E40.3000204@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 1/6] Use correct types to enable > 2G support Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: kvm-devel@lists.sourceforge.net, Paul Brook , qemu-devel@nongnu.org Anthony Liguori wrote: > Fabrice Bellard wrote: >> Anthony Liguori wrote: >>> + /* above 4giga memory allocation */ >>> + if (above_4g_mem_size > 0) { >>> + ram_addr = qemu_ram_alloc(above_4g_mem_size); >>> + cpu_register_physical_memory(0x100000000, >>> above_4g_mem_size, ram_addr); >>> + } >>> + >> >> Why do you need this ? All the RAM can be registered with a single >> call. I fear you need to do that because of KVM RAM handling >> limitations. > > On the x86, there is a rather large hole at the top of memory. > Currently, we do separate allocations around this whole. You can't > get away from doing multiple cpu_register_physical_memory calls here. > We've discussed just allocating a single chunk with qemu_ram_alloc > since so many places in QEMU assume that you can do phys_ram_base + PA. > > I think I'll change this too into a single qemu_ram_alloc. That will > fix the bug with KVM when using -kernel and large memory anyway :-) Won't that cause all of the memory in the hole to be wasted? You could munmap() it, but it's hardly elegant. -- Any sufficiently difficult bug is indistinguishable from a feature.