]> git.proxmox.com Git - mirror_qemu.git/commit
target/arm: Take an exception if PSTATE.IL is set
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 13 Sep 2021 15:07:24 +0000 (16:07 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 13 Sep 2021 20:01:08 +0000 (21:01 +0100)
commit520d1621de30eecd0869dfd51ae1ff1a9ba988d9
tree1ad02ee6e3e8734f3b9f219ef243d739073591d6
parent0a93293eb2ff89437900dd2e64abc0bbbcfe992d
target/arm: Take an exception if PSTATE.IL is set

In v8A, the PSTATE.IL bit is set for various kinds of illegal
exception return or mode-change attempts.  We already set PSTATE.IL
(or its AArch32 equivalent CPSR.IL) in all those cases, but we
weren't implementing the part of the behaviour where attempting to
execute an instruction with PSTATE.IL takes an immediate exception
with an appropriate syndrome value.

Add a new TB flags bit tracking PSTATE.IL/CPSR.IL, and generate code
to take an exception instead of whatever the instruction would have
been.

PSTATE.IL and CPSR.IL change only on exception entry, attempted
exception exit, and various AArch32 mode changes via cpsr_write().
These places generally already rebuild the hflags, so the only place
we need an extra rebuild_hflags call is in the illegal-return
codepath of the AArch64 exception_return helper.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210821195958.41312-2-richard.henderson@linaro.org
Message-Id: <20210817162118.24319-1-peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
[rth: Added missing returns; set IL bit in syndrome]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
target/arm/cpu.h
target/arm/helper-a64.c
target/arm/helper.c
target/arm/syndrome.h
target/arm/translate-a64.c
target/arm/translate.c
target/arm/translate.h