mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
linux: Reserve direct mmio in mmio allocator
Direct mmio range couldn't be assigned to any device, so this commit exclude them from mmio allocator before build_vm(). BUG=None TEST=tools/presubimt and boot manatee Change-Id: I71414de1d44545e2c490ce75f5ced5545752858f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3605163 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
parent
496bcbe8bf
commit
3be45af929
1 changed files with 16 additions and 0 deletions
|
@ -1310,6 +1310,22 @@ where
|
|||
irqs.push(direct_irq);
|
||||
}
|
||||
|
||||
// Reserve direct mmio range in advance.
|
||||
#[cfg(feature = "direct")]
|
||||
if let Some(mmio) = &cfg.direct_mmio {
|
||||
for range in mmio.ranges.iter() {
|
||||
sys_allocator
|
||||
.reserve_mmio(range.base, range.len)
|
||||
.with_context(|| {
|
||||
format!(
|
||||
"failed to reserved direct mmio: {:x}-{:x}",
|
||||
range.base,
|
||||
range.base + range.len - 1,
|
||||
)
|
||||
})?;
|
||||
}
|
||||
};
|
||||
|
||||
let mut iommu_attached_endpoints: BTreeMap<u32, Arc<Mutex<Box<dyn MemoryMapperTrait>>>> =
|
||||
BTreeMap::new();
|
||||
let mut iova_max_addr: Option<u64> = None;
|
||||
|
|
Loading…
Reference in a new issue