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>
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>
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>
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.
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.
- 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.
- 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.
- 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