Repository navigation
Conversation
bar1-resize-unlock v6.2: bypass stock pci_resize_resource on CMPs; one coordinated pass (bounded barrier across probes) releases CMP BAR1/BAR3 and prefetch windows, places a single 128 GiB window per card inside the largest host MEM aperture, claims top-down and writes bridge/reBAR/BAR registers directly, with full rollback on failure. Fixes the second card's resize on multi-CMP servers (pbus_size_mem alignment slack; host apertures never carry IORESOURCE_PREFETCH). Adds the nv_cmp_postbl module parameter (default 1) as the gate for the SEC2 post-BL timing path, read by the sec2-postbl gate - the /etc/nvidia/cmp-postbl.disabled marker cannot load in 615.x kthread context (os_open_readonly_file returns generic 0x59).
|
Actually this is the same multi-card failure as in #59, but it fixes the other half of that problem too. #59 correctly diagnosed the 615.x parallel-probe race ( The coordinated pass here plans placement once instead of serializing resize attempts:
Result on the same topology class (2× 8gb CMP 170HX behind a PCIe switch): both cards at Credit to @cibernox — the race analysis in #59 matches what I reproduced here. |
Summary
BAR1 resize only unlocked the first CMP on multi-card servers — every later card kept its stock 256 MiB BAR1 and was unusable. Reworks the resize as one coordinated pass across all CMP probes and adds an
nv_cmp_postblmodule parameter.Changes
pci_claim_resource, program bridge prefetch-window regs (1:1 mirror ofpci_setup_bridge_mmio_pref) + reBAR ctrl + BAR regs, full rollback on failure. Engages only on CMP IDs, falls back to the stock path otherwise → single-card desktops unaffected.pbus_size_mem()reserves only accounts for the first card in a shared host-bridge aperture, so resize for later cards silently falls back to stock size.IORESOURCE_MEM(the[32-bit]tag in lspci is cosmetic); resize logic requiringIORESOURCE_PREFETCHnever matches them.request_resource_conflict,pci_update_resource,pci_rebar_set_sizeare not exported to modules → direct register programming.for_each_pci_dev()is a barewhile-macro; it breaks inside anotherwhilepredicate.nv_cmp_postblmodule parameter (default 1): the/etc/nvidia/cmp-postbl.disabledmarker is unreadable inside the 615.xnv-probekernel thread (os_open_readonly_file()returns a generic0x59), so a parameter is the only working gate for the SEC2 post-BL payload. Can be split into a separate PR if preferred.Testing
Live hardware, cold boot.
dmesgshowsNVRM: CMP BAR1: final size = 65536 MBfor both GPUs;lspcishows 64 GiB prefetchable Region 1 per card, non-overlapping (apertures ≈256 GiB at root, ≈128 GiB per downstream port);nvidia-smireports 65536 MiB per GPU. Reload/re-scan and rollback path exercised. Not tested on 10gb (no card) or with passthrough.Hardware tested on (if applicable):
80:03.0→83:00.0(USP) →84:08.0/84:10.0(DSP, x4) →85:00.0/86:00.0