Skip to content

Commit

Permalink
vfio-pci: Mask INTx if a device is not capabable of enabling it
Browse files Browse the repository at this point in the history
At the moment VFIO rightfully assumes that INTx is supported if
the interrupt pin is not set to zero in the device config space.
However if that is not the case (the pin is not zero but pdev->irq is),
vfio_intx_enable() fails.

In order to prevent the userspace from trying to enable INTx when we know
that it cannot work, let's mask the PCI_INTERRUPT_PIN register.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
  • Loading branch information
aik authored and awilliam committed Dec 20, 2017
1 parent 1291a0d commit 2170dd0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/vfio/pci/vfio_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ static bool vfio_pci_nointx(struct pci_dev *pdev)
}
}

if (!pdev->irq)
return true;

return false;
}

Expand Down

0 comments on commit 2170dd0

Please sign in to comment.