Refactor main entry

vm_get_first_boot returns the PVM in the normal world or the
first booted SP in the secure world. The intent is that primary,
secondary physical core cold boot and CPU off resume into the
pinned vCPU from the first VM. This assumes the PVM in normal
world is the first booted VM.

Change-Id: I3f3833e2e9f1c278df8f5d480a3b16799012dd32
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/src/load.c b/src/load.c
index 660d77c..7accc65 100644
--- a/src/load.c
+++ b/src/load.c
@@ -286,6 +286,9 @@
 	dlog_info("Loaded primary VM with %u vCPUs, entry at %#x.\n",
 		  vm->vcpu_count, pa_addr(primary_begin));
 
+	/* Mark the primary to be the first booted VM */
+	vm_update_boot(vm);
+
 	vcpu_locked = vcpu_lock(vm_get_vcpu(vm, 0));
 	vcpu_on(vcpu_locked, primary_entry, params->kernel_arg);
 	vcpu_unlock(&vcpu_locked);