From a796d5aa11b25622841cd2283630ff9348eed699 Mon Sep 17 00:00:00 2001 From: Jayanth Dodderi Chidanand Date: Thu, 11 Apr 2024 14:13:52 +0100 Subject: [PATCH] fix(cm): remove ENABLE_FEAT_MTE usage commit@c282384dbb45b6185b4aba14efebbad110d18e49 removed ENABLE_FEAT_MTE but missed its usage in context structure declaration path. All mte regs that are currently context saved/restored are needed only when FEAT_MTE2 is enabled, so move to usage of FEAT_MTE2 and remove FEAT_MTE usage Change-Id: I6b4417485fa6b7f52a31045562600945e48e81b7 Signed-off-by: Jayanth Dodderi Chidanand --- include/lib/el3_runtime/context_el2.h | 20 ++++++++++---------- lib/el3_runtime/aarch64/context_mgmt.c | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/lib/el3_runtime/context_el2.h b/include/lib/el3_runtime/context_el2.h index 4ad96349d..04f658790 100644 --- a/include/lib/el3_runtime/context_el2.h +++ b/include/lib/el3_runtime/context_el2.h @@ -49,9 +49,9 @@ typedef struct el2_common_regs { uint64_t vttbr_el2; } el2_common_regs_t; -typedef struct el2_mte_regs { +typedef struct el2_mte2_regs { uint64_t tfsr_el2; -} el2_mte_regs_t; +} el2_mte2_regs_t; typedef struct el2_fgt_regs { uint64_t hdfgrtr_el2; @@ -118,8 +118,8 @@ typedef struct el2_sysregs { el2_common_regs_t common; -#if ENABLE_FEAT_MTE - el2_mte_regs_t mte; +#if ENABLE_FEAT_MTE2 + el2_mte2_regs_t mte2; #endif #if ENABLE_FEAT_FGT @@ -185,14 +185,14 @@ typedef struct el2_sysregs { #define write_el2_ctx_common(ctx, reg, val) ((((ctx)->common).reg) \ = (uint64_t) (val)) -#if ENABLE_FEAT_MTE -#define read_el2_ctx_mte(ctx, reg) (((ctx)->mte).reg) -#define write_el2_ctx_mte(ctx, reg, val) ((((ctx)->mte).reg) \ +#if ENABLE_FEAT_MTE2 +#define read_el2_ctx_mte2(ctx, reg) (((ctx)->mte2).reg) +#define write_el2_ctx_mte2(ctx, reg, val) ((((ctx)->mte2).reg) \ = (uint64_t) (val)) #else -#define read_el2_ctx_mte(ctx, reg) ULL(0) -#define write_el2_ctx_mte(ctx, reg, val) -#endif /* ENABLE_FEAT_MTE */ +#define read_el2_ctx_mte2(ctx, reg) ULL(0) +#define write_el2_ctx_mte2(ctx, reg, val) +#endif /* ENABLE_FEAT_MTE2 */ #if ENABLE_FEAT_FGT #define read_el2_ctx_fgt(ctx, reg) (((ctx)->fgt).reg) diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c index 39f39476f..6929ff9ca 100644 --- a/lib/el3_runtime/aarch64/context_mgmt.c +++ b/lib/el3_runtime/aarch64/context_mgmt.c @@ -1278,7 +1278,7 @@ void cm_el2_sysregs_context_save(uint32_t security_state) el2_sysregs_context_save_gic(el2_sysregs_ctx); if (is_feat_mte2_supported()) { - write_el2_ctx_mte(el2_sysregs_ctx, tfsr_el2, read_tfsr_el2()); + write_el2_ctx_mte2(el2_sysregs_ctx, tfsr_el2, read_tfsr_el2()); } #if CTX_INCLUDE_MPAM_REGS @@ -1364,7 +1364,7 @@ void cm_el2_sysregs_context_restore(uint32_t security_state) el2_sysregs_context_restore_gic(el2_sysregs_ctx); if (is_feat_mte2_supported()) { - write_tfsr_el2(read_el2_ctx_mte(el2_sysregs_ctx, tfsr_el2)); + write_tfsr_el2(read_el2_ctx_mte2(el2_sysregs_ctx, tfsr_el2)); } #if CTX_INCLUDE_MPAM_REGS