diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile --- a/usr.sbin/bhyve/Makefile +++ b/usr.sbin/bhyve/Makefile @@ -40,7 +40,6 @@ pci_emul.c \ pci_hostbridge.c \ pci_nvme.c \ - pci_passthru.c \ pci_virtio_9p.c \ pci_virtio_block.c \ pci_virtio_console.c \ 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 @@ -15,6 +15,7 @@ pci_hda.c \ pci_irq.c \ pci_lpc.c \ + pci_passthru.c \ pci_uart.c \ pci_xhci.c \ pctestdev.c \ diff --git a/usr.sbin/bhyve/pci_emul.c b/usr.sbin/bhyve/pci_emul.c --- a/usr.sbin/bhyve/pci_emul.c +++ b/usr.sbin/bhyve/pci_emul.c @@ -59,8 +59,8 @@ #ifdef __amd64__ #include "amd64/pci_irq.h" #include "amd64/pci_lpc.h" -#endif #include "pci_passthru.h" +#endif #include "qemu_fwcfg.h" #define CONF1_ADDR_PORT 0x0cf8 @@ -381,7 +381,11 @@ if (config == NULL) { return def; } else if (host_sel != NULL && strcmp(config, "host") == 0) { +#ifdef __amd64__ return pci_host_read_config(host_sel, reg, size); +#else + errx(1, "cannot fetch host PCI configuration"); +#endif } else { return strtol(config, NULL, 16); }