qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH 1/9] linux-user: Diagnose incorrect -R size
Date: Fri, 17 Mar 2023 15:05:26 +0000	[thread overview]
Message-ID: <CAFEAcA8CE335C3LHArDrGpanAL-y=tCQbwc-ewu9xX-aymr6_A@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA_B6hWtrQr9WCm0J5iWWg7nQyYCGfhcYX8UM4wKGJ1FLA@mail.gmail.com>

On Fri, 17 Mar 2023 at 14:57, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Fri, 17 Mar 2023 at 14:46, Richard Henderson
> <richard.henderson@linaro.org> wrote:
> >
> > On 3/7/23 02:17, Peter Maydell wrote:
> > > It looks like we (inadvertently) broke "-R 0 means turn off"
> > > in 2019 with commit dc18baaef36d95e5; prior to that the
> > > 64-on-32 default was set by the initial value of the global
> > > variable and could be overridden on the command line. After
> > > that we ended up doing the default-value stuff after the
> > > command line was parsed instead.
> >
> > (Not 64-on-32, but 32-on-64.)
> >
> > I don't understand how 32-on-64 would ever work without reserved_va.  The host kernel
> > would otherwise place mmap blocks anywhere it chooses, which may not be within 4GB of any
> > given guest_base.
>
> I think most of the use cases weren't doing mmap of any
> kind. The gcc test suite is one example of that.

...but in any case, looking at the linux-user/mmap.c
code it doesn't let the kernel give it any old host
address, even in the no-reserved_va code path:
mmap_find_vma() calls mmap() with a hint address it wants
the kernel to try, and it refuses to use addresses which
aren't reachable by the guest (as defined by h2g_valid()).
So as long as the guest program isn't a really heavy
mmap user it will be fine even with a 0 reserved_va.

thanks
-- PMM


  reply	other threads:[~2023-03-17 15:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06  2:12 [PATCH 0/9] accel/tcg: Fix page_set_flags and related [#1528] Richard Henderson
2023-03-06  2:12 ` [PATCH 1/9] linux-user: Diagnose incorrect -R size Richard Henderson
2023-03-06 12:56   ` Peter Maydell
2023-03-06 21:24     ` Richard Henderson
2023-03-07 10:12       ` Peter Maydell
2023-03-07 10:17         ` Peter Maydell
2023-03-17 14:46           ` Richard Henderson
2023-03-17 14:57             ` Peter Maydell
2023-03-17 15:05               ` Peter Maydell [this message]
2023-03-06  2:13 ` [PATCH 2/9] linux-user: Rename max_reserved_va in main Richard Henderson
2023-03-06  7:33   ` Philippe Mathieu-Daudé
2023-03-06  2:13 ` [PATCH 3/9] include/exec: Replace reserved_va with max_reserved_va Richard Henderson
2023-03-06  2:13 ` [PATCH 4/9] accel/tcg: Pass last not end to page_set_flags Richard Henderson
2023-03-06  7:49   ` Philippe Mathieu-Daudé
2023-03-06  2:13 ` [PATCH 5/9] accel/tcg: Pass last not end to page_reset_target_data Richard Henderson
2023-03-06  7:50   ` Philippe Mathieu-Daudé
2023-03-06  2:13 ` [PATCH 6/9] accel/tcg: Pass last not end to PAGE_FOR_EACH_TB Richard Henderson
2023-03-06  7:52   ` Philippe Mathieu-Daudé
2023-03-06  2:13 ` [PATCH 7/9] accel/tcg: Pass last not end to page_collection_lock Richard Henderson
2023-03-06  7:53   ` Philippe Mathieu-Daudé
2023-03-06  2:13 ` [PATCH 8/9] accel/tcg: Pass last not end to tb_invalidate_phys_page_range__locked Richard Henderson
2023-03-06  2:13 ` [PATCH 9/9] accel/tcg: Pass last not end to tb_invalidate_phys_range Richard Henderson
2023-03-06  7:58   ` Philippe Mathieu-Daudé
2023-03-07  3:19 ` [PATCH 0/9] accel/tcg: Fix page_set_flags and related [#1528] Joel Stanley
2023-03-07 13:55   ` Ninad Palsule

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='CAFEAcA8CE335C3LHArDrGpanAL-y=tCQbwc-ewu9xX-aymr6_A@mail.gmail.com' \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).