All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: riku.voipio@iki.fi, qemu-devel Developers <qemu-devel@nongnu.org>
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	[thread overview]
Message-ID: <B81DAB61-7B70-44A1-BB49-ED450B843CD9@suse.de> (raw)
In-Reply-To: <CAFEAcA_qSML2F_c1w+OGxGJuYFa7Ok_Jb-36-BWpiSV6=tc77w@mail.gmail.com>


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

> On 24 November 2011 23:43, Alexander Graf <agraf@suse.de> 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	other threads:[~2011-12-19 13:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-24 23:43 [Qemu-devel] [PATCH v2] linux-user: Fix 32-on-64 mmap for x86_64 Alexander Graf
2011-11-25 13:06 ` Peter Maydell
2011-12-19 13:09   ` Alexander Graf [this message]
2011-12-20  7:46     ` 陳韋任
2011-12-20 16:12       ` Alexander Graf
2011-12-21  2:43         ` 陳韋任
2011-12-21  6:19           ` Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B81DAB61-7B70-44A1-BB49-ED450B843CD9@suse.de \
    --to=agraf@suse.de \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.