Files
nvdriver/analysis/closed-driver-580/rmapi-memory-kernel-progress.md
nvidia-driver-rs 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

4.5 KiB

RM API memory objects, kernel side: progress log

Scope: OsMemory provider for the driver's own RM API nodes (guest-tested only), mmap of system memory on the control node, guest test. No hardware access in any of it.

2026-11-20 entry 1

  • Done: src/nvidia/kernel/rmapi_memory.rs written (provider KernelOs, thin FFI to C; not yet referenced by any module, so the tree builds as before).
  • In flight: C side in kernel-open/nvidia/rmapi_node.c (nv_rs_rmapi_os_* functions, per-file mapping context, mmap handler).
  • Next action: add the C functions, then reference the Rust file from src/nvidia/kernel/rmapi_node.rs (#[path = "rmapi_memory.rs"] mod memory_os;) and switch execute/close/gpu_release/gpu_remove to the _with entry points.

2026-11-20 entry 2

  • Done: C side in kernel-open/nvidia/rmapi_node.c (allocation records, nv_rs_rmapi_os_*, per-file mapping context, mmap handler with vm_insert_page, leak sweep at node exit); src/nvidia/kernel/rmapi_node.rs now calls execute_with / close_with / gpu_release_with / detach_with with memory_os::KernelOs (submodule by #[path], so tests/vm/rust_backing.rs needs no change); src/nvidia/Makefile got one appended prerequisite line for the new file. cargo check and sh tools/vm/build_guest_test.sh pass (guest module build only; nothing loaded on the host).
  • In flight: guest test tests/vm/rmapi_user_test.c (memory section), then tools/vm/guest_results.py check count.
  • Next action: extend the test, sh tools/vm/build_guest_test.sh && sh tools/vm/build_initramfs.sh && python3 tools/vm/run_guest.py (then --iommu), fix until green; make modules (build only).

2026-11-20 entry 3

  • Done: guest test extended (tests/vm/rmapi_user_test.c, 409 assertions, was 335); first full guest run (python3 tools/vm/run_guest.py, no IOMMU) passes all 409 in both module loads with clean unloads. Two stale assertions of the old test were updated to the core's current answers (0xd01 on the client: 0x57 / 0x31 instead of 0x56; escape 0x4e with an empty block: status 0x23 instead of EOPNOTSUPP).
  • In flight: leak report at node exit (pr_err "nvidia_rs: rmapi memory: ...") and tools/vm/guest_results.py (count 409, the leak text as a failure string).
  • Next action: rebuild guest (sh tools/vm/build_guest_test.sh && sh tools/vm/build_initramfs.sh), run python3 tools/vm/run_guest.py and --iommu, python3 tests/vm/test_result_gate.py, make modules (build only), cargo check.

2026-11-20 entry 4 (work complete; one open item for the owner of rmapi/gpu.rs)

  • Done: leak report at node exit; tools/vm/guest_results.py (409 checks; "rmapi memory:" and bad-page texts are failures); tests/vm/test_result_gate.py count strings. Guest runs python3 tools/vm/run_guest.py and --iommu: both pass, 409 assertions per module load (two loads each), clean unloads, no leak line. Negative control (guest-only copy of the adapter with the context reference never dropped): the exit report fires ("515 pages still allocated") and the gate fails, so the leak check is live. python3 tests/vm/test_result_gate.py OK, cargo check --workspace --all-targets OK, src/nvidia/kernel/run-host-fixtures.sh OK (65).
  • OPEN, not mine to fix: make modules builds nvidia_rs.ko but tools/check_kernel_module.py fails no_unsupported_GOT_relocations: four R_X86_64_GOTPCREL memcpy in <rmapi::gpu::Bound as server::Objects>::construct, from the 128-byte copy_from_slice calls of src/nvidia/src/rmapi/gpu.rs lines 915, 954, 1012, 1036 (reply.copy_from_slice(&params[..PARAMS]) and back). Present with the provider-less entry points too (scratch build of the kernel crate with execute/close/gpu_release/detach gave the same four sites), i.e. it comes from the core change, not from the provider. The guest build hides it (--max-store-memcpy=4096). Fix needed in gpu.rs: copy those blocks with a byte loop the compiler cannot turn into memcpy (the black_box idiom of the kernel files). Until then the modules step of tools/validate_all.sh fails and the produced .ko must not be loaded.
  • Not done (by design, stated in the code): contiguous runs > 1 page and 64 KiB / 2 MiB granules (0x56); uncached / write-combined page attributes (pages always cached); user pages 0x71 (pinning, 0x56); page-table reservation, BAR1 mappings (0x56); GPU cache flush (counted no-op).
  • Next action: none for this sub-task; the parent fixes gpu.rs and runs tools/validate_all.sh.