aboutsummaryrefslogtreecommitdiff
path: root/hw/core/cpu-user.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2025-07-25 18:55:08 +0100
committerRichard Henderson <richard.henderson@linaro.org>2025-07-25 13:11:48 -1000
commit3cdd990aa920ec8f2994b634f758dab4a86ac167 (patch)
treee6bcb98e5cf8e731de8823c9311eea69fbcd2f2d /hw/core/cpu-user.c
parentc017386f28c03a03b8f14444f8671d3d8f7180fe (diff)
downloadqemu-3cdd990aa920ec8f2994b634f758dab4a86ac167.zip
qemu-3cdd990aa920ec8f2994b634f758dab4a86ac167.tar.gz
qemu-3cdd990aa920ec8f2994b634f758dab4a86ac167.tar.bz2
linux-user/aarch64: Clear TPIDR2_EL0 when delivering signals
A recent change to the kernel (Linux commit b376108e1f88 "arm64/fpsimd: signal: Clear TPIDR2 when delivering signals") updated the signal-handler entry code to always clear TPIDR2_EL0. This is necessary for the userspace ZA lazy saving scheme to work correctly when unwinding exceptions across a signal boundary. (For the essay-length description of the incorrect behaviour and why this is the correct fix, see the commit message for the kernel commit.) Make QEMU also clear TPIDR2_EL0 on signal entry, applying the equivalent bugfix to our implementation. Note that getting this unwinding to work correctly also requires changes to the userspace code, e.g. as implemented in gcc in https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=b5ffc8e75a8 This change is technically an ABI change; from the kernel's point of view SME was never enabled (it was hidden behind CONFIG_BROKEN) before the change. From QEMU's point of view our SME-related signal handling was broken anyway as we weren't saving and restoring TPIDR2_EL0. Cc: qemu-stable@nongnu.org Fixes: 78011586b90d1 ("target/arm: Enable SME for user-only") Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-ID: <20250725175510.3864231-2-peter.maydell@linaro.org>
Diffstat (limited to 'hw/core/cpu-user.c')
0 files changed, 0 insertions, 0 deletions