Ignore:
Timestamp:
Apr 16, 2017, 3:07:01 PM (6 weeks ago)
Author:
brainslayer
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-3.18/drivers/iommu/intel-iommu.c

    r27463 r31869  
    697697
    698698        if (dev_is_pci(dev)) {
     699                struct pci_dev *pf_pdev;
     700
    699701                pdev = to_pci_dev(dev);
     702                /* VFs aren't listed in scope tables; we need to look up
     703                 * the PF instead to find the IOMMU. */
     704                pf_pdev = pci_physfn(pdev);
     705                dev = &pf_pdev->dev;
    700706                segment = pci_domain_nr(pdev->bus);
    701707        } else if (ACPI_COMPANION(dev))
     
    710716                                          drhd->devices_cnt, i, tmp) {
    711717                        if (tmp == dev) {
     718                                /* For a VF use its original BDF# not that of the PF
     719                                 * which we used for the IOMMU lookup. Strictly speaking
     720                                 * we could do this for all PCI devices; we only need to
     721                                 * get the BDF# from the scope table for ACPI matches. */
     722                                if (pdev->is_virtfn)
     723                                        goto got_pdev;
     724
    712725                                *bus = drhd->devices[i].bus;
    713726                                *devfn = drhd->devices[i].devfn;
Note: See TracChangeset for help on using the changeset viewer.