From 13cc1aa70a666bc8f768569e5481b3daf499b7d1 Mon Sep 17 00:00:00 2001 From: Shruti Gupta Date: Mon, 15 May 2023 14:43:57 +0100 Subject: [PATCH] feat(rme): save PAuth context when RME is enabled This patch enables CTX_INCLUDE_PAUTH_REGS for RME builds. The RMM-EL3 specification is also updated to reflect the changes and also version of the same is bumped from 0.1 to 0.2. Signed-off-by: Shruti Gupta Change-Id: I2e96a592d2b75abaee24294240c1727c5ceba420 --- Makefile | 2 +- docs/components/rmm-el3-comms-spec.rst | 13 +++++++++---- include/services/rmmd_svc.h | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1a802447a..54b792809 100644 --- a/Makefile +++ b/Makefile @@ -152,7 +152,7 @@ ARM_ARCH_MAJOR := 8 ARM_ARCH_MINOR := 5 ENABLE_FEAT_ECV = 1 ENABLE_FEAT_FGT = 1 - +CTX_INCLUDE_PAUTH_REGS := 1 # RME enables CSV2_2 extension by default. ENABLE_FEAT_CSV2_2 = 1 diff --git a/docs/components/rmm-el3-comms-spec.rst b/docs/components/rmm-el3-comms-spec.rst index 6b57c0e1f..009ac28c2 100644 --- a/docs/components/rmm-el3-comms-spec.rst +++ b/docs/components/rmm-el3-comms-spec.rst @@ -52,7 +52,7 @@ are explained below: - ``RES0``: Bit 31 of the version number is reserved 0 as to maintain consistency with the versioning schemes used in other parts of RMM. -This document specifies the 0.1 version of Boot Interface ABI and RMM-EL3 +This document specifies the 0.2 version of Boot Interface ABI and RMM-EL3 services specification and the 0.2 version of the Boot Manifest. .. _rmm_el3_boot_interface: @@ -503,6 +503,10 @@ As per SMCCCv1.2, x4 must be preserved if not being used as return argument by t and it is the responsibility of RMM to preserve this or use this as a return argument. EL3 will always copy x0-x4 from Realm context to NS Context. +EL3 must save and restore the following as part of world switch: + #. EL2 system registers with the exception of ``zcr_el2`` register. + #. PAuth key registers (APIA, APIB, APDA, APDB, APGA). + EL3 will not save some registers as mentioned in the below list. It is the responsibility of RMM to ensure that these are appropriately saved if the Realm World makes use of them: @@ -510,10 +514,11 @@ Realm World makes use of them: #. FP/SIMD registers #. SVE registers #. SME registers - #. EL1/0 registers + #. EL1/0 registers with the exception of PAuth key registers as mentioned above. + #. zcr_el2 register. -It is the responsibility of EL3 that any other registers other than the ones mentioned above -will not be leaked to the NS Host and to maintain the confidentiality of the Realm World. +It is essential that EL3 honors this contract to maintain the Confidentiality and integrity +of the Realm world. SMCCC v1.3 allows NS world to specify whether SVE context is in use. In this case, RMM could choose to not save the incoming SVE context but must ensure diff --git a/include/services/rmmd_svc.h b/include/services/rmmd_svc.h index de7181c85..55d778e43 100644 --- a/include/services/rmmd_svc.h +++ b/include/services/rmmd_svc.h @@ -152,7 +152,7 @@ * Increase this when a bug is fixed, or a feature is added without * breaking compatibility. */ -#define RMM_EL3_IFC_VERSION_MINOR (U(1)) +#define RMM_EL3_IFC_VERSION_MINOR (U(2)) #define RMM_EL3_INTERFACE_VERSION \ (((RMM_EL3_IFC_VERSION_MAJOR << 16) & 0x7FFFF) | \