]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vfio/pci: Hide broken INTx support from user
authorAlex Williamson <alex.williamson@redhat.com>
Thu, 24 Mar 2016 19:05:18 +0000 (13:05 -0600)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 04:49:56 +0000 (20:49 -0800)
commitab3ecab07774e6271b2dd46da06de36da72f3abf
tree5e982b39fe2a2e4798f1578e1ca715935b69f024
parent7c9354073f6a325b1d3bc47c60a7d2bf73b8eac7
vfio/pci: Hide broken INTx support from user

INTx masking has two components, the first is that we need the ability
to prevent the device from continuing to assert INTx.  This is
provided via the DisINTx bit in the command register and is the only
thing we can really probe for when testing if INTx masking is
supported.  The second component is that the device needs to indicate
if INTx is asserted via the interrupt status bit in the device status
register.  With these two features we can generically determine if one
of the devices we own is asserting INTx, signal the user, and mask the
interrupt while the user services the device.

Generally if one or both of these components is broken we resort to
APIC level interrupt masking, which requires an exclusive interrupt
since we have no way to determine the source of the interrupt in a
shared configuration.  This often makes it difficult or impossible to
configure the system for userspace use of the device, for an interrupt
mode that the user may not need.

One possible configuration of broken INTx masking is that the DisINTx
support is fully functional, but the interrupt status bit never
signals interrupt assertion.  In this case we do have the ability to
prevent the device from asserting INTx, but lack the ability to
identify the interrupt source.  For this case we can simply pretend
that the device lacks INTx support entirely, keeping DisINTx set on
the physical device, virtualizing this bit for the user, and
virtualizing the interrupt pin register to indicate no INTx support.
We already support virtualization of the DisINTx bit and already
virtualize the interrupt pin for platforms without INTx support.  By
tying these components together, setting DisINTx on open and reset,
and identifying devices broken in this particular way, we can provide
support for them w/o the handicap of APIC level INTx masking.

Intel i40e (XL710/X710) 10/20/40GbE NICs have been identified as being
broken in this specific way.  We leave the vfio-pci.nointxmask option
as a mechanism to bypass this support, enabling INTx on the device
with all the requirements of APIC level masking.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: John Ronciak <john.ronciak@intel.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
(cherry picked from commit 450744051d201c4d72436ebf5b04b9a06ba2cf30)

Orabug: 25049396
Orabug: 25393341
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/vfio/pci/vfio_pci.c
drivers/vfio/pci/vfio_pci_config.c
drivers/vfio/pci/vfio_pci_private.h