vfio/pci: Mask buggy SR-IOV VF INTx support
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 25 Sep 2018 19:01:27 +0000 (13:01 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 17:00:40 +0000 (18:00 +0100)
commitd7bb792bc8ff8e96ea344f6752d7749f82e1ff46
tree360656df85eaf5dd9fd2dde7549dcbcaf75531f7
parentf1b10ba5739440ca51d66f0b2949cead88d2dd02
vfio/pci: Mask buggy SR-IOV VF INTx support

[ Upstream commit db04264fe9bc0f2b62e036629f9afb530324b693 ]

The SR-IOV spec requires that VFs must report zero for the INTx pin
register as VFs are precluded from INTx support.  It's much easier for
the host kernel to understand whether a device is a VF and therefore
whether a non-zero pin register value is bogus than it is to do the
same in userspace.  Override the INTx count for such devices and
virtualize the pin register to provide a consistent view of the device
to the user.

As this is clearly a spec violation, warn about it to support hardware
validation, but also provide a known whitelist as it doesn't do much
good to continue complaining if the hardware vendor doesn't plan to
fix it.

Known devices with this issue: 8086:270c

Tested-by: Gage Eads <gage.eads@intel.com>
Reviewed-by: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vfio/pci/vfio_pci.c
drivers/vfio/pci/vfio_pci_config.c