]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/arm: Correct errors in WFI/WFE trapping
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 30 Jan 2025 18:23:09 +0000 (18:23 +0000)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 25 Feb 2025 06:24:18 +0000 (09:24 +0300)
commit3ffbdc3e12269f9269b11f250e45be1a617090aa
tree5b962620a2f85487c6f2eb0a097127410e6c70fc
parent37600704ddfeca7b98342dc3c298ce014af6b73a
target/arm: Correct errors in WFI/WFE trapping

The code for WFI/WFE trapping has several errors:
 * it wasn't using arm_sctlr(), so it would look at SCTLR_EL1
   even if the CPU was in the EL2&0 translation regime
 * it was raising UNDEF, not Monitor Trap, for traps to
   AArch32 EL3 because of SCR.{TWE,TWI}
 * it was not honouring SCR.{TWE,TWI} when running in
   AArch32 at EL3 not in Monitor mode
 * it checked SCR.{TWE,TWI} even on v7 CPUs which don't have
   those bits

Fix these bugs.

Cc: qemu-stable@nongnu.org
Fixes: b1eced713d99 ("target-arm: Add WFx instruction trap support")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250130182309.717346-15-peter.maydell@linaro.org
(cherry picked from commit 2b95a2d01b04afadf510a49ac14b38a59be8c5f5)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target/arm/tcg/op_helper.c