Skip to content

Commit

Permalink
x86: vtd: Use pci_get_assigned_device to look up interrupt invalidati…
Browse files Browse the repository at this point in the history
…on targets

Stop using the virtual device list which will be removed eventually and
switch to the pci_get_assigned_device service. It is a bit slower than
the current approach, but we don't consider the emulation of interrupt
invalidation requests as fast path. On the positive side, this change
will allow to simplify the PCI layer a bit.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information
jan-kiszka committed Aug 14, 2015
1 parent 018f4af commit 3f0c56a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions hypervisor/arch/x86/vtd.c
@@ -1,7 +1,7 @@
/*
* Jailhouse, a Linux-based partitioning hypervisor
*
* Copyright (c) Siemens AG, 2013, 2014
* Copyright (c) Siemens AG, 2013-2015
* Copyright (c) Valentine Sinitsyn, 2014
*
* Authors:
Expand Down Expand Up @@ -265,11 +265,9 @@ static int vtd_emulate_inv_int(unsigned int unit_no, unsigned int index)
if (!irte_usage->used)
return 0;

/* check all virtual PCI devices first */
for (device = root_cell.virtual_device_list; device;
device = device->next_virtual_device)
if (device->info->bdf == irte_usage->device_id)
return pci_ivshmem_update_msix(device);
device = pci_get_assigned_device(&root_cell, irte_usage->device_id);
if (device && device->info->type == JAILHOUSE_PCI_TYPE_IVSHMEM)
return pci_ivshmem_update_msix(device);

irq_msg = iommu_get_remapped_root_int(unit_no, irte_usage->device_id,
irte_usage->vector, index);
Expand Down

0 comments on commit 3f0c56a

Please sign in to comment.