header type for bhyve host-pci bridge
Andriy Gapon
avg at FreeBSD.org
Mon Jun 22 09:27:07 UTC 2015
diff --git a/usr.sbin/bhyve/pci_hostbridge.c b/usr.sbin/bhyve/pci_hostbridge.c
index 54a25ae..5c9ea28 100644
--- a/usr.sbin/bhyve/pci_hostbridge.c
+++ b/usr.sbin/bhyve/pci_hostbridge.c
@@ -38,7 +38,7 @@ pci_hostbridge_init(struct vmctx *ctx, struct pci_devinst *pi,
char *opts)
/* config space */
pci_set_cfgdata16(pi, PCIR_VENDOR, 0x1275); /* NetApp */
pci_set_cfgdata16(pi, PCIR_DEVICE, 0x1275); /* NetApp */
- pci_set_cfgdata8(pi, PCIR_HDRTYPE, PCIM_HDRTYPE_BRIDGE);
+ pci_set_cfgdata8(pi, PCIR_HDRTYPE, PCIM_HDRTYPE_NORMAL);
pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_BRIDGE);
pci_set_cfgdata8(pi, PCIR_SUBCLASS, PCIS_BRIDGE_HOST);
It seems that the normal header type is expected for a Host-PCI bridge.
I see that on real hardware.
Also, Linux complains about the current header type:
pci 0000:00:00.0: ignoring class 0x060000 (doesn't match header type 01)
pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
pci 0000:00:00.0: can't allocate child bus 00 from [bus 00]
Same with lspci:
$ lspci -v
00:00.0 Non-VGA unclassified device: Network Appliance Corporation Device 1275
!!! Invalid class 0000 for header type 01
Flags: bus master, fast devsel, latency 0
Bus: primary=00, secondary=00, subordinate=00, sec-latency=0
I/O behind bridge: 00000000-00000fff
Memory behind bridge: 00000000-000fffff
Prefetchable memory behind bridge: 00000000-000fffff
Capabilities: [40] Express Root Port (Slot-), MSI 00
I think that PCIM_HDRTYPE_BRIDGE is for PCI-PCI bridges.
--
Andriy Gapon
More information about the freebsd-virtualization
mailing list