]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/arm: Avoid target_ulong for physical address lookups
authorArd Biesheuvel <ardb@kernel.org>
Fri, 27 Sep 2024 07:10:51 +0000 (09:10 +0200)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 2 Oct 2024 12:44:12 +0000 (15:44 +0300)
commitaa291cc29240ce7f44eee1f82a3aa6eae02308e8
tree26ce5a683be6f97f0c09e3fc291d17c9cbe88c7d
parent3731791fd7a6c4caa3aa9397c1bd75efb300e74b
target/arm: Avoid target_ulong for physical address lookups

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 vaddr 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")
Cc: qemu-stable@nongnu.org
Reported-by: Arnd Bergmann <arnd@arndb.de>
Tested-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Message-id: 20240927071051.1444768-1-ardb+git@google.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 67d762e716a7127ecc114e9708254316dd521911)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/arm/internals.h
target/arm/ptw.c