feat: initialize page tables for enforcing dma isolation
SPMC maintains two sets of dedicated page tables for each partition
to enforce dma isolation.
Depending on the number of DMA devices assigned to a specific
partition, the corresponding set of page tables are initialized.
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
Change-Id: I1f97876cc80de29cb938e62fbe695c29a8af104b
diff --git a/src/load.c b/src/load.c
index 59c3f1c..352bab4 100644
--- a/src/load.c
+++ b/src/load.c
@@ -322,7 +322,8 @@
}
}
- if (!vm_init_next(MAX_CPUS, ppool, &vm, false)) {
+ if (!vm_init_next(MAX_CPUS, ppool, &vm, false,
+ manifest_vm->partition.dma_device_count)) {
dlog_error("Unable to initialise primary VM.\n");
return false;
}
@@ -706,7 +707,8 @@
CHECK(!is_el0_partition || manifest_vm->secondary.vcpu_count == 1);
if (!vm_init_next(manifest_vm->secondary.vcpu_count, ppool, &vm,
- is_el0_partition)) {
+ is_el0_partition,
+ manifest_vm->partition.dma_device_count)) {
dlog_error("Unable to initialise VM.\n");
return false;
}
@@ -913,7 +915,7 @@
* -TrustZone (or the SPMC) when running the Hypervisor
* -the Hypervisor when running TZ/SPMC
*/
- other_world_vm = vm_init(HF_OTHER_WORLD_ID, MAX_CPUS, ppool, false);
+ other_world_vm = vm_init(HF_OTHER_WORLD_ID, MAX_CPUS, ppool, false, 0);
CHECK(other_world_vm != NULL);
for (i = 0; i < MAX_CPUS; i++) {