From fc259b6c3a551efbc810c8e08e82b7b5378f57ba Mon Sep 17 00:00:00 2001 From: Jayanth Dodderi Chidanand Date: Fri, 31 Mar 2023 10:42:10 +0100 Subject: [PATCH] fix(qemu): enable dynamic feature detection of FEAT_SVE for NormalWorld Currently, TF-A supports three states for feature flags: 0: FEAT_DISABLED 1: FEAT_STATE_ALWAYS ( for fixed/real platforms) 2: FEAT_STATE_CHECK ( for configurable platforms) to meet the feature detection requirements dynamically, mainly targetting configurable/Fixed Virtual platforms. With this mechanism in place, we are refactoring all the existing feature flags to the FEAT_STATE_CHECK option(=2), including FEAT_SVE explicitly for FVPs. SVE Patch Reference: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/19888/25 This newly introduced change, breaks the existing behaviour especially for virtual platforms, who have set the ENABLE_SVE_FOR_NS flag to 1. Moving ahead, we advise the platforms to take the following steps while enabling the features: 1. If the platform is configurable (virtual), and want to ensure feature detection happens dynamically at runtime, set the build flags to FEAT_STATE_CHECK(=2). 2. For real(fixed) platforms, depending on the features supported by the hardware and platform wants to enable it, platforms could set build flags to FEAT_STATE_ALWAYS(=1). (Note: Only the non-secure world enablement related build flags have been refactored to take the values within 0 to 2. As earlier Secure world enablement flags will still remain boolean.) Henceforth, in order to keep it aligned with this tri-state mechanism, changing the qemu platform default to the now supported dynamic option(=2), so the right decision can be made by the code at runtime. Change-Id: Icc95b8b872378b7874d4345b631adfc314e4dada Signed-off-by: Jayanth Dodderi Chidanand --- plat/qemu/qemu/platform.mk | 6 +++--- plat/qemu/qemu_sbsa/platform.mk | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plat/qemu/qemu/platform.mk b/plat/qemu/qemu/platform.mk index c076aba0d..3a0e1c017 100644 --- a/plat/qemu/qemu/platform.mk +++ b/plat/qemu/qemu/platform.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2013-2022, ARM Limited and Contributors. All rights reserved. +# Copyright (c) 2013-2023, Arm Limited and Contributors. All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause # @@ -306,8 +306,8 @@ ENABLE_FEAT_RNG := 2 # Later QEMU versions support SME and SVE. ifneq (${ARCH},aarch32) - ENABLE_SVE_FOR_NS := 1 - ENABLE_SME_FOR_NS := 1 + ENABLE_SVE_FOR_NS := 2 + ENABLE_SME_FOR_NS := 2 endif qemu_fw.bios: bl1 fip diff --git a/plat/qemu/qemu_sbsa/platform.mk b/plat/qemu/qemu_sbsa/platform.mk index fec83db56..7b3129c3b 100644 --- a/plat/qemu/qemu_sbsa/platform.mk +++ b/plat/qemu/qemu_sbsa/platform.mk @@ -137,5 +137,5 @@ ARM_PRELOADED_DTB_BASE := PLAT_QEMU_DT_BASE $(eval $(call add_define,ARM_PRELOADED_DTB_BASE)) # Later QEMU versions support SME and SVE. -ENABLE_SVE_FOR_NS := 1 -ENABLE_SME_FOR_NS := 1 +ENABLE_SVE_FOR_NS := 2 +ENABLE_SME_FOR_NS := 2 -- 2.39.5