[pvmfw][vmbase] Add constant PAGE_SIZE to vmbase
This cl adds a constant PAGE_SIZE of 4 KiB to vmbase and uses it
in pvmfw and rialto. Later it will be used as the page size in
the MemoryTracker for both pvmfw and rialto.
Bug: 284462758
Test: m pvmfw_img
Change-Id: I5b23f2571a3df81aa824f6f60e94b326fb1e225f
diff --git a/rialto/src/main.rs b/rialto/src/main.rs
index 30bc5b0..77044a2 100644
--- a/rialto/src/main.rs
+++ b/rialto/src/main.rs
@@ -29,10 +29,13 @@
use fdtpci::PciInfo;
use hyp::get_hypervisor;
use log::{debug, error, info};
-use vmbase::{layout, main, memory::PageTable, power::reboot};
+use vmbase::{
+ layout, main,
+ memory::{PageTable, PAGE_SIZE},
+ power::reboot,
+};
const SZ_1K: usize = 1024;
-const SZ_4K: usize = 4 * SZ_1K;
const SZ_64K: usize = 64 * SZ_1K;
const SZ_1M: usize = 1024 * SZ_1K;
const SZ_1G: usize = 1024 * SZ_1M;
@@ -60,7 +63,7 @@
// The first 1 GiB of address space is used by crosvm for MMIO.
page_table.map_device(&(0..SZ_1G))?;
page_table.map_data(&layout::scratch_range())?;
- page_table.map_data(&layout::stack_range(40 * SZ_4K))?;
+ page_table.map_data(&layout::stack_range(40 * PAGE_SIZE))?;
page_table.map_code(&layout::text_range())?;
page_table.map_rodata(&layout::rodata_range())?;
page_table.map_device(&layout::console_uart_range())?;