From ff491036603c34bd80137f5fd43878eae5585197 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Thu, 17 Nov 2022 16:42:09 +0000 Subject: refactor(brbe): enable FEAT_BRBE for FEAT_STATE_CHECKED At the moment we only support FEAT_BRBE to be either unconditionally compiled in, or to be not supported at all. Add support for runtime detection (ENABLE_BRBE_FOR_NS=2), by splitting is_feat_brbe_present() into an ID register reading function and a second function to report the support status. That function considers both build time settings and runtime information (if needed), and is used before we access BRBE related registers. The FVP platform decided to compile in support unconditionally (=1), even though FEAT_BRBE is an ARMv9 feature, so is not available with the FVP model's default command line. Change that to the now supported dynamic option (=2), so the right decision can be made by the code at runtime. Change-Id: I5f2e2c9648300f65f0fa9a5f8e2f34e73529d053 Signed-off-by: Andre Przywara --- lib/el3_runtime/aarch64/context_mgmt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/el3_runtime') diff --git a/lib/el3_runtime/aarch64/context_mgmt.c b/lib/el3_runtime/aarch64/context_mgmt.c index 1dfb71f76..54e257b75 100644 --- a/lib/el3_runtime/aarch64/context_mgmt.c +++ b/lib/el3_runtime/aarch64/context_mgmt.c @@ -499,9 +499,9 @@ static void manage_extensions_nonsecure(bool el2_unused, cpu_context_t *ctx) trbe_enable(); } -#if ENABLE_BRBE_FOR_NS - brbe_enable(); -#endif /* ENABLE_BRBE_FOR_NS */ + if (is_feat_brbe_supported()) { + brbe_enable(); + } #if ENABLE_SYS_REG_TRACE_FOR_NS sys_reg_trace_enable(ctx); -- cgit v1.2.3