vfio_pci.c (f572a960a15e8bb56599f6d2358a9c18f0808e91) | vfio_pci.c (a13b64591747e8a4ab2df24540a17fca34de2d34) |
---|---|
1/* 2 * Copyright (C) 2012 Red Hat, Inc. All rights reserved. 3 * Author: Alex Williamson <alex.williamson@redhat.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 as 7 * published by the Free Software Foundation. 8 * --- 595 unchanged lines hidden (view full) --- 604 void __iomem *io; 605 size_t size; 606 607 info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index); 608 info.flags = 0; 609 610 /* Report the BAR size, not the ROM size */ 611 info.size = pci_resource_len(pdev, info.index); | 1/* 2 * Copyright (C) 2012 Red Hat, Inc. All rights reserved. 3 * Author: Alex Williamson <alex.williamson@redhat.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License version 2 as 7 * published by the Free Software Foundation. 8 * --- 595 unchanged lines hidden (view full) --- 604 void __iomem *io; 605 size_t size; 606 607 info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index); 608 info.flags = 0; 609 610 /* Report the BAR size, not the ROM size */ 611 info.size = pci_resource_len(pdev, info.index); |
612 if (!info.size) 613 break; | 612 if (!info.size) { 613 /* Shadow ROMs appear as PCI option ROMs */ 614 if (pdev->resource[PCI_ROM_RESOURCE].flags & 615 IORESOURCE_ROM_SHADOW) 616 info.size = 0x20000; 617 else 618 break; 619 } |
614 615 /* Is it really there? */ 616 io = pci_map_rom(pdev, &size); 617 if (!io || !size) { 618 info.size = 0; 619 break; 620 } 621 pci_unmap_rom(pdev, io); --- 752 unchanged lines hidden --- | 620 621 /* Is it really there? */ 622 io = pci_map_rom(pdev, &size); 623 if (!io || !size) { 624 info.size = 0; 625 break; 626 } 627 pci_unmap_rom(pdev, io); --- 752 unchanged lines hidden --- |