qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Ard Biesheuvel <ardb+git@google.com>, qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, Ard Biesheuvel <ardb@kernel.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH] target/arm: Avoid target_ulong for physical address lookups
Date: Mon, 23 Sep 2024 12:03:52 +0200	[thread overview]
Message-ID: <659cb837-f53f-431b-bd29-297cdcb1c73a@linaro.org> (raw)
In-Reply-To: <20240923092233.3235856-1-ardb+git@google.com>

On 9/23/24 11:22, Ard Biesheuvel wrote:
> From: Ard Biesheuvel<ardb@kernel.org>
> 
> target_ulong is typedef'ed as a 32-bit integer when building the
> qemu-system-arm target, and this is smaller than the size of an
> intermediate physical address when LPAE is being used.
> 
> Given that Linux may place leaf level user page tables in high memory
> when built for LPAE, the kernel will crash with an external abort as
> soon as it enters user space when running with more than ~3 GiB of
> system RAM.
> 
> So replace target_ulong with hwaddr in places where it may carry an
> address value that is not representable in 32 bits.
> 
> Fixes: f3639a64f602ea ("target/arm: Use softmmu tlbs for page table walking")
> Reported-by: Arnd Bergmann<arnd@arndb.de>
> Signed-off-by: Ard Biesheuvel<ardb@kernel.org>
> ---
>   target/arm/internals.h |  4 ++--
>   target/arm/ptw.c       | 16 ++++++++--------
>   2 files changed, 10 insertions(+), 10 deletions(-)

Ouch, my bad.  Thanks for catching.

Nit: The type "vaddr" is probably more descriptive than "hwaddr" as input to 
get_phys_addr.  Both are typedefs of uint64_t, so there's no functional difference between 
them.

Anyway,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


  reply	other threads:[~2024-09-23 10:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-23  9:22 [PATCH] target/arm: Avoid target_ulong for physical address lookups Ard Biesheuvel
2024-09-23 10:03 ` Richard Henderson [this message]
2024-09-23 11:37 ` Arnd Bergmann

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=659cb837-f53f-431b-bd29-297cdcb1c73a@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=ardb+git@google.com \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.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).