[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 30/62] target/arm: Add TBFLAG_M32.SECURE
From: |
Richard Henderson |
Subject: |
[PATCH 30/62] target/arm: Add TBFLAG_M32.SECURE |
Date: |
Sun, 3 Jul 2022 13:53:47 +0530 |
Remove the use of regime_is_secure from arm_tr_init_disas_context.
Instead, provide the value of v8m_secure directly from tb_flags.
Rather than use regime_is_secure, use the env->v7m.secure directly,
as per arm_mmu_idx_el.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/cpu.h | 2 ++
target/arm/helper.c | 4 ++++
target/arm/translate.c | 3 +--
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/target/arm/cpu.h b/target/arm/cpu.h
index 4a41b5dcef..919e7c27a3 100644
--- a/target/arm/cpu.h
+++ b/target/arm/cpu.h
@@ -3162,6 +3162,8 @@ FIELD(TBFLAG_M32, NEW_FP_CTXT_NEEDED, 3, 1) /* Not
cached. */
FIELD(TBFLAG_M32, FPCCR_S_WRONG, 4, 1) /* Not cached. */
/* Set if MVE insns are definitely not predicated by VPR or LTPSIZE */
FIELD(TBFLAG_M32, MVE_NO_PRED, 5, 1) /* Not cached. */
+/* Set if in secure mode */
+FIELD(TBFLAG_M32, SECURE, 6, 1)
/*
* Bit usage when in AArch64 state
diff --git a/target/arm/helper.c b/target/arm/helper.c
index fb13e0f4c0..0908c20215 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -11281,6 +11281,10 @@ static CPUARMTBFlags rebuild_hflags_m32(CPUARMState
*env, int fp_el,
DP_TBFLAG_M32(flags, STACKCHECK, 1);
}
+ if (arm_feature(env, ARM_FEATURE_M_SECURITY) && env->v7m.secure) {
+ DP_TBFLAG_M32(flags, SECURE, 1);
+ }
+
return rebuild_hflags_common_32(env, fp_el, mmu_idx, flags);
}
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 6617de775f..540ce84d95 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -9359,8 +9359,7 @@ static void arm_tr_init_disas_context(DisasContextBase
*dcbase, CPUState *cs)
dc->vfp_enabled = 1;
dc->be_data = MO_TE;
dc->v7m_handler_mode = EX_TBFLAG_M32(tb_flags, HANDLER);
- dc->v8m_secure = arm_feature(env, ARM_FEATURE_M_SECURITY) &&
- regime_is_secure(env, dc->mmu_idx);
+ dc->v8m_secure = EX_TBFLAG_M32(tb_flags, SECURE);
dc->v8m_stackcheck = EX_TBFLAG_M32(tb_flags, STACKCHECK);
dc->v8m_fpccr_s_wrong = EX_TBFLAG_M32(tb_flags, FPCCR_S_WRONG);
dc->v7m_new_fp_ctxt_needed =
--
2.34.1
- [PATCH 20/62] target/arm: Add is_secure parameter to get_phys_addr_v5, (continued)
- [PATCH 20/62] target/arm: Add is_secure parameter to get_phys_addr_v5, Richard Henderson, 2022/07/03
- [PATCH 21/62] target/arm: Add is_secure parameter to get_phys_addr_v6, Richard Henderson, 2022/07/03
- [PATCH 22/62] target/arm: Add secure parameter to get_phys_addr_pmsav8, Richard Henderson, 2022/07/03
- [PATCH 25/62] target/arm: Add is_secure parameter to get_phys_addr_pmsav7, Richard Henderson, 2022/07/03
- [PATCH 24/62] target/arm: Add is_secure parameter to get_phys_addr_lpae, Richard Henderson, 2022/07/03
- [PATCH 26/62] target/arm: Add is_secure parameter to regime_translation_disabled, Richard Henderson, 2022/07/03
- [PATCH 23/62] target/arm: Add is_secure parameter to pmsav7_use_background_region, Richard Henderson, 2022/07/03
- [PATCH 27/62] target/arm: Add is_secure parameter to get_phys_addr_pmsav5, Richard Henderson, 2022/07/03
- [PATCH 28/62] target/arm: Split out get_phys_addr_with_secure, Richard Henderson, 2022/07/03
- [PATCH 29/62] target/arm: Add is_secure parameter to v7m_read_half_insn, Richard Henderson, 2022/07/03
- [PATCH 30/62] target/arm: Add TBFLAG_M32.SECURE,
Richard Henderson <=
- [PATCH 31/62] target/arm: Merge regime_is_secure into get_phys_addr, Richard Henderson, 2022/07/03
- [PATCH 32/62] target/arm: Add is_secure parameter to do_ats_write, Richard Henderson, 2022/07/03
- [PATCH 33/62] target/arm: Fold secure and non-secure a-profile mmu indexes, Richard Henderson, 2022/07/03
- [PATCH 34/62] target/arm: Reorg regime_translation_disabled, Richard Henderson, 2022/07/03
- [PATCH 35/62] target/arm: Drop secure check for HCR.TGE vs SCTLR_EL1.M, Richard Henderson, 2022/07/03
- [PATCH 36/62] target/arm: Introduce arm_hcr_el2_eff_secstate, Richard Henderson, 2022/07/03
- [PATCH 37/62] target/arm: Hoist read of *is_secure in S1_ptw_translate, Richard Henderson, 2022/07/03
- [PATCH 38/62] target/arm: Fix S2 disabled check in S1_ptw_translate, Richard Henderson, 2022/07/03
- [PATCH 39/62] target/arm: Remove env argument from combined_attrs_fwb, Richard Henderson, 2022/07/03
- [PATCH 40/62] target/arm: Pass HCR to attribute subroutines., Richard Henderson, 2022/07/03