pvmfw: Apply VM DTBO
This CL only applies assigned VM DTBO for the simplest case, which
iommu, phandle, nor aliases aren't involved.
Next CLs will handle following cases:
- Apply iommu. Platform DT will be also updated to have pre-populated
pvmiommu node
- Validate patched values (reg, iommu, ..)
- Handle __local_fixup__, __fixups__ (i.e. handle phandle in VM DTBO)
- Handle /alias in VM DTBO
- ...
Bug: 277993056
Test: atest libpvmfw.device_assignment.test, launch protected VM
Change-Id: I4e4aea0885da925ae419921d729380a1d71707e0
diff --git a/pvmfw/src/config.rs b/pvmfw/src/config.rs
index 78b6323..7023b95 100644
--- a/pvmfw/src/config.rs
+++ b/pvmfw/src/config.rs
@@ -260,7 +260,7 @@
}
/// Get slice containing the platform BCC.
- pub fn get_entries(&mut self) -> (&mut [u8], Option<&mut [u8]>) {
+ pub fn get_entries(&mut self) -> (&mut [u8], Option<&mut [u8]>, Option<&mut [u8]>) {
// This assumes that the blobs are in-order w.r.t. the entries.
let bcc_range = self.get_entry_range(Entry::Bcc);
let dp_range = self.get_entry_range(Entry::DebugPolicy);
@@ -277,6 +277,7 @@
(
Self::from_raw_range_mut(ptr, bcc_range.unwrap()),
dp_range.map(|dp_range| Self::from_raw_range_mut(ptr, dp_range)),
+ vm_dtbo_range.map(|vm_dtbo_range| Self::from_raw_range_mut(ptr, vm_dtbo_range)),
)
}
}