mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
devices: gic: use VgicConfig everywhere
Use VgicConfig to initialize Vgic. Use Gic::create_default_config everywhere so we don't always recompute redist/msi registers. Add a helper create_test_vgic_config for tests in hypervisor crate. Signed-off-by: Nuno Das Neves <nudasnev@microsoft.com>
This commit is contained in:
committed by
Rob Bradford
parent
a832033531
commit
784a3aaf3c
@@ -1205,11 +1205,11 @@ impl DeviceManager {
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
{
|
||||
let vcpus = self.config.lock().unwrap().cpus.boot_vcpus;
|
||||
let msi_start = arch::layout::GIC_V3_DIST_START.raw_value()
|
||||
- arch::layout::GIC_V3_REDIST_SIZE * (vcpus as u64)
|
||||
- arch::layout::GIC_V3_ITS_SIZE;
|
||||
let msi_end = msi_start + arch::layout::GIC_V3_ITS_SIZE - 1;
|
||||
(msi_start, msi_end)
|
||||
let vgic_config = gic::Gic::create_default_config(vcpus.into());
|
||||
(
|
||||
vgic_config.msi_addr,
|
||||
vgic_config.msi_addr + vgic_config.msi_size - 1,
|
||||
)
|
||||
}
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
(0xfee0_0000, 0xfeef_ffff)
|
||||
|
||||
Reference in New Issue
Block a user