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

From: Alex Williamson
Date: Tue Mar 26 2013 - 14:19:04 EST


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(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/