[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/10] target/arm: Simplify condition for tlbi_el2_cp_reginfo[]
From: |
Peter Maydell |
Subject: |
[PATCH 10/10] target/arm: Simplify condition for tlbi_el2_cp_reginfo[] |
Date: |
Tue, 10 Dec 2024 16:04:52 +0000 |
We currently register the tlbi_el2_cp_reginfo[] TLBI insns if EL2 is
implemented, or if EL3 and v8 is implemented. This is a copy of the
logic used for el2_cp_reginfo[], but for the specific case of the
TLBI insns we can simplify it. This is because we do not need the
"if EL2 does not exist but EL3 does then EL2 registers should exist
and be RAZ/WI" handling here: all our cpregs are for instructions,
which UNDEF when EL3 exists and EL2 does not.
Simplify the condition down to just "if EL2 exists".
This is not a behaviour change because:
* for AArch64 insns we marked them with ARM_CP_EL3_NO_EL2_UNDEF,
which meant that define_arm_cp_regs() would ignore them if
EL2 wasn't present
* for AArch32 insns, the .access = PL2_W meant that if EL2
was not present the only way to get at them was from AArch32
EL3; but we have no CPUs which have ARM_FEATURE_V8 but
start in AArch32
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/tcg/tlb-insns.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/target/arm/tcg/tlb-insns.c b/target/arm/tcg/tlb-insns.c
index d20d32624da..0f67294edc4 100644
--- a/target/arm/tcg/tlb-insns.c
+++ b/target/arm/tcg/tlb-insns.c
@@ -1246,9 +1246,7 @@ void define_tlb_insn_regs(ARMCPU *cpu)
* ops (i.e. matching the condition for el2_cp_reginfo[] in
* helper.c), but we will be able to simplify this later.
*/
- if (arm_feature(env, ARM_FEATURE_EL2)
- || (arm_feature(env, ARM_FEATURE_EL3)
- && arm_feature(env, ARM_FEATURE_V8))) {
+ if (arm_feature(env, ARM_FEATURE_EL2)) {
define_arm_cp_regs(cpu, tlbi_el2_cp_reginfo);
}
if (arm_feature(env, ARM_FEATURE_EL3)) {
--
2.34.1
- [PATCH 05/10] target/arm: Move AArch64 EL3 TLBI insns, (continued)
- [PATCH 05/10] target/arm: Move AArch64 EL3 TLBI insns, Peter Maydell, 2024/12/10
- [PATCH 06/10] target/arm: Move TLBI range insns, Peter Maydell, 2024/12/10
- [PATCH 07/10] target/arm: Move the TLBI OS insns to tlb-insns.c., Peter Maydell, 2024/12/10
- [PATCH 08/10] target/arm: Move small helper functions to tlb-insns.c, Peter Maydell, 2024/12/10
- [PATCH 09/10] target/arm: Move RME TLB insns to tlb-insns.c, Peter Maydell, 2024/12/10
- [PATCH 10/10] target/arm: Simplify condition for tlbi_el2_cp_reginfo[],
Peter Maydell <=