Commit 51814f0
Skip remaining PCI devices when device 0 is absent on a bus
Standard PCI enumeration optimization: if device 0 function 0 on a bus
returns 0xFFFF, no devices exist on that bus. This reduces the scan from
32 buses × 32 devices = 1024 probes to ~63 probes on uhyve (which has
a single device at bus 0 device 0).
PCI legacy scan drops from ~13 ms to ~0.8 ms, cutting total boot time
from ~18 ms to ~5.5 ms.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 4912505 commit 51814f0
1 file changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
120 | 126 | | |
| 127 | + | |
| 128 | + | |
121 | 129 | | |
122 | 130 | | |
123 | 131 | | |
| |||
0 commit comments