]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
hyperv/pcib: enable PCIe pass-through (a.k.a. Discrete Device Assignment)
authorDexuan Cui <dexuan@FreeBSD.org>
Wed, 16 Nov 2016 09:25:00 +0000 (09:25 +0000)
committerDexuan Cui <dexuan@FreeBSD.org>
Wed, 16 Nov 2016 09:25:00 +0000 (09:25 +0000)
commit871c968b3ae6904d1ce7bd08388e5c4c1498fdc9
treef95dbb2ee973787cbf435babbd72f14fef3d4e7a
parent522c192d38d8ead2d016a8d892cdc0d77d8ad7ba
hyperv/pcib: enable PCIe pass-through (a.k.a. Discrete Device Assignment)

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:

1) 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).

2) The pcib driver allocates resources for the device(s) and initialize
the related BARs, when the device driver's attach method is invoked;

3) The pcib driver talks to the host to create MSI/MSI-X interrupt
remapping between the guest and the host;

4) The pcib driver supports device hot add/remove.

Reviewed by: sephe
Approved by: sephe (mentor)
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8332
sys/conf/files.amd64
sys/conf/files.i386
sys/dev/hyperv/pcib/pcib.c [new file with mode: 0644]
sys/modules/hyperv/pcib/Makefile [new file with mode: 0644]