From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JLwxo-0005q0-Il for qemu-devel@nongnu.org; Mon, 04 Feb 2008 03:46:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JLwxm-0005p9-HF for qemu-devel@nongnu.org; Mon, 04 Feb 2008 03:46:03 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JLwxm-0005p4-9z for qemu-devel@nongnu.org; Mon, 04 Feb 2008 03:46:02 -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 1JLwxm-0000kN-AR for qemu-devel@nongnu.org; Mon, 04 Feb 2008 03:46:02 -0500 From: Izik Eidus In-Reply-To: <47A670B4.6020803@codemonkey.ws> References: <1201903921-1125-1-git-send-email-aliguori@us.ibm.com> <1201903921-1125-3-git-send-email-aliguori@us.ibm.com> <47A670B4.6020803@codemonkey.ws> Content-Type: text/plain Date: Mon, 04 Feb 2008 10:45:48 +0200 Message-Id: <1202114748.30861.6.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 2/6] Use correct types to enable > 2G support (v2) 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 On Sun, 2008-02-03 at 19:56 -0600, Anthony Liguori wrote: > Hi Izik, Hi > > Anthony Liguori wrote: > > Index: qemu/cpu-all.h > > =================================================================== > > --- qemu.orig/cpu-all.h 2008-02-01 15:24:45.000000000 -0600 > > +++ qemu/cpu-all.h 2008-02-01 15:28:48.000000000 -0600 > > @@ -695,7 +695,7 @@ > > > > /* page related stuff */ > > > > -#define TARGET_PAGE_SIZE (1 << TARGET_PAGE_BITS) > > +#define TARGET_PAGE_SIZE (1ul << TARGET_PAGE_BITS) > > #define TARGET_PAGE_MASK ~(TARGET_PAGE_SIZE - 1) > > #define TARGET_PAGE_ALIGN(addr) (((addr) + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK > > Do you recall what this change fixed? As Paul pointed out in IRC, using > the host type here doesn't really fix the problem (target_ulong would be > more appropriate). However, we're both curious what problem it's > actually fixing since sign extending the int should just work. ok the commit say: kvm: qemu: change the type of the various page masks to unsigned long prevents truncation with >=4GB of guest physical memory as far as i remember it was used to address something with cpu_physical_memory_rw() probably related to &TARGET_PAGE_SIZE or ~TARGET_PAGE_SIZE, the fact is that i dont know if it ever fixed anything