feat(lib/arch): add support for simd context

This change introduces SIMD context that holds the SIMD specific config
registers, vector registers and its status flags. This context can
represent the state of FPU/SVE registers of a Non-secure world or of a
Realm world.

The SIMD layer exposes APIs to runtime component of RMM to initialize,
save, restore, and switch SIMD context.

Signed-off-by: Arunachalam Ganapathy <arunachalam.ganapathy@arm.com>
Change-Id: I0f78a3fdeeb13e0d05f5a51755962dfaa720ff68
diff --git a/runtime/core/init.c b/runtime/core/init.c
index a91505a..a491156 100644
--- a/runtime/core/init.c
+++ b/runtime/core/init.c
@@ -8,6 +8,7 @@
 #include <buffer.h>
 #include <debug.h>
 #include <rmm_el3_ifc.h>
+#include <run.h>
 #include <simd.h>
 #include <smc-rmi.h>
 #include <smc-rsi.h>
@@ -34,8 +35,6 @@
 	write_mdcr_el2(MDCR_EL2_INIT |
 			INPLACE(MDCR_EL2_HPMN,
 			EXTRACT(PMCR_EL0_N, read_pmcr_el0())));
-
-	simd_init();
 }
 
 void rmm_warmboot_main(void)
@@ -89,8 +88,13 @@
 
 	rmm_warmboot_main();
 
+	simd_init();
+
+	/* Initialize the NS SIMD context for all CPUs */
+	init_all_cpus_ns_simd_context();
+
 #ifdef RMM_FPU_USE_AT_REL2
-	simd_save_ns_state();
+	simd_context_save(get_cpu_ns_simd_context());
 #endif
 	if (attestation_init() != 0) {
 		WARN("Attestation init failed.\n");
@@ -100,6 +104,6 @@
 	 * TODO: Do not save and restore NS state. Instead after
 	 * attestation_init clear FPU state.
 	 */
-	simd_restore_ns_state();
+	simd_context_restore(get_cpu_ns_simd_context());
 #endif
 }