test(spm): check processor feature regs
For cactus secure partitions, check ID registers report:
-FPU/Adv. SIMD supported.
-SVE/SME not supported.
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: Iba3508d57a8bcb1f554adddef97c4c83f4118a03
diff --git a/spm/common/sp_tests/sp_test_cpu.c b/spm/common/sp_tests/sp_test_cpu.c
new file mode 100644
index 0000000..a05dbf3
--- /dev/null
+++ b/spm/common/sp_tests/sp_test_cpu.c
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2024, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <sp_helpers.h>
+
+#include <arch_features.h>
+
+static void cpu_check_id_regs(void)
+{
+ /* ID_AA64PFR0_EL1 */
+ EXPECT(is_feat_advsimd_present(), true);
+ EXPECT(is_feat_fp_present(), true);
+ EXPECT(is_armv8_2_sve_present(), false);
+
+ /* ID_AA64PFR1_EL1 */
+ EXPECT(is_feat_sme_supported(), false);
+}
+
+void cpu_feature_tests(void)
+{
+ const char *test_cpu_str = "CPU tests";
+
+ announce_test_section_start(test_cpu_str);
+ cpu_check_id_regs();
+ announce_test_section_end(test_cpu_str);
+}