The feature enables us to pass through physical PCIe devices to FreeBSD VM
running on Hyper-V (Windows Server 2016) to get near-native performance with
low CPU utilization.
The patch implements a PCI bridge driver to support the feature:
- the pcib driver talks to the host to discover device(s) and presents
the device(s) to FreeBSD's pci driver via PCI configuration space (note:
to access the configuration space, we don't use the standard I/O port
0xCF8/CFC method; instead, we use an MMIO-based method supplied by Hyper-V,
which is very similar to the 0xCF8/CFC method).
- the pcib driver allocates resources for the device(s) and initialize
the related BARs, when the device driver's attach method is invoked;
- the pcib driver talks to the host to create MSI/MSI-X interrupt
remapping between the guest and the host;
- the pcib driver supports device hot add/remove.
BTW, I also put the patch at github: