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/vm_test.cc b/src/vm_test.cc
index 4a0c119..6a9e109 100644
--- a/src/vm_test.cc
+++ b/src/vm_test.cc
@@ -66,7 +66,7 @@
struct_vm *vm;
struct vm_locked vm_locked;
- EXPECT_TRUE(vm_init_next(1, &ppool, &vm));
+ EXPECT_TRUE(vm_init_next(1, &ppool, &vm, false));
vm_locked = vm_lock(vm);
ASSERT_TRUE(mm_vm_init(&vm->ptable, &ppool));
EXPECT_TRUE(vm_unmap_hypervisor(vm_locked, &ppool));
@@ -92,7 +92,7 @@
* Insertion when no call to "vm_update_boot" has been made yet.
* The "boot_list" is expected to be empty.
*/
- EXPECT_TRUE(vm_init_next(1, &ppool, &vm_cur));
+ EXPECT_TRUE(vm_init_next(1, &ppool, &vm_cur, false));
vm_cur->boot_order = 1;
vm_update_boot(vm_cur);
expected_final_order.push_back(vm_cur);
@@ -100,7 +100,7 @@
EXPECT_EQ(vm_get_first_boot()->id, vm_cur->id);
/* Insertion at the head of the boot list */
- EXPECT_TRUE(vm_init_next(1, &ppool, &vm_cur));
+ EXPECT_TRUE(vm_init_next(1, &ppool, &vm_cur, false));
vm_cur->boot_order = 3;
vm_update_boot(vm_cur);
expected_final_order.push_back(vm_cur);
@@ -109,7 +109,7 @@
/* Insertion of two in the middle of the boot list */
for (int i = 0; i < 2; i++) {
- EXPECT_TRUE(vm_init_next(1, &ppool, &vm_cur));
+ EXPECT_TRUE(vm_init_next(1, &ppool, &vm_cur, false));
vm_cur->boot_order = 2;
vm_update_boot(vm_cur);
expected_final_order.push_back(vm_cur);