Bug #11860


Use _CRS instead of _BBN to get assigned PCI bus

Added by Rob Johnston about 4 years ago. Updated over 3 years ago.

Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:
External Bug:


Robert Mustacchi reached out to me re an issue seen on Dilos, where the hostbridge topo enumerator module dumped core:

fffffc7fffdfe5f0 0xfffffc7fef21c249()
fffffc7fffdfe640`dev_for_hostbridge+0xef(5d7280, 588a88)
fffffc7fffdfe6d0`DEVprop_set+0x13b(664dd0, 664e70, 0,
fffffc7feb91c9da, fffffc7feb91c813)
fffffc7fffdfe750`did_props_set+0x84(664dd0, 664e70,
fffffc7feb92dc60, 7)
5853e0, 5a8a08, 2)
fffffc7fffdfe820`hb_process+0x69(5d7280, 5853e0, 2, 5a8a08)
fffffc7fffdfe880`pci_hostbridges_find+0x6c(5d7280, 5853e0)
fffffc7fffdfe8c0`platform_hb_enum+0x13(5d7280, 5853e0,
5d27e0, 0, fe)
fffffc7fffdfe940`hb_enum+0x90(5d7280, 5853e0, 5d27e0, 0,
fe, 0)
fffffc7fffdfe9d0`topo_mod_enumerate+0xc8(5d7280, 5853e0,
450ff0, 5d27e0, 0, fe)
fffffc7fffdfea20`enum_run+0x94(585480, 65df60)

The underlying issue was that the system was enumerating empty pci busses, which was breaking assumptions in the hostbridge topo module.

Below is Paul Winder's explanation for why we're enumerating empty busses along with a description of a possible fix.

This looks like a problem we came across when testing on different platforms.

FWIR, when enumerating PCI buses, it tries to match PCI root buses to the ACPI device using the bus from the _BBN method. After it has done that it scans all the _BBN and any which do match an already discovered bus are declared as empty buses. On some BIOS’s the _BBN do *not* match the real PCI bus, and you can end up with ghost/empty PCI buses - which the topology libraries don’t like.

We solved this by using the ACPI _CRS (current resource) to get the correct PCI bus number.

Eg A system with ghost buses:

$ ls /devices/
agpgart           pci@31,0          pci@5c,0          pci@91,0
agpgart:agpgart   pci@31,0:devctl   pci@5c,0:devctl   pci@91,0:devctl
fw                pci@31,0:intr     pci@5c,0:intr     pci@91,0:intr
options           pci@31,0:reg      pci@5c,0:reg      pci@91,0:reg
pci@0,0           pci@3a,0          pci@61,0          pci@98,0
pci@0,0:devctl    pci@3a,0:devctl   pci@61,0:devctl   pci@98,0:devctl
pci@0,0:intr      pci@3a,0:intr     pci@61,0:intr     pci@98,0:intr
pci@0,0:reg       pci@3a,0:reg      pci@61,0:reg      pci@98,0:reg
pci@14,0          pci@3c,0          pci@70,0          pseudo
pci@14,0:devctl   pci@3c,0:devctl   pci@70,0:devctl   pseudo:devctl
pci@14,0:intr     pci@3c,0:intr     pci@70,0:intr     scsi_vhci
pci@14,0:reg      pci@3c,0:reg      pci@70,0:reg      scsi_vhci:devctl

And the same system when using the _CRS method:

# ls /devices/
agpgart           pci@14,0:intr     pci@3c,0          pci@61,0:intr
agpgart:agpgart   pci@14,0:reg      pci@3c,0:devctl   pci@61,0:reg
fw                pci@31,0          pci@3c,0:intr     pci@70,0
options           pci@31,0:devctl   pci@3c,0:reg      pci@70,0:devctl
pci@0,0           pci@31,0:intr     pci@5c,0          pci@70,0:intr
pci@0,0:devctl    pci@31,0:reg      pci@5c,0:devctl   pci@70,0:reg
pci@0,0:intr      pci@3a,0          pci@5c,0:intr     pseudo
pci@0,0:reg       pci@3a,0:devctl   pci@5c,0:reg      pseudo:devctl
pci@14,0          pci@3a,0:intr     pci@61,0          scsi_vhci
pci@14,0:devctl   pci@3a,0:reg      pci@61,0:devctl   scsi_vhci:devctl

The code has been tested on a few platforms which *don’t* present the problem, and on the platform we found the problem.

This issue is being filed to track integrating Paul's fix for above issue into illumos-gate (patch attached)

The work to hardnen the hostbridge topo module such that it doesn't fall over in this situation is being tracked by illumos#11861.


Related issues

Related to illumos gate - Feature #11612: x86 PCI enumeration should not rely on bios max busClosedRobert Mustacchi

Is duplicate of illumos gate - Bug #11790: ACPI method _CRS should be used to identify bus numbers during initial probeClosedPaul Winder

Actions #1

Updated by Rob Johnston about 4 years ago

  • Description updated (diff)
Actions #2

Updated by Robert Mustacchi about 4 years ago

  • Related to Feature #11612: x86 PCI enumeration should not rely on bios max bus added
Actions #3

Updated by Robert Mustacchi over 3 years ago

  • Is duplicate of Bug #11790: ACPI method _CRS should be used to identify bus numbers during initial probe added
Actions #4

Updated by Robert Mustacchi over 3 years ago

  • Status changed from New to Closed

This is a dup of 11790.


Also available in: Atom PDF