FF-A: Booting SPs according to 'boot-order'
Secure Hafnium boots partitions according to boot-order in the manifest.
In this patch:
- Added manifest parsing of "boot-order", and populated VM structure
with it;
- Added the field "next_boot" to the VM structure, in order to create a
boot list that is sorted by the "boot-order";
- The root of the list points to the highest priority VM;
- Booting consists on traversing the list upon use of MSG_WAIT
interface from the highest priority VMs;
- After traversing the whole boot list, returns execution to SPMD;
- "manifest_Test.cc" updated to include "boot-order" field in
tests to the partition manifest;
- "vm_test.cc" updated to include unit test for the main logic of this
patch.
Change-Id: I43adf90447eed3bc24c8eb2ccb8eb979b471f3c3
Signed-off-by: J-Alves <Joao.Alves@arm.com>
diff --git a/src/main.c b/src/main.c
index 8a495db..5f30aac 100644
--- a/src/main.c
+++ b/src/main.c
@@ -16,13 +16,19 @@
struct vcpu *cpu_main(struct cpu *c)
{
struct vcpu *vcpu;
+#if SECURE_WORLD == 1
+ struct vm *first_boot = vm_get_first_boot();
+ vcpu = vm_get_vcpu(first_boot, cpu_index(c));
+#else
vcpu = vm_get_vcpu(vm_find(HF_PRIMARY_VM_ID), cpu_index(c));
+#endif
+
vcpu->cpu = c;
arch_cpu_init();
- /* Reset the registers to give a clean start for the primary's vCPU. */
+ /* Reset the registers to give a clean start for vCPU. */
arch_regs_reset(vcpu);
return vcpu;