mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
msix: Add gsi_msi_routes to MsixConfig
Because MsixConfig will be responsible for updating KVM GSI routes at some point, it is necessary that it can access the list of routes contained by gsi_msi_routes. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
9b60fcdc39
commit
2381f32ae0
@@ -577,6 +577,7 @@ impl DeviceManager {
|
||||
&mut pci_bus,
|
||||
mapping,
|
||||
migratable_devices,
|
||||
&gsi_msi_routes,
|
||||
)?;
|
||||
|
||||
if let Some(dev_id) = virtio_iommu_attach_dev {
|
||||
@@ -590,7 +591,7 @@ impl DeviceManager {
|
||||
&mut pci_bus,
|
||||
memory_manager,
|
||||
&mut iommu_device,
|
||||
gsi_msi_routes,
|
||||
&gsi_msi_routes,
|
||||
)?;
|
||||
|
||||
iommu_attached_devices.append(&mut vfio_iommu_device_ids);
|
||||
@@ -614,6 +615,7 @@ impl DeviceManager {
|
||||
&mut pci_bus,
|
||||
&None,
|
||||
migratable_devices,
|
||||
&gsi_msi_routes,
|
||||
)?;
|
||||
|
||||
*virt_iommu = Some((iommu_id, iommu_attached_devices));
|
||||
@@ -1350,7 +1352,7 @@ impl DeviceManager {
|
||||
pci: &mut PciBus,
|
||||
memory_manager: &Arc<Mutex<MemoryManager>>,
|
||||
iommu_device: &mut Option<vm_virtio::Iommu>,
|
||||
gsi_msi_routes: Arc<Mutex<HashMap<u32, kvm_irq_routing_entry>>>,
|
||||
gsi_msi_routes: &Arc<Mutex<HashMap<u32, kvm_irq_routing_entry>>>,
|
||||
) -> DeviceManagerResult<Vec<u32>> {
|
||||
let mut mem_slot = memory_manager.lock().unwrap().allocate_kvm_memory_slot();
|
||||
let mut iommu_attached_device_ids = Vec::new();
|
||||
@@ -1432,6 +1434,7 @@ impl DeviceManager {
|
||||
pci: &mut PciBus,
|
||||
iommu_mapping: &Option<Arc<IommuMapping>>,
|
||||
migratable_devices: &mut Vec<Arc<Mutex<dyn Migratable>>>,
|
||||
gsi_msi_routes: &Arc<Mutex<HashMap<u32, kvm_irq_routing_entry>>>,
|
||||
) -> DeviceManagerResult<Option<u32>> {
|
||||
// Allows support for one MSI-X vector per queue. It also adds 1
|
||||
// as we need to take into account the dedicated vector to notify
|
||||
@@ -1474,6 +1477,7 @@ impl DeviceManager {
|
||||
iommu_mapping_cb,
|
||||
&mut allocator,
|
||||
vm_fd,
|
||||
gsi_msi_routes.clone(),
|
||||
)
|
||||
.map_err(DeviceManagerError::VirtioDevice)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user