pci, vmm: Pass PCI BDF to vfio and vfio_user

On AArch64, PCI BDF is used for devId in MSI-X routing entry.

Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
Michael Zhao
2022-01-18 19:52:56 +08:00
committed by Bo Chen
parent cf68f03ab6
commit 1db7718589
3 changed files with 21 additions and 6 deletions
+3 -2
View File
@@ -6,7 +6,7 @@
use crate::vfio::{Interrupt, Vfio, VfioCommon, VfioError};
use crate::{BarReprogrammingParams, PciBarRegionType, VfioPciError};
use crate::{
PciClassCode, PciConfiguration, PciDevice, PciDeviceError, PciHeaderType, PciSubclass,
PciBdf, PciClassCode, PciConfiguration, PciDevice, PciDeviceError, PciHeaderType, PciSubclass,
};
use hypervisor::HypervisorVmError;
use std::any::Any;
@@ -67,6 +67,7 @@ impl VfioUserPciDevice {
client: Arc<Mutex<Client>>,
msi_interrupt_manager: &Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>,
legacy_interrupt_group: Option<Arc<dyn InterruptSourceGroup>>,
bdf: PciBdf,
) -> Result<Self, VfioUserPciDeviceError> {
// This is used for the BAR and capabilities only
let configuration = PciConfiguration::new(
@@ -104,7 +105,7 @@ impl VfioUserPciDevice {
},
};
common.parse_capabilities(msi_interrupt_manager, &vfio_wrapper);
common.parse_capabilities(msi_interrupt_manager, &vfio_wrapper, bdf);
common
.initialize_legacy_interrupt(legacy_interrupt_group, &vfio_wrapper)
.map_err(VfioUserPciDeviceError::InitializeLegacyInterrupts)?;