From: Richard Henderson <rth@twiddle.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Aurelien Jarno <aurelien@aurel32.net>,
Riku Voipio <riku.voipio@iki.fi>,
Laurent Vivier <laurent@vivier.eu>,
qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/3] linux-user: Tidy and enforce reserved_va initialization
Date: Thu, 5 Oct 2017 09:48:49 -0400 [thread overview]
Message-ID: <c9fdb06e-301f-0dd5-be0d-ad48865d029c@twiddle.net> (raw)
In-Reply-To: <CAFEAcA9mSQnJCDzPOvf4PsBHx0kPB7CFCLC3AdDv9G0EHrEXXg@mail.gmail.com>
On 10/03/2017 12:24 PM, Peter Maydell wrote:
> On 8 July 2017 at 03:50, Richard Henderson <rth@twiddle.net> wrote:
>> We had a check using TARGET_VIRT_ADDR_SPACE_BITS to make sure
>> that the allocation coming in from the command-line option was
>> not too large, but that didn't include target-specific knowledge
>> about other restrictions on user-space.
>>
>> Remove several target-specific hacks in linux-user/main.c.
>>
>> For MIPS and Nios, we can replace them with proper adjustments
>> to the respective target's TARGET_VIRT_ADDR_SPACE_BITS definition.
>>
>> For ARM, we had no existing ifdef but I suspect that the current
>> default value of 0xf7000000 was chosen with this in mind. Define
>> a workable value in linux-user/arm/, and also document why the
>> special case is required.
>>
>> Signed-off-by: Richard Henderson <rth@twiddle.net>
>> ---
>> linux-user/arm/target_cpu.h | 4 ++++
>> target/mips/mips-defs.h | 6 +++++-
>> target/nios2/cpu.h | 6 +++++-
>> linux-user/main.c | 38 +++++++++++++++++++++++++-------------
>> 4 files changed, 39 insertions(+), 15 deletions(-)
>>
>> diff --git a/linux-user/arm/target_cpu.h b/linux-user/arm/target_cpu.h
>> index d888219..c4f79eb 100644
>> --- a/linux-user/arm/target_cpu.h
>> +++ b/linux-user/arm/target_cpu.h
>> @@ -19,6 +19,10 @@
>> #ifndef ARM_TARGET_CPU_H
>> #define ARM_TARGET_CPU_H
>>
>> +/* We need to be able to map the commpage.
>> + See validate_guest_space in linux-user/elfload.c. */
>> +#define MAX_RESERVED_VA 0xfff00000ul
>> +
>
> This should be 0xffff0000, but you'll need the bugfix patch I just sent
> out first.
>
> (Why "UL" ? That's usually a wrong choice compared to either U or ULL.)
Because that matches the type of
+unsigned long reserved_va = MAX_RESERVED_VA;
Which, arguably, should be uintptr_t or size_t something instead, but that
would certainly be for a different patch.
If you prefer, since this is a 32-bit value, I could trim the define to U and
still be correct.
r~
next prev parent reply other threads:[~2017-10-05 13:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-08 2:50 [Qemu-devel] [PATCH 0/3] linux-user fixes for va mapping Richard Henderson
2017-07-08 2:50 ` [Qemu-devel] [PATCH 1/3] tcg: Fix off-by-one in assert in page_set_flags Richard Henderson
2017-07-08 17:10 ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
2017-07-08 2:50 ` [Qemu-devel] [PATCH 2/3] linux-user: Tidy and enforce reserved_va initialization Richard Henderson
2017-10-03 16:24 ` Peter Maydell
2017-10-05 13:48 ` Richard Henderson [this message]
2017-07-08 2:50 ` [Qemu-devel] [PATCH 3/3] linux-user/sh4: Reduce TARGET_VIRT_ADDR_SPACE_BITS to 31 Richard Henderson
2017-07-08 17:12 ` [Qemu-devel] [Qemu-arm] " Philippe Mathieu-Daudé
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=c9fdb06e-301f-0dd5-be0d-ad48865d029c@twiddle.net \
--to=rth@twiddle.net \
--cc=aurelien@aurel32.net \
--cc=laurent@vivier.eu \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.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 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).