Files
nvdriver/reports/instance-backing.txt
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

74 lines
4.8 KiB
Plaintext

Owned coherent system-memory instance backing and ordered publication
Production implementation:
mmu/instance.rs owns a DMA Manager and one 4096-byte coherent allocation. It
zeros actual backing, validates all update ranges/alignment/overlap and reads
old contents before mutation. Commit order follows recovered kgmmuInstBlkInit:
optional64-bit VA limit; PDB high32; PDB low32; optional ATS32; optional magic32.
A bounded five-patch recovery journal includes the failing word (a CPU backend
may have copied a prefix). Failed recovery retains journal/backing and blocks
publication. Restoring a previously flushed image requires a new flush.
The owner has explicit Writable/Staged/Flushed/Frozen/RecoveryRequired/Closing
states. Staged blocks cannot yield a device address or freeze. Sysmem flush
performs a checked full CPU fence and then DMA release ordering. Freeze holds a
real mapping pin, blocks all CPU reads/writes and free, and returns a retained
pin. Thaw requires GPU quiescence; the Linux boundary exposes this as unsafe.
Close/unmap/free failures preserve resources for retry. No automatic destructor
frees a block with potential hardware references. Closing never resumes editing.
The caller must retain this owner until explicit successful cleanup.
kernel/instance.rs provides LinuxInstance using the actual LinuxDma coherent
backend. New nv_rs_dma_flush_sysmem in the production C adapter verifies context,
allocation token/metadata and active coherent mapping before mb(). The safe DMA
manager requires its nonforgeable CPU-access permit, no mapping/in-flight pins,
and coherent backing before issuing this flush. It is not a DMA streaming sync,
VRAM/sysmembar, GPU instance-cache invalidation or a TLB completion operation.
Exact-version evidence and aperture distinction:
Original kgmmuInstBlkInit (_nv040832rm, saved REA page-root-write-rea) calls the
bus flush selected by descriptor address space after writing instance fields
unless deferred. Fresh REA _nv039418rm (instance-aperture-rea) returns
(address_space !=2)+1, corroborating source kbusGetFlushAperture: FBMEM->VIDEO(1),
all other descriptor spaces->SYSTEM(2). Source kbusFlushSingle_GM107 first calls
portAtomicMemoryFenceFull for SYSTEM_MEMORY. VIDEO requires the actual bus
sysmembar HAL, except reset/disabled/delegated cases. Our concrete implementation
owns Linux coherent system memory only, so it implements that CPU full-fence
branch; it does not substitute it for a VRAM flush. Per-device DMA/IOMMU addresses
remain independent of CPU physical addresses. NV PDB volatility/format/replay
properties are explicit typed inputs, not inferred from Linux coherence.
No original-host GPU access or original module replacement occurred. The code
prepares unpublished backing; actual root/channel installation, GPU instance
cache invalidation, scheduled channel lifecycle, GPU completion and root-ready
status remain separate work. A valid PDB image plus CPU fence never means CUDA
or GPU readiness. Supplied optional magic/VA-limit fields require recovered HAL
values; this owner does not invent them.
Validation:
Five focused core tests exercise exact write/flush ordering; prefix failures at
all five stores; failure-retaining recovery; required reflush after restoring a
previously flushed image; flush/sync/free failure retention; foreign pin
rejection; overlap/bounds; frozen edit/read/free blocking. Strict core Clippy
passes. Existing 336 shared-root/576 PDB original C vectors remain applicable.
Host tools/test_dma_bridge.sh compiles actual production C adapter source with
mock OS calls:4305 assertions,4096 of which are zero-byte checks rather than
independent scenarios; all allocations/lifetime state drain. Three Rust-C tests
pass. New real Rust->LinuxDma->C test owns both root and instance on a mock PCI
lease, reads actual C backing, compares PDB bytes to copied exact RAMIN-header C
oracle, measures the full fence, rejects preflush/frozen operations, and drains
both DMA contexts/PCI lease. C tests reject null/foreign/forged/unmapped flushes.
Copied RAMIN headers retain MIT notices and hashes in abi/mmu/provenance.json.
All four actual guest cases passed:MSI/INTx with direct DMA and with IOMMU,
each65 outer and35 Rust checks, four clean unloads, no BUG/Oops/WARNING markers.
Guest codegen checks pass with776-byte largest conservative function frame and
no GOT/SIMD/unwind/dynamic-stack violations. Production flags are unchanged.
Strict workspace Clippy and all192 core library tests pass at this validation.
Guest validation is recorded separately in vm-instance-backing.json and current
vm-adapter-*-validation.json; no simulated guest device is presented as NVIDIA.
Negative VM test results remain terminal guest failures before freeing test
workspace, following the existing harness policy; fault cleanup is tested by
core/host fixtures, not claimed by success-only guest runs.