OSDN Git Service

target/arm: honor HCR_E2H and HCR_TGE in arm_excp_unmasked()
authorAke Koomsin <ake@igel.co.jp>
Mon, 17 Oct 2022 09:24:32 +0000 (18:24 +0900)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 27 Oct 2022 09:27:23 +0000 (10:27 +0100)
commitc939a7c7b93ee44a4963fabe81454e1f956ecd4b
tree99926d002bf2a68e2f78f60188dbdc8e5d1c1146
parent7cd5d384bb298ce3c595a3774213b5b478881ac8
target/arm: honor HCR_E2H and HCR_TGE in arm_excp_unmasked()

An exception targeting EL2 from lower EL is actually maskable when
HCR_E2H and HCR_TGE are both set. This applies to both secure and
non-secure Security state.

We can remove the conditions that try to suppress masking of
interrupts when we are Secure and the exception targets EL2 and
Secure EL2 is disabled.  This is OK because in that situation
arm_phys_excp_target_el() will never return 2 as the target EL.  The
'not if secure' check in this function was originally written before
arm_hcr_el2_eff(), and back then the target EL returned by
arm_phys_excp_target_el() could be 2 even if we were in Secure
EL0/EL1; but it is no longer needed.

Signed-off-by: Ake Koomsin <ake@igel.co.jp>
Message-id: 20221017092432.546881-1-ake@igel.co.jp
[PMM: Add commit message paragraph explaining why it's OK to
 remove the checks on secure and SCR_EEL2]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/cpu.c