[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/fdt.rs b/pvmfw/src/fdt.rs
index 89d9457..a68cf3a 100644
--- a/pvmfw/src/fdt.rs
+++ b/pvmfw/src/fdt.rs
@@ -18,7 +18,6 @@
 use crate::cstr;
 use crate::helpers::RangeExt as _;
 use crate::helpers::GUEST_PAGE_SIZE;
-use crate::memory::BASE_ADDR;
 use crate::memory::MAX_ADDR;
 use crate::Box;
 use crate::RebootReason;
@@ -41,6 +40,7 @@
 use log::info;
 use log::warn;
 use tinyvec::ArrayVec;
+use vmbase::layout::crosvm::MEM_START;
 use vmbase::memory::SIZE_4KB;
 use vmbase::util::flatten;
 
@@ -115,8 +115,8 @@
 /// Check if memory range is ok
 fn validate_memory_range(range: &Range<usize>) -> Result<(), RebootReason> {
     let base = range.start;
-    if base != BASE_ADDR {
-        error!("Memory base address {:#x} is not {:#x}", base, BASE_ADDR);
+    if base != MEM_START {
+        error!("Memory base address {:#x} is not {:#x}", base, MEM_START);
         return Err(RebootReason::InvalidFdt);
     }
 
@@ -137,7 +137,7 @@
     let size = memory_range.len() as u64;
     fdt.node_mut(cstr!("/memory"))?
         .ok_or(FdtError::NotFound)?
-        .setprop_inplace(cstr!("reg"), flatten(&[BASE_ADDR.to_be_bytes(), size.to_be_bytes()]))
+        .setprop_inplace(cstr!("reg"), flatten(&[MEM_START.to_be_bytes(), size.to_be_bytes()]))
 }
 
 /// Read the number of CPUs from DT
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(),