pci: vfio: Implement INTx support

With all the preliminary work done in the previous commits, we can
update the VFIO implementation to support INTx along with MSI and MSI-X.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2021-02-09 11:51:49 +01:00
committed by Rob Bradford
parent 2cdc3e3546
commit 19167e7647
3 changed files with 186 additions and 55 deletions

View File

@@ -2712,11 +2712,27 @@ impl DeviceManager {
}
}
let legacy_interrupt_group = if let (Some(irq), Some(legacy_interrupt_manager)) = (
self.pci_device_irqs.get(&pci_device_bdf),
&self.legacy_interrupt_manager,
) {
Some(
legacy_interrupt_manager
.create_group(LegacyIrqGroupConfig {
irq: *irq as InterruptIndex,
})
.map_err(DeviceManagerError::CreateInterruptGroup)?,
)
} else {
None
};
let memory = self.memory_manager.lock().unwrap().guest_memory();
let mut vfio_pci_device = VfioPciDevice::new(
&self.address_manager.vm,
vfio_device,
&self.msi_interrupt_manager,
legacy_interrupt_group,
memory,
)
.map_err(DeviceManagerError::VfioPciCreate)?;