From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RccyU-0007tg-PS for qemu-devel@nongnu.org; Mon, 19 Dec 2011 08:09:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RccyQ-0005Wb-KP for qemu-devel@nongnu.org; Mon, 19 Dec 2011 08:09:50 -0500 Received: from cantor2.suse.de ([195.135.220.15]:44062 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RccyQ-0005WX-Ck for qemu-devel@nongnu.org; Mon, 19 Dec 2011 08:09:46 -0500 Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Alexander Graf In-Reply-To: Date: Mon, 19 Dec 2011 14:09:44 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1322178221-8481-1-git-send-email-agraf@suse.de> Subject: Re: [Qemu-devel] [PATCH v2] linux-user: Fix 32-on-64 mmap for x86_64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: riku.voipio@iki.fi, qemu-devel Developers On 25.11.2011, at 14:06, Peter Maydell wrote: > On 24 November 2011 23:43, Alexander Graf wrote: >> --- >>=20 >> v1 -> v2: >>=20 >> - make prettier by just wrapping mmap in linux-user/mmap.c >=20 > Hmm. I prefer the non-wrapped version :-) > In particular, qemu_mmap() implies that (like other qemu_foo > wrappers) this is a portability wrapper that should be used for > all mmap calls. But actually we only want to apply MAP_32BIT > for those mmap()s which are mmapping guest memory requests. > So just having an extra flag in the cases where we need the > flag seems more straightforward. >=20 > I'd prefer a >=20 > #if defined(MAP_32BIT) && defined(__x86_64__) && (TARGET_LONG_BITS =3D=3D= 32) > #define QEMU_MAP_32BIT MAP_32BIT > #else > #define QEMU_MAP_32BIT 0 > #endif >=20 > and then use QEMU_MAP_32BIT. (That way it's obvious when you're > looking at the mmap() calls that they're not using the host's > MAP_32BIT but something that might be different.) This patch is actually wrong and we should rather make proper -R values = the default instead of relying on MAP_32BIT. Alex