]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: Add PCIe Integrated Endpoint capability
authorchuck <chuck@FreeBSD.org>
Fri, 7 Jun 2019 17:09:49 +0000 (17:09 +0000)
committerchuck <chuck@FreeBSD.org>
Fri, 7 Jun 2019 17:09:49 +0000 (17:09 +0000)
commitf04fbdcb9dc721ef70747b8904dec150865a47ef
tree1ef92ee3c6faedae17c233c1dbf2c7927d94ec7d
parent8e4b03df46ab81e3e6357f1d3b89a98548e561a2
bhyve: Add PCIe Integrated Endpoint capability

The NVMe CAM driver reports the PCIe Link Capability and Status for
devices. For emulated bhyve NVMe devices, this looks like:

nda0: nvme version 1.3 x63 (max x63) lanes PCIe Gen15 (max Gen15) link

The driver outputs this because the emulated device doesn't include the
PCIe Capability structure. The NVMe specification requires these
registers, so the fix is to add this set of capability registers to the
emulated device.

Note that PCI Express devices that are integrated into the Root Complex
(i.e. Bus 0x0) do not have to support the Link Capability or Status
registers. Windows will fail to start (i.e. Code 10) devices that appear
to be part of the Root Complex but report being a PCI Express Endpoint.
So also add a check to pci_emul_add_pciecap() to check if the device is
integrated and change the device type.

Reviewed by: imp, ken, araujo, jhb, rgrimes
Approved by: imp (mentor), ken (mentor), jhb (maintainer)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19904
usr.sbin/bhyve/pci_emul.c
usr.sbin/bhyve/pci_nvme.c