]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC: 308723-308725,308793-308795,309127
authordexuan <dexuan@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 30 Nov 2016 06:26:37 +0000 (06:26 +0000)
committerdexuan <dexuan@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 30 Nov 2016 06:26:37 +0000 (06:26 +0000)
commitc52625c351fc7752acf7a305be636241f3c0f394
tree8580910b05905648ae329acf440ecce4ec2ef14e
parent5725d1304d0d9cf314e774b0a68f0596f8f787c1
MFC: 308723-308725,308793-308795,309127

Approved by: sephe (mentor)

r308723
    hyperv/vmbus: add a new method to get vcpu_id

    vcpu_id is host's representation of guest CPU.
    We get the mapping between vcpu_id and FreeBSD kernel's cpu id when VMBus
    driver is loaded. Later, when a driver, like the coming pcib driver, talks
    to the host and needs to refer to a guest CPU, the driver must use the
    vcpu_id.

    Reviewed by:    jhb, sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8410

r308724
    hyperv/vmbus: add new vmbus methods to support PCIe pass-through

    The new methods will be used by the coming pcib driver.

    Reviewed by:    sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8409

r308725
    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)
    Sponsored by:   Microsoft
    Differential Revision:  https://reviews.freebsd.org/D8332

r308793
    hyperv/pcib: Fix the build for some kernel configs

    Add the dependency on pci explicitly for the pcib and vmbus drivers.
    The related Makefiles are updated accordingly too.

    Reviewed by:    sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft

r308794
    hyperv/vmbus,pcib: Add MODULE_DEPEND on pci

    We'd better add this dependency explicitly, though usually the pci
    driver is built into the kernel by default.

    Reviewed by:    sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft

r308795
    hyperv/pcib: change the file name: pcib.c -> vmbus_pcib.c

    This makes the file name and the variable naming in the file consistent.

    Reviewed by:    sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft

r309127
    hyperv/vmbus,pcib: unbreak build in case NEW_PCIB is undefined

    vmbus_pcib requires NEW_PCIB, but in case that's not defined, we at
    least shouldn't break build.

    Reviewed by:    sephe
    Approved by:    sephe (mentor)
    Sponsored by:   Microsoft

git-svn-id: svn://svn.freebsd.org/base/stable/10@309313 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/conf/files.amd64
sys/conf/files.i386
sys/dev/hyperv/pcib/vmbus_pcib.c [new file with mode: 0644]
sys/dev/hyperv/vmbus/vmbus.c
sys/dev/hyperv/vmbus/vmbus_if.m
sys/dev/hyperv/vmbus/vmbus_var.h
sys/modules/hyperv/pcib/Makefile [new file with mode: 0644]
sys/modules/hyperv/vmbus/Makefile