On 9/23/24 11:22, Ard Biesheuvel wrote:
From: Ard Biesheuvel<a...@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<a...@arndb.de>
Signed-off-by: Ard Biesheuvel<a...@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.hender...@linaro.org>


r~

Reply via email to