diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2016-02-22 16:02:46 -0700 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2016-02-22 16:10:09 -0700 |
commit | a13b64591747e8a4ab2df24540a17fca34de2d34 (patch) | |
tree | 9c0bc81f4e91de885e37c699a65f855eea541e9c /drivers/vfio/pci/vfio_pci.c | |
parent | f572a960a15e8bb56599f6d2358a9c18f0808e91 (diff) | |
download | linux-a13b64591747e8a4ab2df24540a17fca34de2d34.tar.bz2 |
vfio/pci: Expose shadow ROM as PCI option ROM
Integrated graphics may have their ROM shadowed at 0xc0000 rather than
implement a PCI option ROM. Make this ROM appear to the user using
the ROM BAR.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/pci/vfio_pci.c')
-rw-r--r-- | drivers/vfio/pci/vfio_pci.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c index 74a375297494..1ce1d364308c 100644 --- a/drivers/vfio/pci/vfio_pci.c +++ b/drivers/vfio/pci/vfio_pci.c @@ -609,8 +609,14 @@ static long vfio_pci_ioctl(void *device_data, /* Report the BAR size, not the ROM size */ info.size = pci_resource_len(pdev, info.index); - if (!info.size) - break; + if (!info.size) { + /* Shadow ROMs appear as PCI option ROMs */ + if (pdev->resource[PCI_ROM_RESOURCE].flags & + IORESOURCE_ROM_SHADOW) + info.size = 0x20000; + else + break; + } /* Is it really there? */ io = pci_map_rom(pdev, &size); |