41 Commits

Author SHA1 Message Date
55975512a9 tools/docs: complete closed-world 8-category operation inventory and ownership map (#381 Phase 1 & 4) (#676)
* tools/docs: complete closed-world 8-category operation inventory and ownership map (#381 Phase 1 & 4)

* tools/parity: address all 9 PR #676 review findings (per-arch classes, 580/620 RPC split, full strict metadata)

* tools/parity: address remaining PR #676 review findings (fail-closed RPC sources, R620 boundary, op_id)

* tools/parity: exclude ENGINE_INVALID classes, verify uvm_bridge.c exports and MIG+SMC markers

---------

Co-authored-by: Eric Hartford <eric@quixi.ai>
2026-12-05 21:48:49 -08:00
f3862b6300 drm: implement GEM_EXPORT_DMABUF_MEMORY (24/24 DRM ioctls ported) (#587)
* drm: implement GEM_EXPORT_DMABUF_MEMORY via RM 0x71 external sgt bridge (24/24 DRM)

* rmapi: enforce external_gpu_id on DMA lookups and mirror forwarded GSP devices

* rmapi: keep locally registered memory RM_FREE on native execute_full path

* rmapi: scope local RM_FREE bypass to local UserPages (0x0071) backings only

* rmapi: mirror forwarded GSP peer device on import_slot and clean up local entries on forwarded FREE

* rmapi: recursively free native subtrees on GSP object free and keep UserPages MAP_MEMORY_DMA native

* rmapi: return NOT_SUPPORTED for UserPages MAP_MEMORY_DMA on legacy gsp_bringup sessions

* rmapi: verify client ownership before returning NOT_SUPPORTED on legacy GSP UserPages MAP_MEMORY_DMA

---------

Co-authored-by: Eric Hartford <eric@quixi.ai>
2026-12-05 04:20:19 -08:00
3e93ed8492 gv100: port the OBJTMR constructor _nv059547rm (#480)
engine_construct.rs stated OBJTMR's fields as constants because its
constructor had no body. Port _nv059547rm and the pool initialiser
_nv049710rm it calls (timer/construct.rs) from the disassembly in
reports/objtmr-construct-rea/: byte +251c, the spinlock at +2500 (stored
before its null test; a null lock returns 0x1a), the null list heads
+250/+258, the 96-entry alarm pool from +268 and the 36-entry pool from
+2078 with their free-list heads, the +24b-gated +24f8 event, the retry
count +2510 = 3 and +2520 = 0.

gv100() runs it between Intr and OBJBUS. The engine live oracle now
records these fields (`construct` bytes and new `construct-pointer`
lines) and a focused oracle test compares every store with the object
the original constructs in emulation.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-04 16:16:53 -08:00
5a6ba24e54 Document the production wiring inventory (#460)
Co-authored-by: Codex <codex@openai.com>
2026-12-04 16:16:22 -08:00
b8c7680284 kernel-open: probe class_create/devnode signatures (RHEL 9 5.14 build) (#552)
a2707a4 guards class_create(name) and the const-device class.devnode
callback in rmapi_node.c with LINUX_VERSION_CODE >= 6.4 / 6.2. RHEL 9
backports both to 5.14, so the #else branch is taken there and the
module fails to build (-Werror=incompatible-pointer-types, too many
arguments to class_create).

Probe include/linux/device/class.h in compat_probes.mk instead, keeping
the version check as the fallback for unprobed (host-fixture) builds,
and record the guard in docs/KERNEL_COMPAT.md.

Co-authored-by: TheWeakShall <22898767+TheWeakShall@users.noreply.github.com>
2026-12-04 16:15:23 -08:00
1f97fe0223 reports: update local validation reports and 580 parity ledger JSON 2026-12-04 19:30:58 +00:00
37a6e160ae tools: run the GP106 oracle areas from validate_all.sh
The 19 areas of tools/gp106/check.sh, which hold all 26 GP106 opt-in
(#[ignore]) comparisons against the 580.178.04 instructions, were run by
nothing: not by validate_all.sh, not by the Makefile. They only ran when
someone typed the loop from reports/gp106-core-validation.md, and that
loop left out pte-policy.

check.sh gains an `all` area that runs every area in order and stops at
the first failure. validate_all.sh runs it as the optional step
gp106_oracles, next to gsp_620_headers. Missing prerequisites follow the
existing optional-step rule (exit 2 is SKIP, as in test_native_compute.sh
and oracle_gsp_620.py): `all` exits 2 before running anything when the
interpreter cannot import Unicorn and pyelftools, or when
resolve_580_binary() finds no original object. A present object with the
wrong digest, a generator error or a Rust mismatch is still FAIL. The
interpreter default is the top-level Makefile's REA_PYTHON default.

The report now documents `check.sh all` in place of the hand-written
loop. The step count in AGENTS.md, CLAUDE.md and docs/GPU_BRINGUP_GUIDE.md
is set to 36, the number of PASS/FAIL/SKIP lines validate_all.sh prints
with this step; those files said 31, 30 and 31 while the script already
printed 35.

Tests: tests/gp106/test_check_all.py covers both exit-2 paths and the
usage line with stand-in interpreters; tests/vm/test_validate_guest_steps.py
covers PASS, SKIP and FAIL of the new step. All six fail on master.

No driver logic changes. On this host `check.sh all` passes all 19 areas
(90 Rust tests, 0 failed) in about 4 minutes cold, 3 minutes warm; BAR2
and the two framebuffer generators are most of it.
2026-12-03 11:24:34 -06:00
65534464e4 Merge pull request #216 from morebrackets/tools/issue-60-verify-580-citations
tools/rea: add zero-Ghidra 580.178.04 citation verifier & complete 11-symbol GSP audit (#60)
2026-12-02 23:39:18 -08:00
3ad207e074 fix(tools,docs): harden verify_580_citations objdump parsing and add repro commands 2026-12-02 23:29:51 -08:00
19fc855e0c tools/rea: add zero-Ghidra 580.178.04 citation verifier & complete 11-symbol GSP audit (#60) 2026-12-01 23:19:42 -08:00
e58bd8ea46 gp106: address PR #183 review findings across BAR2, SEC2, placement, and oracles 2026-12-02 12:33:45 +08:00
fee0a70842 test: align GP106 BAR2 oracle default binary fallback with shared scripts 2026-12-02 11:49:02 +08:00
17c56d6b5d gpu: narrow GP106 HAL and BAR2 selection 2026-12-02 10:44:24 +08:00
57d74995ee test: make GP106 core oracle checks reproducible 2026-12-02 10:25:47 +08:00
c26fba0135 Merge pull request #124 from LIghtJUNction/pr/edition-2024
Rust Edition 2024 migration (mechanical only)
2026-12-01 15:36:09 -05:00
e7a1a5a41f Wave 9: 0-gap R620 controls, 64KiB GSP RPC, multi-gen GSP-RM routing/reset/ABI, real GspSystemInfo 2026-12-01 19:46:04 +00:00
97205dfd2a Merge upstream/master (Wave 8) into pr/edition-2024
Resolve merge conflict in src/nvidia/kernel/rmapi_node.rs and update
new Wave 8 extern "C" blocks in adapter_start.rs and gsp_bringup.rs
to Rust Edition 2024 syntax.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-12-02 03:39:43 +08:00
30ff549824 Merge upstream/master into pr/edition-2024
Resolve merge conflicts in src/nvidia/kernel/pmu_bringup.rs and
src/nvidia/kernel/rmapi_node.rs against Wave 6/7 (7f7021e), preserving
all upstream logic while keeping Rust Edition 2024 syntax.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-12-02 03:36:42 +08:00
a93577ae92 Wave 8: WPR_INFO 0x100cd4, 3-tier VRAM sizing, Maxwell/Pascal RM/UVM/BAR1 USERD, PCI bus master 2026-12-01 19:35:13 +00:00
7f7021e218 Wave 7: complete RM escape dispatch (0x27-0x5f/0xd5/0xd8) and x86_64/ARM64 kernel hardening gates 2026-12-01 19:19:30 +00:00
e83dd0ee5f Wave 6: live channel teardown, hot-unplug UAF fixes, PCE2LCE topology, real FBPA ECC + HbmSession 2026-12-01 19:03:54 +00:00
32c8728037 Migrate the workspace and kernel crates to Rust edition 2024
Mechanical, behavior-neutral: edition/resolver keys, unsafe extern blocks,
unsafe(no_mangle)/unsafe(export_name), unsafe blocks inside unsafe fn,
r#gen renames, --edition flags in Makefiles/tools, rustfmt style_edition
pinned to 2021 so formatting stays edition-independent, and clippy
collapsible_if allowed workspace-wide (let-chain churn).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-12-02 01:52:38 +08:00
87cbefa8b0 gsp: stop leaking boot DMA and accept the real payload size
Review findings on the payload split: the DMA adapter rejected anything over
16 MiB, so the real 30,539,776-byte radix3 container failed before a single byte
was written; and the non-install path, session teardown and the slot-exhausted
install path all freed GSP-visible DMA without stopping the engine first, which
can let a running GSP write into pages the kernel has already reused.

Raise the cap to 64 MiB with the bounds checks intact, and reset the GSP
(kgspResetHw_TU102) before returning any GSP-visible buffer to the allocator,
including the WPR and queue rings. When that reset cannot be confirmed nothing is
released: leaking the buffers is preferable to a device writing into freed
memory. Teardown keeps the reference ordering, since kgspTeardown_TU102 resets
before FWSEC-SB and Booter Unload.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
2026-11-30 17:36:46 -06:00
f6c191c270 gsp: build radix3 page tables and give boot payloads their own DMA
The four boot payload addresses were aliased to the command and message queues,
so GSP-RM read its own rings as a radix3 ELF, a bootloader, an image signature
and a crash-report region. Build the radix3 page tables from .fwimage and give
the signature and crash-report queue separate sysmem buffers, following
kgspCreateRadix3_IMPL and _kgspCreateSignatureMemdesc in 580.178.04.
2026-11-30 16:38:33 -06:00
58655a7fcf Take elf_machine from the Machine header line and commit the verified run
readelf -h prints the Magic line before the Machine line, so splitting on the
first colon captured Magic as elf_machine. Match the Machine line instead.

Commit the report regenerated by the verification run for the four PR #10 review
fixes: py_compile clean, check_irq_mock.sh 20/20, rom-fw fixture C stage
compiles with -Wall -Wextra -Werror, gate green on the current object with the
numbers unchanged (357 data relocations to code, 0 missing pads, 0 mid-function).
elf_machine is now in the report; module_sha256 reflects the .ko currently on
disk. tmp/ added to .gitignore so scratch stays untracked per the Git rules.
2026-11-30 17:39:55 +01:00
42dc565c12 The gate now judges what objtool enforces, and the strict rule stays visible as a count
- check_kernel_module.py: pass condition = every relocation in an allocatable non-executable section that resolves to code must target a landing-pad entry (addend 0). This be objtool's own rule (check.c:4611 accepts a target it knows is not an IBT target), so the gate can be green honestly instead of demanding something rustc cannot deliver.
- Strict every-entry check stays as an informational count (functions_without_endbr = 1332 on the current object) - visible, not a false failure.
- Proven against objtool on four cases, all agreeing: table without pads (both fail), table with branch protection (both pass), forced jump table (objtool errors, the check flags the mid-function relocations), current object (both pass).
- Gotchas written down: readelf pads [18] as one token but [ 5] as two, so flags were landing in the wrong column; objtool returns 0 on warnings unless --werror (CONFIG_OBJTOOL_WERROR=y adds it); the gate disassembles raw (-dr) so names match readelf.
- Gate is green on the current object: 357 data relocations to code, 0 missing pads, 0 mid-function. Counts move with the build, so read them as measured-at-the-time numbers.
2026-11-30 17:39:55 +01:00
94e9bbfeba Nightly -Z cf-protection=branch so the Rust object gets the ENDBR objtool demands
- utils.mk RUST_KERNEL_FLAGS (x86 kernel target) gains -Z cf-protection=branch; the ARM64 branch be left alone — IBT be an x86 CET feature and no BTI was ordered.
- rust-toolchain.toml moved from pinned stable 1.100.0 to nightly, since the flag be unstable. Verified against the tool: rustc --print=codegen-options on 1.100.0 lists nothing for CF protection, and the unstable book lists none/branch/full for the LLVM backend.
- Make RUSTC explicit so the pinned toolchain is what actually runs:
  - utils.mk: RUSTC ?= $(or $(shell rustup which rustc),$(shell command -v rustc)). Resolves the toolchain pinned in rust-toolchain.toml instead of trusting PATH order; still overridable with RUSTC=..., and no hardcoded ~/.cargo path that may not exist on another box.
  - The gotcha that made this necessary is recorded in the scroll: plain rustc here be the system stable 1.100.0 and rejects -Z. Boxes without rustup still fail - honest limit, no magic.
2026-11-30 17:39:55 +01:00
79c943b03f docs: record R4-01 VID0_PWM Level-3 HS-only PLM finding in perf log 2026-11-29 02:50:19 +00:00
f03e4a2f7b docs: record DLCMD_INITPLL=0x20 (40.05/79.40 GB/s NV2 P2P) and reverted CE/MIF tests 2026-11-28 22:32:57 +00:00
4e77c1b9a1 docs: record Round 3 BAR1 WC and NVLink MINION equalization/MIF credit wins 2026-11-28 21:55:57 +00:00
608a45fc31 docs: mark R1-03 reverted after bare-metal multi-peer verification 2026-11-28 20:24:23 +00:00
d4ec973fc8 docs: record GV100 performance optimization results and experiment ledger 2026-11-28 20:12:44 +00:00
ea605a1009 feat(gv100): automatic NVLink 2.0 bring-up, MIF/TLC init, and PMU HSHUB P2P routing 2026-11-28 16:13:50 +00:00
351779e571 Add default-on live GV100/V100 HBM2 memory-clock unlock (1053 MHz) and credit arikamidotnet / FBR-RAM-Downloader 2026-11-28 04:59:49 +00:00
c8deffec5d Add native /proc/driver/nvidia/{params,version,gpus/<bdf>} procfs entries for bare-metal runtime 2026-11-28 04:43:17 +00:00
321278a032 Bump Turing-Blackwell-Rubin GSP-RM path to 620.70.06 (MCTP+NVDM+GMCAPI, GR100, C-header oracle) 2026-11-28 04:33:24 +00:00
a209eced9d Port ATS THP fault coalescing, client-close sysmem pool trim, force_p2p, resize-bar1, and MOK install.sh 2026-11-28 02:22:41 +00:00
96617ab4af Wire live GSP-RM, Maxwell/Pascal, Display/KMS, MIG & PMU runtime + port NVSwitch/IMEX, unlocked SR-IOV/vGPU, DP-MST/VRR/HDR10/SLI, InfoROM/BIT/DCB & Tegra descriptors (119/119 Unicorn+E2E oracles, 5/5 live V100 VFIO PASS) 2026-11-28 01:40:57 +00:00
6543601569 Port remaining 580.178.04 subsystems to Rust with 82/82 Unicorn binary oracles (GSP-RM, Display/NvDisplay/Modeset, Maxwell/Pascal, PMU/MIG/CSL/ECC/AER/RDMA, 6,288 multi-state RM control cases) 2026-11-27 23:59:02 +00:00
4b6a77d90f Clean-room Rust NVIDIA 580.178.04 driver: GV100 0-diff parity (8-GPU PyTorch/NCCL/llama.cpp, H.264+HEVC NVDEC/NVENC, 2,096/2,096 RM controls, stock UVM/modeset bridges, artificial restrictions unlocked) 2026-11-27 20:45:30 +00:00
4526e6a816 Baseline: validated 30/30 tree with passing Level 7 hardware regression
- Updated tools/post_reboot.sh to check kernel oops taint bit and stuck driver tasks instead of <86400s uptime
- Level 7 hardware regression passed on 0000:b3:00.0 (module 37e6fa430835eee2b426019db3ad70eeb7a9e9070c09c84bd9b973cf56cbe529, 107 inventory words, 0 static mismatches, CUDA baseline verified before and after)
- Updated .gitignore to exclude build archives (*.a, *.rlib), __pycache__, and raw trace dumps
2026-11-23 23:48:38 +00:00