arch: Refactor GIC code to seperate KVM specific code

Shrink GICDevice trait to contain hypervisor agnostic API's only, which
are used in generating FDT.
Move all KVM specific logic into KvmGICDevice trait.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
Michael Zhao
2020-07-16 14:10:59 +08:00
committed by Samuel Ortiz
parent 6e8c8991d9
commit e3e771727a
7 changed files with 485 additions and 456 deletions
+2 -2
View File
@@ -148,8 +148,8 @@ pub fn configure_system<T: DeviceInfoForFDT + Clone + Debug>(
// If pci_space_address is present, it means PCI devices are used ("pci" feature enabled).
// Then GITv3-ITS is required for MSI messaging.
// Otherwise ("mmio" feature enabled), any version of GIC is OK.
let gic_device =
gic::create_gic(vm, vcpu_count, pci_space_address.is_some()).map_err(Error::SetupGIC)?;
let gic_device = gic::kvm::create_gic(vm, vcpu_count, pci_space_address.is_some())
.map_err(Error::SetupGIC)?;
fdt::create_fdt(
guest_mem,