summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArunachalam Ganapathy <arunachalam.ganapathy@arm.com>2023-05-23 13:28:38 +0100
committerArunachalam Ganapathy <arunachalam.ganapathy@arm.com>2023-10-31 13:56:54 +0000
commit1768e59c3a6ac8d727ac012719b4b09947c8400d (patch)
treecc6ad04618bb60fb861bf3e7e4da2538c1a5cf42 /include
parent5b68e20b2a0c9ac70caa2dd833d48f5fd49aa581 (diff)
feat(rme): add tests to check NS SME ID registers and configurations
These tests checks the functionality of RMM for NS SME support. - Create Realm and test ID registers specific to SME - Check if Realm gets undefined abort when it accesses SME - Check whether RMM preserves NS SMCR_EL2 register Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com> Change-Id: Ia8ffd0188297a74c095dbadfb389add50c548e10
Diffstat (limited to 'include')
-rw-r--r--include/lib/aarch64/arch.h6
-rw-r--r--include/runtime_services/host_realm_managment/host_realm_simd.h (renamed from include/runtime_services/host_realm_managment/host_realm_sve.h)11
-rw-r--r--include/runtime_services/host_realm_managment/host_shared_data.h4
3 files changed, 17 insertions, 4 deletions
diff --git a/include/lib/aarch64/arch.h b/include/lib/aarch64/arch.h
index 13d7063..0c64e40 100644
--- a/include/lib/aarch64/arch.h
+++ b/include/lib/aarch64/arch.h
@@ -408,6 +408,7 @@
#define ID_AA64PFR1_EL1_SME_SHIFT U(24)
#define ID_AA64PFR1_EL1_SME_MASK ULL(0xf)
+#define ID_AA64PFR1_EL1_SME_WIDTH ULL(0x4)
#define ID_AA64PFR1_EL1_SME_NOT_SUPPORTED ULL(0x0)
#define ID_AA64PFR1_EL1_SME_SUPPORTED ULL(0x1)
#define ID_AA64PFR1_EL1_SME2_SUPPORTED ULL(0x2)
@@ -477,6 +478,11 @@
#define CPACR_EL1_ZEN_TRAP_ALL U(0x2)
#define CPACR_EL1_ZEN_TRAP_NONE U(0x3)
+#define CPACR_EL1_SMEN(x) ((x) << 24)
+#define CPACR_EL1_SMEN_TRAP_EL0 U(0x1)
+#define CPACR_EL1_SMEN_TRAP_ALL U(0x2)
+#define CPACR_EL1_SMEN_TRAP_NONE U(0x3)
+
/* SCR definitions */
#define SCR_RES1_BITS ((U(1) << 4) | (U(1) << 5))
#define SCR_AMVOFFEN_BIT (UL(1) << 35)
diff --git a/include/runtime_services/host_realm_managment/host_realm_sve.h b/include/runtime_services/host_realm_managment/host_realm_simd.h
index 8ec4cd7..9680a96 100644
--- a/include/runtime_services/host_realm_managment/host_realm_sve.h
+++ b/include/runtime_services/host_realm_managment/host_realm_simd.h
@@ -3,8 +3,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
-#ifndef HOST_REALM_SVE_H
-#define HOST_REALM_SVE_H
+#ifndef HOST_REALM_SIMD_H
+#define HOST_REALM_SIMD_H
#include <stdint.h>
@@ -21,4 +21,9 @@ struct sve_cmd_probe_vl {
uint32_t vl_bitmap;
};
-#endif /* HOST_REALM_SVE_H */
+struct sme_cmd_id_regs {
+ uint64_t id_aa64pfr1_el1;
+ uint64_t id_aa64smfr0_el1;
+};
+
+#endif /* HOST_REALM_SIMD_H */
diff --git a/include/runtime_services/host_realm_managment/host_shared_data.h b/include/runtime_services/host_realm_managment/host_shared_data.h
index b561fc5..0a8ab4a 100644
--- a/include/runtime_services/host_realm_managment/host_shared_data.h
+++ b/include/runtime_services/host_realm_managment/host_shared_data.h
@@ -59,7 +59,9 @@ enum realm_cmd {
REALM_SVE_UNDEF_ABORT,
REALM_PAUTH_SET_CMD,
REALM_PAUTH_CHECK_CMD,
- REALM_PAUTH_FAULT
+ REALM_PAUTH_FAULT,
+ REALM_SME_ID_REGISTERS,
+ REALM_SME_UNDEF_ABORT
};
/*