From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTvUS-0008Ss-D8 for qemu-devel@nongnu.org; Fri, 25 Nov 2011 08:06:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTvUO-0002Hd-GH for qemu-devel@nongnu.org; Fri, 25 Nov 2011 08:06:52 -0500 Received: from mail-yx0-f173.google.com ([209.85.213.173]:50283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTvUO-0002HT-8D for qemu-devel@nongnu.org; Fri, 25 Nov 2011 08:06:48 -0500 Received: by yenq7 with SMTP id q7so468457yen.4 for ; Fri, 25 Nov 2011 05:06:47 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1322178221-8481-1-git-send-email-agraf@suse.de> References: <1322178221-8481-1-git-send-email-agraf@suse.de> Date: Fri, 25 Nov 2011 13:06:47 +0000 Message-ID: From: Peter Maydell Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Alexander Graf Cc: riku.voipio@iki.fi, qemu-devel Developers On 24 November 2011 23:43, Alexander Graf wrote: > --- > > v1 -> v2: > > =C2=A0- make prettier by just wrapping mmap in linux-user/mmap.c 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. I'd prefer a #if defined(MAP_32BIT) && defined(__x86_64__) && (TARGET_LONG_BITS =3D=3D 3= 2) #define QEMU_MAP_32BIT MAP_32BIT #else #define QEMU_MAP_32BIT 0 #endif 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.) -- PMM