Files
nvdriver/reports/rmapi-slice5-validation.json
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

228 lines
15 KiB
JSON

{
"scope": "RM API slice 5: memory objects, CPU-side state and oracle only (classes 0x40, 0x3e, 0x50a0, 0x71; escapes NV_ESC_RM_ALLOC_MEMORY 0x27, RM_MAP_MEMORY 0x4e, RM_UNMAP_MEMORY 0x4f, RM_UPDATE_DEVICE_MAPPING_INFO 0x5e; controls 0xd01, 0x503c0104, 0x503c0105)",
"date": "2026-11-20",
"original": {
"object": "nv-kernel.o_binary 580.178.04",
"sha256": "5269a23ffba19a17fe16f076463e7ad4151254659441d1711bee6c6221ff6f4b"
},
"not_run": "nothing was run against libcuda, a CUDA program, any /dev/nvidia* node of the original driver, or a GPU; no bind, reset or module load outside tools/validate_all.sh; no hardware register was written or read by code of this slice",
"oracle": {
"kind": "instruction emulation of the original (Unicorn): tools/check_rmapi_memory_binary.py on the fixture of tools/check_rmapi_binary.py",
"decision": "the RM API fixture was extended rather than the placement harness: a client request needs the resource server, client, device and the constructed MemoryManager. On the GPU the original's attach builds, the original's own MemorySystem/MemoryManager/KernelBus/KernelMemorySystem PreInit and Init bodies run to status 0 and leave the framebuffer region table, the reserved region, the heap and the physical memory allocator (PMA)",
"record": {
"path": "target/rmapi/original-rmapi-memory.txt",
"sha256": "66670fddebbe560f0f073a52b34161fa23a551c830c67c7f2d876463373c11df",
"cases": 7,
"operations": {
"allocations": 1168,
"frees": 895,
"controls": 68,
"maps": 130,
"unmaps": 102,
"mapping_updates": 11,
"os_descriptor_allocations": 73
},
"os_calls_recorded": 1099,
"os_calls_attributed_to_requests_and_compared": 1050,
"regenerated_identically": "tools/check_rmapi_memory_binary.py --check passed after a fresh generation (same bytes); about 3 minutes per run"
},
"earlier_records_unchanged": {
"target/rmapi/original-rmapi.txt": "354d1f9244060af687c581637c45b9e2a4ac9ea9fad965ffd1d5a3485baa2a52",
"target/rmapi/original-rmapi-gpu.txt": "da1bc7fc0f56645f64d5b54abf46a3a40cd2bf9957d8cc406c81a5fa89b6d67a",
"expected": [
"354d1f9244060af687c581637c45b9e2a4ac9ea9fad965ffd1d5a3485baa2a52",
"da1bc7fc0f56645f64d5b54abf46a3a40cd2bf9957d8cc406c81a5fa89b6d67a"
]
},
"regions_of_the_oracle_world": {
"allocator": "0x0..0x7eef5ffff",
"internal_heap": "0x7eef60000..0x7fff9ffff (0x11040000 bytes)",
"reserved": "0x7fffa0000..0x7ffffffff"
},
"emulated_original_against_captured_original": "case mem-workload: the 243 memory requests of the capture's last device, with 4 MiB pre-held as in the capture: 58 allocations byte-identical (all allocator offsets), 42 controls, 59 frees, 5 user-page registrations, 38 system-memory maps and unmaps equal; 3 differences: the BAR1 mapping of video memory (0x51 in the fixture, which has no BAR1 address space), its update and its unmap",
"rust_comparison": "rmapi::memory_tests::original_memory_record: every status, reply byte of escape and parameter blocks, destruction order, and every call to the open layer with its arguments; nothing skipped, no mask",
"fixture_decisions": [
"PMA scrub-on-free (pPma+0x298) cleared after heap creation: with it set the original answers client video memory 0x40 until the copy-engine scrubber registers; so freed frames are reusable at once in the record",
"fabricated physical addresses for page allocations",
"no BAR1 address space: a video memory CPU mapping answers 0x51",
"no page-level pools: a non-lazy virtual reservation answers 0x1a and leaks its range (original behaviour)",
"os_page_mask/os_page_shift set after the attach; device file registers the control file before 0x27",
"registers 0x70010 and 0x70004 (absent from the transcript) read 0"
],
"fault_injection": [
"allocator alignment not required to be a power of two",
"first fit ignores the alignment",
"default client page below 2 MiB is 4 KiB",
"no 4 GiB floor for non-fixed virtual requests",
"failed page-table reservation gives the range back",
"GPU-cacheable system memory released without the cache flush",
"mapping offset at the end of the object accepted",
"dependants on the pending-free list only invalidated",
"user pages pinned before the flag checks"
],
"fault_injection_result": "each of the nine made the comparison fail; sources restored byte-identically and the comparison passes (the first attempt at the fifth fault was ineffective and was redone)"
},
"capture_replay": {
"requests_compared": 1395,
"previously_compared": 903,
"requests_not_replayed": 3027,
"mask": [
{
"field": "client handles",
"treatment": "translated"
},
{
"field": "gpuFlags bit 0 (IN_USE) of 0x202/0x205",
"treatment": "masked, 216 bit differences (unchanged from earlier slices)"
}
],
"inputs_taken_from_the_capture": [
"mapping addresses (host physical addresses of system pages; the BAR1 address of the video mapping): the provider returns the captured value, so pLinearAddress is not a compared result",
"the first 4 MiB of each GPU's allocator are seeded as held (UVM's allocations precede libcuda's): with that, all 32 video memory offsets are compared exactly",
"the allocator region 0x0..0x7eef5ffff from the oracle world (same board model)"
],
"new_in_this_slice": {
"alloc 0x003e": 76,
"alloc 0x0040": 32,
"alloc 0x50a0": 16,
"alloc 0x0071 through the device node": 10,
"escape 0x4e": 78,
"escape 0x4f": 78,
"escape 0x5e": 2,
"control 0xd01": 78,
"control 0x503c0104": 2,
"control 0x503c0105": 2,
"free of a GPU-bound object": 118
},
"notes": "the third capture holds no allocation parameters; 0xd01 and maps of 0xc361 and 0x90e6 stay unreplayed (no class yet)"
},
"rea_readings": [
"REA Ghidra procedure_assembly _nv043790rm (alignment rule; COMPR is attr bits 13:12; ALIGNMENT_FORCE 0x1f)",
"capstone on the relocated object: call order in _nv060578rm (_nv051433rm at +0xef9, _nv043803rm +0x13d5, _nv060574rm +0x1405); power-of-two test of the alignment in _nv051433rm +0x272",
"by the mapping-notes subagent (REA procedure_assembly): _nv054155rm, _nv054198rm, _nv019591rm, _nv039293rm, _nv039290rm",
"by the channel-requirements subagent: _nv040005rm, _nv039890rm, _nv040055rm, _nv039941rm (tail call), _nv039920rm"
],
"heap_policy": "client video memory comes from the physical memory allocator, not from the framebuffer heap that mmu/placement.rs models: bottom-up first fit over 64 KiB frames in region 0 (below the internal heap), aligned to max(request alignment, page), page 2 MiB from 2 MiB else 64 KiB; details and evidence classes in notes 10.2",
"implemented": {
"classes": {
"0x40": "memory::video, [A] call order and alignment, [E] 466 rule requests + 420 placement requests",
"0x3e": "memory::system, [E] 195 requests",
"0x50a0": "memory::virtual_memory with the address heap, [E] 205 requests",
"0x71": "node alloc_os_descriptor + memory::os_descriptor, [E] 73 requests"
},
"escapes": [
"0x27 (class 0x71 only)",
"0x4e",
"0x4f",
"0x5e"
],
"controls": [
"0xd01",
"0x503c0104",
"0x503c0105"
],
"server": "dependants on the pending-free list are freed for good, others invalidated ([E]; the slice 4 record is still reproduced)",
"workload_commands": {
"total": 68,
"implemented": 37,
"unavailable": 31
}
},
"provider_trait": "rmapi::memory::OsMemory; table with the original function, the kernel wiring and the hardware each method needs in notes 10.7; hardware-side methods: flush_gpu_cache (BAR0 0x70000, 0x70010, 0x70004), reserve_page_tables (page-level pools, BAR2), map_video/unmap_video (BAR1 level, specified in notes 10.7 and rmapi-memory-mapping-notes.md 5)",
"not_done": [
"explicitly non-contiguous video memory and the non-contiguous fallback when it would succeed: 0x56 (page lists are not visible in replies)",
"video memory CPU mapping: stops at OsMemory::map_video; the BAR1 level does not exist",
"GpuFacts.video is set by nothing in the kernel: 0x40 answers 0x56 on the node",
"scrub-on-free and its copy-engine scrubber; eviction; blacklisted pages",
"user I/O memory through 0x27; the IOMMU mapping of registered user pages",
"the legacy NVOS02 path of 0x27 for classes other than 0x71",
"0x50a0 in a device's own address space (VA mode 0/1)",
"combinations of refused mapping flags; the status order between flag, range and handle errors of 0x4e",
"0xc361 and 0x90e6 and their BAR0 mappings (never done in an earlier slice either); so 16 of the workload's 55 0xd01 calls stay unanswerable",
"dup of memory objects (rm_gpu_ops dup_memory), the two system-memory controls 0x3e010x",
"sizes whose page array exceeds the fixture's allocator were not explored for 0x3e and 0x71"
],
"oracle_check": "tools/check_rmapi_memory_binary.py --check passed after a fresh generation (same bytes); about 3 minutes per run",
"kernel": {
"nodes": "unchanged: /dev/nvidia-rs-rmapi-ctl and /dev/nvidia-rs-rmapi-gpu<minor>",
"provider": "src/nvidia/kernel/rmapi_memory.rs (KernelOs) over kernel-open/nvidia/rmapi_node.c; written by a subagent, C adapter reviewed by the main agent",
"implemented_without_hardware": "0x3e with non-contiguous 4 KiB pages (alloc_page, zeroed, 64 MiB cap), kernel mapping of notifiers, NV_ESC_RM_MAP_MEMORY with the per-file mapping context, mmap by vm_insert_page with the offset and range rules, unmap, update, 0x50a0, 0xd01",
"answers_0x56": "0x40 (GpuFacts.video is never set), 0x71 (no pinning), contiguous or big/huge system memory, video memory mapping, non-lazy virtual reservation",
"deviations": [
"cache type recorded, not applied (always cached mappings)",
"private mmap refused (the original forces shared)",
"flush_gpu_cache is a counted no-op (needs BAR0 0x70000, 0x70010, 0x70004)",
"64 MiB cap is below the workload's 80 MiB buffer"
],
"registers_read_or_written_by_this_slice": "none",
"never_executed_on_the_host": "the new paths ran in the QEMU guest only; the host live step loads the module and opens no RM API node",
"module_build_fix": "128-byte block copies in rmapi/gpu.rs go through a black_box byte loop: the first module build had four R_X86_64_GOTPCREL memcpy relocations in Bound::construct (tools/check_kernel_module.py)"
},
"guest": {
"assertions_per_module_load": 409,
"previously": 335,
"configurations": "with and without the emulated IOMMU, two module loads each",
"negative_control": "a guest-only build that never drops the context reference made the leak report fire and the gate fail (subagent)"
},
"validate_all": {
"script": "tools/validate_all.sh",
"runs": [
{
"result": "30 of 30 PASS, tests passed 717 failed 0",
"note": "one run, on the final sources; no other agent's file failed a step"
}
],
"module_sha256": {
"kernel-open/nvidia_rs.ko": "1833df06ad6e61de9307604ea30e4a54221657ac743d8d419fcd7d52d0aa8db3",
"target/vm-module/nv_rs_edu_test.ko": "d2d24cbea9a6071ac0391ab781d8fc2ee6d0b204609d3a5614d68ec3d5132a91"
},
"vermagic": "5.15.0-203-generic SMP mod_unload modversions",
"host_after": "kernel taint word unchanged (12289: proprietary, out-of-tree, unsigned; no oops bit); nvidia_rs not loaded",
"also_run": [
"tools/generate_rmapi_tables.py --check",
"tools/check_rmapi_binary.py (both earlier records regenerate with unchanged SHA-256)",
"tools/generate_rmapi_class_db.py --check",
"tools/extract_rmapi_memory_workload.py --check",
"tools/check_rmapi_memory_binary.py and --check",
"rmapi::oracle_tests, rmapi::gpu_tests (439 allocations, 260 frees, 307 controls: unchanged), rmapi::memory_tests, rmapi::replay_tests with --include-ignored: 35 tests pass"
],
"caveat": "validate_all.sh does not run the oracle targets of the Makefile; they were run by hand as listed. The module contains whatever other agents' files held at build time"
},
"study_files": {
"analysis/closed-driver-580/rmapi-memory-constructor-spec.md": "public-source decision spec of the four constructors (subagent, [S]); two of its statements were corrected by the oracle: COMPR is attr bits 13:12 (not 9:8), and the page-table reservation of a non-lazy 0x50a0 request fails after the range is allocated",
"analysis/closed-driver-580/rmapi-memory-mapping-notes.md": "mapping escapes, open-layer mmap rules, BAR1 level (subagent; [A] for five functions)",
"analysis/closed-driver-580/rmapi-channel-slice-requirements.md": "requirements of the channel slice (subagent; [A] spot checks)",
"analysis/closed-driver-580/rmapi-memory-slice-progress.md": "progress log of this task",
"analysis/closed-driver-580/rmapi-memory-kernel-progress.md": "progress log of the kernel-side subagent"
},
"source_sha256": {
"src/nvidia/src/rmapi/memory.rs": "009817a93a1aaf4c13377157247fe8418bc3e560ffdfe218a1befa0cf1969bad",
"src/nvidia/src/rmapi/memory_tests.rs": "a65ccd875221885c0271dcff4e2de7ae448da827e9e2f14882efff260951d11c",
"src/nvidia/src/rmapi/gpu.rs": "06d65366e87ec2517c4565ff7e248ef0f608c98f26a664f4a5cc72451f0a816d",
"src/nvidia/src/rmapi/node.rs": "9f87cb62fe694b8fe464b6917e389b6f3fab2f73ad5ba50dbb04ca6b62a7ac18",
"src/nvidia/src/rmapi/server.rs": "9331271b1781af361605e6b13134f9db2338725b739fe1a980ffebe75dd539ca",
"src/nvidia/src/rmapi/escape.rs": "5654c84a4afc370fd3fa6db083250fd7af940f68d62b1ee065fda22ab14f34ae",
"src/nvidia/src/rmapi/status.rs": "0e4d7d015ffb6fecf17906e9b0e67de3b2275adbc6d7b84a683eb7d123cf9aeb",
"src/nvidia/src/rmapi/mod.rs": "b4e1a863ff0e77ca06d3090cd1227688ccc82174e57b9262edca8396ea7a8c14",
"src/nvidia/src/rmapi/replay_tests.rs": "a0671c7c00ae3bdf9d19d5ee5b6fdf97d6b34e88752b0f3f567a14769ee5b712",
"src/nvidia/src/rmapi/gpu_tests.rs": "f4bf1d0e67c2b70d6e4db9b57e80c04180e8990ca53957235b9b16ed3793f5fd",
"src/nvidia/src/rmapi/oracle_tests.rs": "261f879b8d31cc0e926409bb2cd869850d1426355e1eae0d36eb015e4c66d424",
"src/nvidia/src/rmapi/server_tests.rs": "02b7a3757090c32765552e18c1790c50b0837f6be9ec900713179aa4a4ac2f02",
"src/nvidia/kernel/rmapi_node.rs": "bfac41368c94e12ef2e9207c84cd269f47ab0c9190ed51c8d6e70e832fdbc5b4",
"kernel-open/nvidia/rmapi_node.c": "f16feb881ebeb9be307122bcc06a151a3d92f31f1eb13708b3ab9077926fd528",
"tests/vm/rmapi_user_test.c": "7863df5e4dc56e01fa73a99853ca2b6cc78b777d3ed7313d298211e0219300d4",
"tools/check_rmapi_memory_binary.py": "24e3e1bec464b3dad02f4b1badf52b9561bf2bd2b4d7d1b3a503e4740155a1a9",
"tools/extract_rmapi_memory_workload.py": "d3b3da92b063c297eb6d570189b4361864f9c997387e27e2ed6b615426f5ba6e",
"tools/rmapi_memory_workload.json": "962e79b90c4126effab22f21d23c0563191fcc936e10b5384d5631b9ec1e9369",
"Makefile": "f13ef63550d56591a24ac83f0bb40d1d4c3a1541c058d4f6150eb5580fe39c90",
"analysis/closed-driver-580/rmapi-implementation-notes.md": "0324bdcb5c8aa423a6e16a4b3895b15e2f078726597aafe1f43c52cf0717f84a",
"analysis/closed-driver-580/rmapi-memory-constructor-spec.md": "a09e42b380e37b2f6a2321d8d310cec4e5e1a8494931ae86002a5e2d5104515b",
"analysis/closed-driver-580/rmapi-memory-mapping-notes.md": "16fd010259fa7c0d2dfaddb96156de8605d307fa2874db11087a9285ba0fae02",
"analysis/closed-driver-580/rmapi-channel-slice-requirements.md": "d4b3c7137ff6186b173536811a6a5d2859912ddc2857ff912b578a259e4ff565",
"src/nvidia/kernel/rmapi_memory.rs": "19b30a6ee983ffed1826a44af273357db43d43c47842959a920e5d3c6d6a7ac7",
"src/nvidia/Makefile": "fa2c4ad6d3f95c735f49b91017175aff845538082bff98dd1edee0d3742a58ae",
"tools/vm/guest_results.py": "00e8e8505c1426b0a7d107a54438c6eb86d54858f23ee678e0e8c8992de8bb9c",
"tests/vm/test_result_gate.py": "24a36f252c376c2d61824886c4a84ffde46e100da4d69c624287ab24f2e1f702"
}
}