[rialto] Adjust FDT size in initialization
And also:
- Add the FDT_SIZE const to vmbase.
- Reuse the const in both rialto and pvmfw.
No behavior change for pvmfw.
Bug: 284462758
Test: atest rialto_test
Test: m pvmfw_img
Change-Id: I39700d9c87bb1edf71a5a8006fc8d0851c2e183a
diff --git a/pvmfw/src/entry.rs b/pvmfw/src/entry.rs
index 96855f2..3a870ab 100644
--- a/pvmfw/src/entry.rs
+++ b/pvmfw/src/entry.rs
@@ -36,7 +36,7 @@
console,
layout::{self, crosvm},
logger, main,
- memory::{min_dcache_line_size, MemoryTracker, MEMORY, SIZE_2MB, SIZE_4KB},
+ memory::{min_dcache_line_size, MemoryTracker, MEMORY, SIZE_4KB},
power::reboot,
};
use zeroize::Zeroize;
@@ -89,7 +89,7 @@
impl<'a> MemorySlices<'a> {
fn new(fdt: usize, kernel: usize, kernel_size: usize) -> Result<Self, RebootReason> {
// SAFETY - SIZE_2MB is non-zero.
- const FDT_SIZE: NonZeroUsize = unsafe { NonZeroUsize::new_unchecked(SIZE_2MB) };
+ const FDT_SIZE: NonZeroUsize = unsafe { NonZeroUsize::new_unchecked(crosvm::FDT_MAX_SIZE) };
// TODO - Only map the FDT as read-only, until we modify it right before jump_to_payload()
// e.g. by generating a DTBO for a template DT in main() and, on return, re-map DT as RW,
// overwrite with the template DT and apply the DTBO.