Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107283829
D19904.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D19904.diff
View Options
Index: head/usr.sbin/bhyve/pci_emul.c
===================================================================
--- head/usr.sbin/bhyve/pci_emul.c
+++ head/usr.sbin/bhyve/pci_emul.c
@@ -953,15 +953,23 @@
int err;
struct pciecap pciecap;
- if (type != PCIEM_TYPE_ROOT_PORT)
- return (-1);
-
bzero(&pciecap, sizeof(pciecap));
+ /*
+ * Use the integrated endpoint type for endpoints on a root complex bus.
+ *
+ * NB: bhyve currently only supports a single PCI bus that is the root
+ * complex bus, so all endpoints are integrated.
+ */
+ if ((type == PCIEM_TYPE_ENDPOINT) && (pi->pi_bus == 0))
+ type = PCIEM_TYPE_ROOT_INT_EP;
+
pciecap.capid = PCIY_EXPRESS;
- pciecap.pcie_capabilities = PCIECAP_VERSION | PCIEM_TYPE_ROOT_PORT;
- pciecap.link_capabilities = 0x411; /* gen1, x1 */
- pciecap.link_status = 0x11; /* gen1, x1 */
+ pciecap.pcie_capabilities = PCIECAP_VERSION | type;
+ if (type != PCIEM_TYPE_ROOT_INT_EP) {
+ pciecap.link_capabilities = 0x411; /* gen1, x1 */
+ pciecap.link_status = 0x11; /* gen1, x1 */
+ }
err = pci_emul_add_capability(pi, (u_char *)&pciecap, sizeof(pciecap));
return (err);
Index: head/usr.sbin/bhyve/pci_nvme.c
===================================================================
--- head/usr.sbin/bhyve/pci_nvme.c
+++ head/usr.sbin/bhyve/pci_nvme.c
@@ -1925,6 +1925,12 @@
goto done;
}
+ error = pci_emul_add_pciecap(pi, PCIEM_TYPE_ROOT_INT_EP);
+ if (error) {
+ WPRINTF(("%s pci add Express capability failed\r\n", __func__));
+ goto done;
+ }
+
pthread_mutex_init(&sc->mtx, NULL);
sem_init(&sc->iosemlock, 0, sc->ioslots);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 12, 11:19 PM (21 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15773686
Default Alt Text
D19904.diff (1 KB)
Attached To
Mode
D19904: bhyve: Add Integrated Endpoint to PCIe Capability
Attached
Detach File
Event Timeline
Log In to Comment