vmbase: Support 16KiB MMIO_GUARD granule
Now that the MMIO_GUARD sharing/unsharing is decoupled from the page
tables, add support for 16KiB (and possibly beyond) by getting rid of
the hard-coded assumption that MMIO_GUARD happens with 4KiB granularity
by expecting potentially more than one page fault per MMIO_GUARD region
with MMIO lazy mapping.
Address the special case of the UART separately (see comment there).
Remove the now-obsolete hard-coded MMIO_GUARD_GRANULE_SIZE.
Bug: 336563593
Test: m libpvmfw libvmbase_example librialto
Change-Id: I5d8e169d9c2ad022208de3d33f346f5034d13393
diff --git a/vmbase/src/memory.rs b/vmbase/src/memory.rs
index 2f72fc4..299d50f 100644
--- a/vmbase/src/memory.rs
+++ b/vmbase/src/memory.rs
@@ -26,8 +26,8 @@
handle_permission_fault, handle_translation_fault, MemoryRange, MemoryTracker, MEMORY,
};
pub use util::{
- flush, flushed_zeroize, min_dcache_line_size, page_4kb_of, PAGE_SIZE, SIZE_128KB, SIZE_2MB,
- SIZE_4KB, SIZE_4MB, SIZE_64KB,
+ flush, flushed_zeroize, min_dcache_line_size, page_4kb_of, PAGE_SIZE, SIZE_128KB, SIZE_16KB,
+ SIZE_2MB, SIZE_4KB, SIZE_4MB, SIZE_64KB,
};
pub(crate) use shared::{alloc_shared, dealloc_shared};