aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vfio/pci/vfio_pci.c
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2016-02-22 16:02:46 -0700
committerAlex Williamson <alex.williamson@redhat.com>2016-02-22 16:10:09 -0700
commita13b64591747e8a4ab2df24540a17fca34de2d34 (patch)
tree9c0bc81f4e91de885e37c699a65f855eea541e9c /drivers/vfio/pci/vfio_pci.c
parentvfio/pci: Intel IGD host and LCP bridge config space access (diff)
downloadlinux-dev-a13b64591747e8a4ab2df24540a17fca34de2d34.tar.xz
linux-dev-a13b64591747e8a4ab2df24540a17fca34de2d34.zip
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.c10
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);