From 45007acd46981b9f289f03b283eb53e7ba37bb67 Mon Sep 17 00:00:00 2001 From: Jayanth Dodderi Chidanand Date: Mon, 6 Mar 2023 23:56:14 +0000 Subject: feat(cpufeat): enable FEAT_SME for FEAT_STATE_CHECKED Add support for runtime detection (ENABLE_SME_FOR_NS=2), by splitting feat_sme_supported() 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 do SME specific setup. Change the FVP platform default to the now supported dynamic option (=2),so the right decision can be made by the code at runtime. Change-Id: Ida9ccf737db5be20865b84f42b1f9587be0626ab Signed-off-by: Jayanth Dodderi Chidanand --- lib/el3_runtime/aarch64/context_mgmt.c | 7 ++++--- 1 file changed, 4 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 12f3e6d03..7fbbd8171 100644 --- a/lib/el3_runtime/aarch64/context_mgmt.c +++ b/lib/el3_runtime/aarch64/context_mgmt.c @@ -489,10 +489,11 @@ static void manage_extensions_nonsecure(bool el2_unused, cpu_context_t *ctx) amu_enable(el2_unused, ctx); } -#if ENABLE_SME_FOR_NS /* Enable SME, SVE, and FPU/SIMD for non-secure world. */ - sme_enable(ctx); -#elif ENABLE_SVE_FOR_NS + if (is_feat_sme_supported()) { + sme_enable(ctx); + } +#if ENABLE_SVE_FOR_NS /* Enable SVE and FPU/SIMD for non-secure world. */ sve_enable(ctx); #endif -- cgit v1.2.3