]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/arm/ptw: fix arm_cpu_get_phys_page_attrs_debug
authorPierrick Bouvier <pierrick.bouvier@linaro.org>
Mon, 14 Apr 2025 15:30:27 +0000 (08:30 -0700)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 6 May 2025 14:01:22 +0000 (15:01 +0100)
commite1781b38af5e5c2e8a4b8f11e3e54de393a82eb2
tree94069c634355c151aaa7fb13accaa90e0a85338e
parent63201878f1cab185110f4d738ca41e05689aebd7
target/arm/ptw: fix arm_cpu_get_phys_page_attrs_debug

It was reported that QEMU monitor command gva2gpa was reporting unmapped
memory for a valid access (qemu-system-aarch64), during a copy from
kernel to user space (__arch_copy_to_user symbol in Linux) [1].
This was affecting cpu_memory_rw_debug also, which
is used in numerous places in our codebase. After investigating, the
problem was specific to arm_cpu_get_phys_page_attrs_debug.

When performing user access from a privileged space, we need to do a
second lookup for user mmu idx, following what get_a64_user_mem_index is
doing at translation time.

[1] https://lists.nongnu.org/archive/html/qemu-discuss/2025-04/msg00013.html

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20250414153027.1486719-5-pierrick.bouvier@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/ptw.c