Remove MM_MODE_NOINVALIDATE.
This flag exists to avoid paying the cost required for consistency when
consistency is not required. It was used for stage-2 allocation when the
VMs are initially being created i.e. there is a point before which all
stage-2 updates don't invalidate and after which they do. Given this, it
can move to the same approach used by the locks for dlog and mpool
allowing the mode clutter to be removed from where is doesn't belong.
Change-Id: I9be9e42c1daaf8570d7555bb3f37876aa7c3bd51
diff --git a/src/load.c b/src/load.c
index 38159a0..a9c0e5d 100644
--- a/src/load.c
+++ b/src/load.c
@@ -52,7 +52,7 @@
memcpy(ptr, from, size);
arch_mm_write_back_dcache(ptr, size);
- mm_unmap(to, to_end, 0, ppool);
+ mm_unmap(to, to_end, ppool);
return true;
}
@@ -147,15 +147,12 @@
if (!mm_vm_identity_map(
&vm->ptable, pa_init(0),
pa_init(UINT64_C(1024) * 1024 * 1024 * 1024),
- MM_MODE_R | MM_MODE_W | MM_MODE_X |
- MM_MODE_NOINVALIDATE,
- NULL, ppool)) {
+ MM_MODE_R | MM_MODE_W | MM_MODE_X, NULL, ppool)) {
dlog("Unable to initialise memory for primary vm\n");
return false;
}
- if (!mm_vm_unmap_hypervisor(&vm->ptable, MM_MODE_NOINVALIDATE,
- ppool)) {
+ if (!mm_vm_unmap_hypervisor(&vm->ptable, ppool)) {
dlog("Unable to unmap hypervisor from primary vm\n");
return false;
}
@@ -331,14 +328,12 @@
/* Grant VM access to uart. */
mm_vm_identity_map(&vm->ptable, pa_init(PL011_BASE),
pa_add(pa_init(PL011_BASE), PAGE_SIZE),
- MM_MODE_R | MM_MODE_W | MM_MODE_NOINVALIDATE,
- NULL, ppool);
+ MM_MODE_R | MM_MODE_W, NULL, ppool);
/* Grant the VM access to the memory. */
if (!mm_vm_identity_map(&vm->ptable, secondary_mem_begin,
secondary_mem_end,
- MM_MODE_R | MM_MODE_W | MM_MODE_X |
- MM_MODE_NOINVALIDATE,
+ MM_MODE_R | MM_MODE_W | MM_MODE_X,
&secondary_entry, ppool)) {
dlog("Unable to initialise memory\n");
continue;
@@ -346,8 +341,7 @@
/* Deny the primary VM access to this memory. */
if (!mm_vm_unmap(&primary->ptable, secondary_mem_begin,
- secondary_mem_end, MM_MODE_NOINVALIDATE,
- ppool)) {
+ secondary_mem_end, ppool)) {
dlog("Unable to unmap secondary VM from primary VM\n");
return false;
}