qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] linux-user: Fix 32-on-64 mmap for x86_64


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH v2] linux-user: Fix 32-on-64 mmap for x86_64
Date: Mon, 19 Dec 2011 14:09:44 +0100

On 25.11.2011, at 14:06, Peter Maydell wrote:

> On 24 November 2011 23:43, Alexander Graf <address@hidden> wrote:
>> ---
>> 
>> v1 -> v2:
>> 
>>  - 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 == 32)
> #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.)

This patch is actually wrong and we should rather make proper -R values the 
default instead of relying on MAP_32BIT.


Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]