[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/28] target/arm: Fix Secure PL1 tests in fp_exception_el
From: |
Peter Maydell |
Subject: |
[PULL 23/28] target/arm: Fix Secure PL1 tests in fp_exception_el |
Date: |
Fri, 10 Jun 2022 17:07:33 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
We were using arm_is_secure and is_a64, which are
tests against the current EL, as opposed to
arm_el_is_aa64 and arm_is_secure_below_el3, which
can be applied to a different EL than current.
Consolidate the two tests.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220609202901.1177572-24-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/helper.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 2b2c1998fd1..b95aa534741 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -10879,27 +10879,22 @@ int fp_exception_el(CPUARMState *env, int cur_el)
int fpen = FIELD_EX64(env->cp15.cpacr_el1, CPACR_EL1, FPEN);
switch (fpen) {
+ case 1:
+ if (cur_el != 0) {
+ break;
+ }
+ /* fall through */
case 0:
case 2:
- if (cur_el == 0 || cur_el == 1) {
- /* Trap to PL1, which might be EL1 or EL3 */
- if (arm_is_secure(env) && !arm_el_is_aa64(env, 3)) {
- return 3;
- }
- return 1;
- }
- if (cur_el == 3 && !is_a64(env)) {
- /* Secure PL1 running at EL3 */
+ /* Trap from Secure PL0 or PL1 to Secure PL1. */
+ if (!arm_el_is_aa64(env, 3)
+ && (cur_el == 3 || arm_is_secure_below_el3(env))) {
return 3;
}
- break;
- case 1:
- if (cur_el == 0) {
+ if (cur_el <= 1) {
return 1;
}
break;
- case 3:
- break;
}
}
--
2.25.1
- [PULL 08/28] target/arm: Move arm_debug_exception_fsr to debug_helper.c, (continued)
- [PULL 08/28] target/arm: Move arm_debug_exception_fsr to debug_helper.c, Peter Maydell, 2022/06/10
- [PULL 09/28] target/arm: Rename helper_exception_with_syndrome, Peter Maydell, 2022/06/10
- [PULL 12/28] target/arm: Introduce gen_exception_insn, Peter Maydell, 2022/06/10
- [PULL 11/28] target/arm: Rename gen_exception_insn to gen_exception_insn_el, Peter Maydell, 2022/06/10
- [PULL 03/28] target/arm: Move exception_target_el out of line, Peter Maydell, 2022/06/10
- [PULL 06/28] target/arm: Use is_a64 in arm_generate_debug_exceptions, Peter Maydell, 2022/06/10
- [PULL 10/28] target/arm: Introduce gen_exception_insn_el_v, Peter Maydell, 2022/06/10
- [PULL 20/28] target/arm: Remove default_exception_el, Peter Maydell, 2022/06/10
- [PULL 18/28] target/arm: Introduce gen_exception_el_v, Peter Maydell, 2022/06/10
- [PULL 15/28] target/arm: Move gen_exception to translate.c, Peter Maydell, 2022/06/10
- [PULL 23/28] target/arm: Fix Secure PL1 tests in fp_exception_el,
Peter Maydell <=
- [PULL 21/28] target/arm: Create raise_exception_debug, Peter Maydell, 2022/06/10
- [PULL 25/28] target/arm: Adjust format test in scr_write, Peter Maydell, 2022/06/10
- [PULL 28/28] semihosting/config: Merge --semihosting-config option groups, Peter Maydell, 2022/06/10
- [PULL 13/28] target/arm: Create helper_exception_swstep, Peter Maydell, 2022/06/10
- [PULL 14/28] target/arm: Remove TBFLAG_ANY.DEBUG_TARGET_EL, Peter Maydell, 2022/06/10
- [PULL 16/28] target/arm: Rename gen_exception to gen_exception_el, Peter Maydell, 2022/06/10
- [PULL 19/28] target/arm: Introduce helper_exception_with_syndrome, Peter Maydell, 2022/06/10
- [PULL 07/28] target/arm: Move exception_bkpt_insn to debug_helper.c, Peter Maydell, 2022/06/10
- [PULL 17/28] target/arm: Introduce gen_exception, Peter Maydell, 2022/06/10
- [PULL 26/28] target/arm: SCR_EL3.RW is RAO/WI without AArch32 EL[12], Peter Maydell, 2022/06/10