From b57e16a4f96b6cfa4da9e3b2cc6d6d4533da1950 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Fri, 3 Mar 2023 10:30:06 +0000 Subject: refactor(amu): use new AMU feature check routines The AMU extension code was using its own feature detection routines. Replace them with the generic CPU feature handlers (defined in arch_features.h), which get updated to cover the v1p1 variant as well. Change-Id: I8540f1e745d7b02a25a6c6cdf2a39d6f5e21f2aa Signed-off-by: Andre Przywara --- lib/el3_runtime/aarch32/context_mgmt.c | 6 +++--- lib/el3_runtime/aarch64/context_mgmt.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/el3_runtime') diff --git a/lib/el3_runtime/aarch32/context_mgmt.c b/lib/el3_runtime/aarch32/context_mgmt.c index f31ee5dde..62e30fcab 100644 --- a/lib/el3_runtime/aarch32/context_mgmt.c +++ b/lib/el3_runtime/aarch32/context_mgmt.c @@ -136,9 +136,9 @@ void cm_setup_context(cpu_context_t *ctx, const entry_point_info_t *ep) static void enable_extensions_nonsecure(bool el2_unused) { #if IMAGE_BL32 -#if ENABLE_FEAT_AMU - amu_enable(el2_unused); -#endif + if (is_feat_amu_supported()) { + amu_enable(el2_unused); + } if (is_feat_sys_reg_trace_supported()) { sys_reg_trace_enable(); diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c index bb6db9f4d..12f3e6d03 100644 --- a/lib/el3_runtime/aarch64/context_mgmt.c +++ b/lib/el3_runtime/aarch64/context_mgmt.c @@ -485,9 +485,9 @@ static void manage_extensions_nonsecure(bool el2_unused, cpu_context_t *ctx) spe_enable(el2_unused); } -#if ENABLE_FEAT_AMU - amu_enable(el2_unused, ctx); -#endif + if (is_feat_amu_supported()) { + amu_enable(el2_unused, ctx); + } #if ENABLE_SME_FOR_NS /* Enable SME, SVE, and FPU/SIMD for non-secure world. */ -- cgit v1.2.3