So I did some additional troubleshooting steps with kmdb and I have a beginning 
of an explanation.

The host bridges have vendor ID/product ID/header type values set to zero, so 
enumerate_bus_devs() skips over these devices and doesn't enumerate the rest of 
their device functions, notably the PCI bridges. The kernel then enumerates the 
peer busses, but their PCI configuration spaces return all ones because the PCI 
bridges aren't configured and therefore the kernel doesn't discover anything. 
The one exception is the SMBus device, which has valid vendor ID/device IDs and 
the header type has the multifunction bit set, so the kernel enumerates the 
rest of its functions, discovers the ISA bridge and eventually the serial port.

If I binary patch at runtime enumerate_bus_devs() to not skip vendor IDs set to 
0x0, the kernel does register device nodes for the host bridges, but without 
the multifunction bit set it still skips enumerating their functions. If I set 
up the PCI primary, secondary and subordinate bus numbers inside the PCI 
bridges by hand, the respective devices appear inside the PCI configuration 
space and the kernel creates device nodes for them, but doesn't attach drivers 
(probably because the bridges aren't fully configured).

I assume that Linux does a complete enumeration of PCI busses, devices and 
functions and therefore doesn't miss the PCI bridges and the rest of the 
devices, despite the host bridges being apparently borked. I do not know why 
the host bridges themselves appear normal inside the output of lspci.

That is as far as I'll investigate this on my own, because I draw the line at 
manually configuring memory ranges for PCI bridges through kmdb. I'm also not 
planning on setting up an illumos development environment to build kernels and 
mess with the PCI initialization code, as that exceeds my ragequit threshold. 
If someone wants to tackle this I'm willing to test things, otherwise I'm 
resigning to running Proxmox on that box.
------------------------------------------
illumos: illumos-discuss
Permalink: 
https://illumos.topicbox.com/groups/discuss/Tb695f89d6fb11b82-Mb061661340364700f970d999
Delivery options: https://illumos.topicbox.com/groups/discuss/subscription

Reply via email to