VHE: Add support for a VM to be EL0 partition
Added a boolean and updated VM initialization APIs to take a parameter
that indicates that a given VM is really an EL0 FF-A partition.
Note that it is odd to associate EL0 partitions with a VM, however, all
of hafnium code base deals with VMs and vCPUs and the path of least
resistance to support EL0 partitions (S-EL0 SPs mainly) is to model an
EL0 partition as a "lightweight" VM with 1 VCPU (since all S-EL0
partitions are UP migratable per the FF-A 1.0 spec).
While the FF-A spec really only calls out S-EL0 partitions, there is no
technical reason it cannot be supported in the normal world too.
However, the main expected use case for EL0 partitions in the normal
world would be for testing/verification.
Change-Id: I67cb85bed1f324704e0cc0766563839a07a949af
Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
diff --git a/src/manifest.c b/src/manifest.c
index 8883659..155a22d 100644
--- a/src/manifest.c
+++ b/src/manifest.c
@@ -676,6 +676,15 @@
ret_code = MANIFEST_ERROR_NOT_COMPATIBLE;
}
+ if (vm->sp.run_time_el == S_EL0 && vm->sp.execution_ctx_count != 1) {
+ dlog_error(
+ "Exception level and execution context count %s: %d "
+ "%d\n",
+ error_string, vm->sp.run_time_el,
+ vm->sp.execution_ctx_count);
+ ret_code = MANIFEST_ERROR_NOT_COMPATIBLE;
+ }
+
return ret_code;
}