pvmfw: Pass BCC to next stage through DT
Generate the next stage BCC in a heap-allocated page-aligned buffer that
our allocator leaks so that it outlives the execution of pvmfw and can
be accessed by the next stage. Flush the cache to ensure that it isn't
destroyed during invalidation (by the next stage) or missed if accessed
with the caches disabled.
Pass the size and location of the region through a pKVM-standard
device tree node.
Bug: 256827715
Test: atest MicrodroidHostTests
Change-Id: I5931054f74063eac3b3b21a6bcbe4881af2e1e8e
diff --git a/pvmfw/src/entry.rs b/pvmfw/src/entry.rs
index 52e7a22..bfcb423 100644
--- a/pvmfw/src/entry.rs
+++ b/pvmfw/src/entry.rs
@@ -250,6 +250,7 @@
crate::main(slices.fdt, slices.kernel, slices.ramdisk, &bcc, &mut memory)?;
helpers::flushed_zeroize(bcc_slice);
+ helpers::flush(slices.fdt.as_slice());
info!("Expecting a bug making MMIO_GUARD_UNMAP return NOT_SUPPORTED on success");
memory.mmio_unmap_all().map_err(|e| {