Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F154090476
D51892.id162133.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
D51892.id162133.diff
View Options
diff --git a/usr.sbin/bhyve/amd64/Makefile.inc b/usr.sbin/bhyve/amd64/Makefile.inc
--- a/usr.sbin/bhyve/amd64/Makefile.inc
+++ b/usr.sbin/bhyve/amd64/Makefile.inc
@@ -13,6 +13,7 @@
pci_gvt-d.c \
pci_lpc.c \
pci_passthru.c \
+ pci_passthru_quirks.c \
pctestdev.c \
pm.c \
post.c \
diff --git a/usr.sbin/bhyve/pci_passthru_quirks.c b/usr.sbin/bhyve/pci_passthru_quirks.c
new file mode 100644
--- /dev/null
+++ b/usr.sbin/bhyve/pci_passthru_quirks.c
@@ -0,0 +1,48 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Beckhoff Automation GmbH & Co. KG
+ * Author: Corvin Köhne <c.koehne@beckhoff.com>
+ */
+
+#include <dev/pci/pcireg.h>
+
+#include <errno.h>
+
+#include "pci_passthru.h"
+
+#define PCI_VENDOR_NVIDIA 0x10DE
+
+static int
+nvidia_gpu_probe(struct pci_devinst *const pi)
+{
+ struct passthru_softc *sc;
+ uint16_t vendor;
+ uint8_t class;
+
+ sc = pi->pi_arg;
+
+ vendor = pci_host_read_config(passthru_get_sel(sc), PCIR_VENDOR, 0x02);
+ if (vendor != PCI_VENDOR_NVIDIA)
+ return (ENXIO);
+
+ class = pci_host_read_config(passthru_get_sel(sc), PCIR_CLASS, 0x01);
+ if (class != PCIC_DISPLAY)
+ return (ENXIO);
+
+ return (0);
+}
+
+static int
+nvidia_gpu_init(struct pci_devinst *const pi, nvlist_t *const nvl __unused)
+{
+ pci_set_cfgdata8(pi, PCIR_INTPIN, 1);
+
+ return (0);
+}
+
+static struct passthru_dev nvidia_gpu = {
+ .probe = nvidia_gpu_probe,
+ .init = nvidia_gpu_init,
+};
+PASSTHRU_DEV_SET(nvidia_gpu);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 27, 2:34 AM (3 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32204913
Default Alt Text
D51892.id162133.diff (1 KB)
Attached To
Mode
D51892: bhyve: assign a valid INTPIN to NVIDIA GPUs
Attached
Detach File
Event Timeline
Log In to Comment