summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/platform
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2015-10-27 14:53:05 -0600
committerAlex Williamson <alex.williamson@redhat.com>2015-10-27 14:53:05 -0600
commit4e1a635552d3df7bb743de8c2be156293c53839e (patch)
treeca4997c28062babbe93bea6915580711539191dc /drivers/vfio/platform
parent5f096b14d421ba23249b752e41989ecfaa6ae226 (diff)
downloadop-kernel-dev-4e1a635552d3df7bb743de8c2be156293c53839e.zip
op-kernel-dev-4e1a635552d3df7bb743de8c2be156293c53839e.tar.gz
vfio/pci: Use kernel VPD access functions
The PCI VPD capability operates on a set of window registers in PCI config space. Writing to the address register triggers either a read or write, depending on the setting of the PCI_VPD_ADDR_F bit within the address register. The data register provides either the source for writes or the target for reads. This model is susceptible to being broken by concurrent access, for which the kernel has adopted a set of access functions to serialize these registers. Additionally, commits like 932c435caba8 ("PCI: Add dev_flags bit to access VPD through function 0") and 7aa6ca4d39ed ("PCI: Add VPD function 0 quirk for Intel Ethernet devices") indicate that VPD registers can be shared between functions on multifunction devices creating dependencies between otherwise independent devices. Fortunately it's quite easy to emulate the VPD registers, simply storing copies of the address and data registers in memory and triggering a VPD read or write on writes to the address register. This allows vfio users to avoid seeing spurious register changes from accesses on other devices and enables the use of shared quirks in the host kernel. We can theoretically still race with access through sysfs, but the window of opportunity is much smaller. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Acked-by: Mark Rustad <mark.d.rustad@intel.com>
Diffstat (limited to 'drivers/vfio/platform')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud