]> git.baikalelectronics.ru Git - kernel.git/commit
vfio-pci: Mask INTx if a device is not capabable of enabling it
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Thu, 7 Dec 2017 01:56:54 +0000 (12:56 +1100)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 20 Dec 2017 16:53:52 +0000 (09:53 -0700)
commit7bb576adec086c7018d591cdae1f3e9b4ba1ae33
treea7d3a2634f54a2e96c20334a9c4dd2b237736bec
parentf46f7a864ffeb8668eeb7ce6a8595148d52edaeb
vfio-pci: Mask INTx if a device is not capabable of enabling it

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>
drivers/vfio/pci/vfio_pci.c