From: Laurent Vivier <laurent@vivier.eu>
To: "Alex Bennée" <alex.bennee@linaro.org>, qemu-devel@nongnu.org
Cc: richard.henderson@linaro.org
Subject: Re: [RFC PATCH] linux-user: don't adjust base of found hole
Date: Fri, 17 Dec 2021 13:57:22 +0100 [thread overview]
Message-ID: <b905eba0-b724-60ad-ab3c-8033bfab0f32@vivier.eu> (raw)
In-Reply-To: <20211216144442.2270605-1-alex.bennee@linaro.org>
Le 16/12/2021 à 15:44, Alex Bennée a écrit :
> The pgb_find_hole function goes to the trouble of taking account of
> both mmap_min_addr and any offset we've applied to decide the starting
> address of a potential hole. This is especially important for
> emulating 32bit ARM in a 32bit build as we have applied the offset to
> ensure there will be space to map the ARM_COMMPAGE bellow the main
> guest map (using wrapped arithmetic).
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/690
> ---
> linux-user/elfload.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index 238979b8b6..8d839b79fb 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -2334,7 +2334,7 @@ static uintptr_t pgb_find_hole(uintptr_t guest_loaddr, uintptr_t guest_size,
>
> /* Record the lowest successful match. */
> if (ret < 0) {
> - ret = align_start - guest_loaddr;
> + ret = align_start;
> }
> /* If this hole contains the identity map, select it. */
> if (align_start <= guest_loaddr &&
>
It seems not consistent with what we have with fallback where we substract the guest_loadaddr:
2289 if (!maps) {
2290 ret = pgd_find_hole_fallback(guest_size, brk, align, offset);
2291 return ret == -1 ? -1 : ret - guest_loaddr;
2292 }
Thanks,
Laurent
next prev parent reply other threads:[~2021-12-17 13:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-16 14:44 [RFC PATCH] linux-user: don't adjust base of found hole Alex Bennée
2021-12-17 12:57 ` Laurent Vivier [this message]
2021-12-17 13:18 ` Alex Bennée
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=b905eba0-b724-60ad-ab3c-8033bfab0f32@vivier.eu \
--to=laurent@vivier.eu \
--cc=alex.bennee@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).