[vmbase] Add crosvm layout constant MEM_START to vmbase
And uses it in pvmfw.
Other layout constants will be added in subsequent cls.
Bug: 284462758
Test: m pvmfw_img
Change-Id: If17f9a8da381cbdb2b13e0eb8be0bd409035eea9
diff --git a/pvmfw/src/memory.rs b/pvmfw/src/memory.rs
index 323ac74..30c11eb 100644
--- a/pvmfw/src/memory.rs
+++ b/pvmfw/src/memory.rs
@@ -37,7 +37,8 @@
use spin::mutex::SpinMutex;
use tinyvec::ArrayVec;
use vmbase::{
- dsb, isb, layout,
+ dsb, isb,
+ layout::{self, crosvm::MEM_START},
memory::{
flush_dirty_range, is_leaf_pte, page_4kb_of, set_dbm_enabled, MemorySharer, PageTable,
MMIO_LAZY_MAP_FLAG, SIZE_2MB, SIZE_4KB, SIZE_4MB,
@@ -46,8 +47,6 @@
util::align_up,
};
-/// Base of the system's contiguous "main" memory.
-pub const BASE_ADDR: usize = 0x8000_0000;
/// First address that can't be translated by a level 1 TTBR0_EL1.
pub const MAX_ADDR: usize = 1 << 40;
@@ -148,7 +147,7 @@
impl MemoryTracker {
const CAPACITY: usize = 5;
const MMIO_CAPACITY: usize = 5;
- const PVMFW_RANGE: MemoryRange = (BASE_ADDR - SIZE_4MB)..BASE_ADDR;
+ const PVMFW_RANGE: MemoryRange = (MEM_START - SIZE_4MB)..MEM_START;
/// Create a new instance from an active page table, covering the maximum RAM size.
pub fn new(mut page_table: PageTable) -> Self {
@@ -164,7 +163,7 @@
debug!("... Success!");
Self {
- total: BASE_ADDR..MAX_ADDR,
+ total: MEM_START..MAX_ADDR,
page_table,
regions: ArrayVec::new(),
mmio_regions: ArrayVec::new(),