Skip to content

Commit 63316f9

Browse files
vliaskovlegoater
authored andcommitted
vfio/pci-quirks: Exclude non-ioport BAR from ATI quirk
The ATI BAR4 quirk is targeting an ioport BAR. Older devices may have a BAR4 which is not an ioport, causing a segfault here. Test the BAR type to skip these devices. Similar to "8f419c5b: vfio/pci-quirks: Exclude non-ioport BAR from NVIDIA quirk" Untested, as I don't have the card to test. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2856 Signed-off-by: Vasilis Liaskovitis <[email protected]> Reviewed-by: Alex Williamson <[email protected]> Link: https://lore.kernel.org/qemu-devel/[email protected] Signed-off-by: Cédric Le Goater <[email protected]>
1 parent 28ea52d commit 63316f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hw/vfio/pci-quirks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ static void vfio_probe_ati_bar4_quirk(VFIOPCIDevice *vdev, int nr)
403403

404404
/* This windows doesn't seem to be used except by legacy VGA code */
405405
if (!vfio_pci_is(vdev, PCI_VENDOR_ID_ATI, PCI_ANY_ID) ||
406-
!vdev->vga || nr != 4) {
406+
!vdev->vga || nr != 4 || !vdev->bars[4].ioport) {
407407
return;
408408
}
409409

0 commit comments

Comments
 (0)