summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArunachalam Ganapathy <arunachalam.ganapathy@arm.com>2023-05-18 10:57:29 +0100
committerSoby Mathew <soby.mathew@arm.com>2023-10-02 16:55:36 +0100
commitf92eb7e261bdaea54c10ad34451a7667a6eb4084 (patch)
tree14e93a263aaddda4bb052f5cfb3de8d010c3648b
parentcc933e1d12f55f3d9efd14ae2a29c5648a3ccf08 (diff)
feat(rmmd): enable SME for RMM
This patch enables Scalable Matrix Extension (SME) for RMM. RMM will save/restore required registers that are shared with SVE/FPU register state so that Realm can use FPU or SVE. The Relevant RMM support can be found here : https://github.com/TF-RMM/tf-rmm/commit/0ccd7ae58b00 Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com> Change-Id: I3bbdb840e7736dec00b71c85fcec3d5719413ffd
-rw-r--r--Makefile7
-rw-r--r--docs/getting_started/build-options.rst6
-rw-r--r--plat/arm/board/fvp/platform.mk2
-rw-r--r--services/std_svc/rmmd/rmmd_main.c11
4 files changed, 14 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 8e2fd8169..faef7286d 100644
--- a/Makefile
+++ b/Makefile
@@ -980,13 +980,6 @@ ifeq (${ARCH},aarch32)
endif
endif #(ARCH=aarch32)
-# Ensure ENABLE_RME is not used with SME
-ifeq (${ENABLE_RME},1)
- ifneq (${ENABLE_SME_FOR_NS},0)
- $(error "ENABLE_SME_FOR_NS cannot be used with ENABLE_RME")
- endif
-endif
-
ifneq (${ENABLE_SME_FOR_NS},0)
ifeq (${ENABLE_SVE_FOR_NS},0)
$(error "ENABLE_SME_FOR_NS requires ENABLE_SVE_FOR_NS")
diff --git a/docs/getting_started/build-options.rst b/docs/getting_started/build-options.rst
index 2c018c394..e440dbd40 100644
--- a/docs/getting_started/build-options.rst
+++ b/docs/getting_started/build-options.rst
@@ -452,9 +452,9 @@ Common build options
world to trap to EL3. Requires ``ENABLE_SVE_FOR_NS`` to be set as SME is a
superset of SVE. SME is an optional architectural feature for AArch64
and TF-A support is experimental. At this time, this build option cannot be
- used on systems that have SPD=spmd/SPM_MM or ENABLE_RME, and attempting to
- build with these options will fail. This flag can take the values 0 to 2, to
- align with the ``FEATURE_DETECTION`` mechanism. Default is 0.
+ used on systems that have SPD=spmd/SPM_MM and atempting to build with this
+ option will fail. This flag can take the values 0 to 2, to align with the
+ ``FEATURE_DETECTION`` mechanism. Default is 0.
- ``ENABLE_SME2_FOR_NS``: Numeric value to enable Scalable Matrix Extension
version 2 (SME2) for the non-secure world only. SME2 is an optional
diff --git a/plat/arm/board/fvp/platform.mk b/plat/arm/board/fvp/platform.mk
index 4803f3503..3c02485f6 100644
--- a/plat/arm/board/fvp/platform.mk
+++ b/plat/arm/board/fvp/platform.mk
@@ -58,7 +58,6 @@ ifneq (${SPD}, tspd)
ifeq (${ARCH}, aarch64)
ifneq (${SPD}, spmd)
ifeq (${SPM_MM}, 0)
-ifeq (${ENABLE_RME}, 0)
ifeq (${CTX_INCLUDE_FPREGS}, 0)
ENABLE_SME_FOR_NS := 2
ENABLE_SME2_FOR_NS := 2
@@ -67,7 +66,6 @@ endif
endif
endif
endif
-endif
# enable unconditionally for all builds
ifeq (${ARCH}, aarch64)
diff --git a/services/std_svc/rmmd/rmmd_main.c b/services/std_svc/rmmd/rmmd_main.c
index a929ea282..b809f563d 100644
--- a/services/std_svc/rmmd/rmmd_main.c
+++ b/services/std_svc/rmmd/rmmd_main.c
@@ -30,6 +30,7 @@
#include <platform_def.h>
#include <services/rmmd_svc.h>
#include <smccc_helpers.h>
+#include <lib/extensions/sme.h>
#include <lib/extensions/sve.h>
#include "rmmd_initial_context.h"
#include "rmmd_private.h"
@@ -134,6 +135,16 @@ static void manage_extensions_realm(cpu_context_t *ctx)
}
pmuv3_enable(ctx);
+
+ /*
+ * If SME/SME2 is supported and enabled for NS world, then enables SME
+ * for Realm world. RMM will save/restore required registers that are
+ * shared with SVE/FPU so that Realm can use FPU or SVE.
+ */
+ if (is_feat_sme_supported()) {
+ /* sme_enable() also enables SME2 if supported by hardware */
+ sme_enable(ctx);
+ }
}
/*******************************************************************************