fix(os/image): enable MMCONFIG so Blackwell GPUs can be probed - #1156
Merged
Merged
Conversation
pci=nommconf confines PCI config space access to the legacy CF8h/CFCh port I/O path, which physically cannot reach past the first 256 bytes. pci_find_ext_capability() then short-circuits on dev->cfg_size and the whole PCIe extended config space (offset >= 0x100) becomes unreadable. Blackwell GPU drivers walk that space to find NVIDIA's vendor DVSEC. With MMCONFIG off the reads return 0xFFFFFFFF, the driver asserts on every probe, and every later cuInit() fails with CUDA_ERROR_SYSTEM_NOT_READY (802). No other mechanism reaches extended config space, so GPU passthrough cannot work without MMCONFIG. pci=noearly is deliberately kept. It gates early type 1 scanning, which runs before ACPI is parsed and dispatches into vendor fixups keyed on a vendor/device/class triple read straight out of host-controlled config space. GPU drivers bind during normal PCI enumeration and do not depend on it, and Intel's confidential-computing guest hardening names early PCI code as something to disable, so leaving it off costs nothing here. The command line is stated once per image backend, so the mkosi shared definition and the yocto UKI recipe move together. This changes the measured guest command line: the UKI PE section digests, metadata.json and the derived RTMRs all shift, so attestation baselines have to be refreshed with the image that ships it.
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
It changes security/attestation-sensitive guest kernel cmdline behavior in a way that warrants final human review despite the diff being small.
Pull request overview
This PR updates the guest OS kernel command line to re-enable PCIe MMCONFIG access (by removing pci=nommconf), which is required for NVIDIA Blackwell GPU passthrough because the driver needs PCIe extended config space to probe vendor DVSEC.
Changes:
- Removed
pci=nommconffrom the mkosi-generated guest kernel cmdline (os/image/kernel-cmdline.sh). - Removed
pci=nommconffrom the Yocto UKI cmdline base (os/yocto/.../dstack-uki.bb) and added a sync note pointing to the canonical cmdline definition.
File summaries
| File | Description |
|---|---|
| os/yocto/layers/meta-dstack/recipes-core/images/dstack-uki.bb | Drops pci=nommconf from UKI_CMDLINE_BASE and adds a comment to keep it aligned with the canonical cmdline definition. |
| os/image/kernel-cmdline.sh | Drops pci=nommconf from dstack_kernel_cmdline() and documents why MMCONFIG must remain enabled (and why pci=noearly stays). |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
pci=nommconfconfines PCI config space access to the legacy CF8h/CFCh port I/O path, which physically cannot reach past the first 256 bytes.pci_find_ext_capability()then short-circuits ondev->cfg_size <= PCI_CFG_SPACE_SIZE, so the whole PCIe extended config space (offset >=0x100) is unreadable.Blackwell GPU drivers walk that space to find NVIDIA's vendor DVSEC. With MMCONFIG off the reads return
0xFFFFFFFF, the driver asserts on every probe, and every latercuInit()fails withCUDA_ERROR_SYSTEM_NOT_READY(802). No other mechanism reaches extended config space, so GPU passthrough cannot work without MMCONFIG. This is a property of the access method, not a driver bug.What changed
Dropped
pci=nommconffrom the guest kernel command line, in both places it is stated — the shared mkosi definition (os/image/kernel-cmdline.sh) and the yocto UKI recipe (dstack-uki.bb) — plus a comment recording why it must not come back.What deliberately did not change
pci=noearlystays. It gates a different mechanism: early type 1 scanning, which runs before ACPI is parsed and dispatches into vendor fixups keyed on a vendor/device/class triple read straight out of host-controlled config space.early_quirks()is the only caller of theearly_qrk[]handlers, so disabling it removes that code path rather than deferring it. GPU drivers bind during normal PCI enumeration and do not depend on it, and Intel's confidential-computing guest hardening names early PCI code as something to disable.If a B300 bring-up turns out to need
pci=noearlyremoved as well, that should be a separate change with its own evidence — this PR is the minimal one that is provably required.Security note
Restoring MMCONFIG re-exposes ~15 extended-capability parsers (SR-IOV, AER, ACS, DOE, Resizable BAR, ...) to host-controlled data. Scoping that honestly:
PCI_FIND_NEXT_EXT_CAPcaps at(4096-256)/8iterations andPCI_EXT_CAP_NEXT()masks offsets to0xffc, so no loop and no out-of-bounds read.dstack-mrindependently regenerates the QEMU ACPI tables and measuresloader/rsdp/tablesinto RTMR0, so a host lying about the ECAM base is detectable — provided the verifier compares against the computed expectation rather than replaying the guest event log.Testing
bash -nandshellcheckonkernel-cmdline.sh.UKI_CMDLINE_BASE).Impact
This changes the measured guest command line. The UKI PE section digests,
metadata.jsonand the derived RTMRs all shift, so attestation baselines have to be refreshed with the image that ships this.Follow-up
The command line is stated independently in the two image backends and only the mkosi path is guarded by the "must not be restated" check in
os/mkosi/tests/acceptance.sh. This PR had to edit both by hand. A cross-backend consistency check would be worth adding separately.