summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptInternalFormat.h
diff options
context:
space:
mode:
authorabrahamg <abrahamg@microsoft.com>2026-10-06 01:39:29 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2026-10-14 21:22:11 +0300
commit0e7dad44bae663193b580adeb9d942c2559166f6 (patch)
tree00db2784fd5c907938bf6a0be15641d1cf374f61 /MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptInternalFormat.h
parentee395b416b5b954259e30570d6cfe93061a98346 (diff)
downloadedk2-0e7dad44bae663193b580adeb9d942c2559166f6.tar.xz
MdeModulePkg/PciBusDxe: Preserve physical BAR numbering
PCI BARs are by six consecutive 32-bit configurationv registers. 64-bit BARs consume two of those registers: the first contains the low address bits and the second contains the high address bits. These are represented in the private PCI_IO_DEVICE as PciBar[PCI_MAX_BAR] and VfPciBar[PCI_MAX_BAR]. PciBusDxe previously maintained a separate BarIndex while walking the configuration registers. PciParseBar() and PciIovParseVfBar() advance the configuration offset by two registers when parsing a 64-bit BAR, but their callers incremented BarIndex only once. As a result, every BAR following a 64-bit BAR was stored in the preceding array entry. For example, a BAR at offset 0x18 following a 64-bit BAR at offset 0x10 was recorded as PciBar[1] instead of PciBar[2]. This breaks the invariant that PciBar[Index] and VfPciBar[Index] describe the corresponding physical BAR register. It can cause later resource handling and diagnostics to associate a BAR with the wrong hardware slot. VF BAR programming retained the configuration offset in each entry, which could mask the problem, but its array and resource node indices were still incorrect. Derive the BAR index directly from the configuration offset in both parsers. Remove the redundant BarIndex parameters and let each caller advance using the offset returned by the parser. This preserves holes for the upper DWORDs of 64-bit BARs and keeps conventional and SR-IOV VF BAR numbering aligned with the hardware configuration space. Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
Diffstat (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptInternalFormat.h')
0 files changed, 0 insertions, 0 deletions