Skip to content

vfio-pci: Enable devices using unassigned config space

Alex Williamson kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2vfio-pci: Use byte granularity in config mapdrivers/vfio/pci/vfio_pci_config.c+47 -411 reply
2/2vfio-pci: Enable raw access to unassigned config spacedrivers/vfio/pci/vfio_pci_config.c+46 -320 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] vfio-pci: Enable devices using unassigned config space

Gavin Shan reported that be2net devices don't work under vfio-pci because they attempt to make use of device registers hidden among the gaps in PCI config space. I imagine this is a violation of the PCI specification, but if we want to allow such devices to work we need to enable access. In reality, config space registers are no different from MMIO or I/O port registers, which are already unregulated.

The trouble is that we map config space regions using a byte per dword because everything in config space is dword aligned... everything except the length. This leads to a latent bug where capabilities that do not end at a dword boundary get rounded down, preventing access to those last few bytes. Therefore, we first need to enable byte granularity of config space, then add an accessor for unassigned regions.

Gavin, I'd appreciate if you're able to test this against the be2net to verify that it resolves the problem. Thanks,

Alex

---

Alex Williamson (2):
vfio-pci: Use byte granularity in config map
vfio-pci: Enable raw access to unassigned config space

 drivers/vfio/pci/vfio_pci_config.c |  166 ++++++++++++++++++++----------------
 1 file changed, 93 insertions(+), 73 deletions(-)