From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JKyUK-0001ae-RZ for qemu-devel@nongnu.org; Fri, 01 Feb 2008 11:11:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JKyUF-0001YV-Li for qemu-devel@nongnu.org; Fri, 01 Feb 2008 11:11:36 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JKyUF-0001YN-Fj for qemu-devel@nongnu.org; Fri, 01 Feb 2008 11:11:31 -0500 Received: from bsdimp.com ([199.45.160.85] helo=harmony.bsdimp.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JKyUD-00031y-VV for qemu-devel@nongnu.org; Fri, 01 Feb 2008 11:11:31 -0500 Date: Fri, 01 Feb 2008 09:09:00 -0700 (MST) Message-Id: <20080201.090900.1631929505.imp@bsdimp.com> Subject: Re: [Qemu-devel] Re: [PATCH 1/6] Use correct types to enable > 2G support From: "M. Warner Losh" In-Reply-To: <47A308DB.3040204@gmail.com> References: <47A32E40.3000204@us.ibm.com> <47A33721.4020600@qumranet.com> <47A308DB.3040204@gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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, hydrologiccycle@gmail.com In message: <47A308DB.3040204@gmail.com> Robert William Fuller writes: : Avi Kivity wrote: : > 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. : > : : Linux doesn't commit mapped memory until it's faulted. As for other : platforms, who knows? Most BSDs are also similarly overcommitted. 95% of the users think this is a feature, but the other 5 argue 20 times harder sometimes :-( Warner