All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Alexander Graf <agraf@suse.de>
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: Fri, 25 Nov 2011 13:06:47 +0000	[thread overview]
Message-ID: <CAFEAcA_qSML2F_c1w+OGxGJuYFa7Ok_Jb-36-BWpiSV6=tc77w@mail.gmail.com> (raw)
In-Reply-To: <1322178221-8481-1-git-send-email-agraf@suse.de>

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.)

-- PMM

  reply	other threads:[~2011-11-25 13:06 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 [this message]
2011-12-19 13:09   ` Alexander Graf
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='CAFEAcA_qSML2F_c1w+OGxGJuYFa7Ok_Jb-36-BWpiSV6=tc77w@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=agraf@suse.de \
    --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.