Files
nvdriver/reports/engine-cache.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

93 lines
5.9 KiB
Plaintext

Owned engine-cache construction and SOFTWARE route
Implemented mmu/engine_cache.rs and source-layout helpers in engine_discovery.rs.
EngineCache owns fixed-capacity initialized CPU records in caller-provided object
storage. It does not introduce an allocator/backend abstraction or a GPU DMA
allocation for CPU metadata. Published views borrow immutable records; Rust
prevents clearing/rebuilding while a view is live. Opaque per-cache owner cookies
also distinguish separate caches with the same logical GPU ID. These cookies
identify software-cache ownership; they do not grant PCI/MMIO authority.
Construction decodes the existing validated topology, stages hardware rows,
normalizes original CE PBDMA routes, derives the SOFTWARE route, appends its
record and publishes only after the whole table succeeds. Capacity/malformed/
unknown-engine errors retain initialized private staging for diagnostics and
explicit discard/retry. Failed staging is never returned by published(). The
published fast path is idempotent, matching the original existing-pointer path.
Clear requires mutable cache ownership and invalidates software publication;
it never claims GPU/channel work has been quiesced or frees a GPU allocation.
Exact SOFTWARE source resolved, not guessed:
The original constructor chooses the recognized engine with the highest index
in the selected immutable15-row engine metadata table. It is not necessarily
the last PTOP entry, GR, the lowest engine ID or an arbitrary valid runlist.
Complete original-constructor instruction emulation shows GR+CE2 and CE2+GR both
choose CE2; CE0+CE2 chooses CE0 (metadata index12 exceeds CE2 index1); SEC2+CE0
chooses SEC2 (index14). The source descriptor is sampled at the actual entry to
original SOFTWARE helper _nv027763rm.
SOFTWARE record uses descriptor0x95a6f500,FIFO tag0xffffffff,RM type0x2d,MMU fault
ID0xffffffff,host flag0 and name SOFTWARE. It obtains runlist and normalized
PBDMA IDs/count from that actual source row. It copies both ID words, but does
not copy source fault-ID words. Record layout is explicitly repr(C),100 bytes,
and existing translation/status observers consume the published record slice.
Other unused fields are initialized deterministically instead of reproducing
uninitialized source memory.
Original allocation/publication failures were investigated:
_nv027760rm allocates6400-byte scratch then(count+1)*100-byte final storage;
normalizes CE routes, publishes pointer/count, frees scratch and finalizes
SOFTWARE. Under mocked OS allocation failures, scratch failure leaves no live
allocation; final allocation failure frees scratch and leaves null pointer but
nonzero count. Injecting SOFTWARE lookup failure retains a nonnull partial cache
and returns0x57. Rust explicitly withholds publication until finalization, rather
than treating nonnull partial data as a completed cache. The fixed-capacity owner
uses Capacity, not fabricated NV0x51 OS-allocation status. Real GPU-object storage
allocation and its error translation remain the integrating owner's job.
Independent original instruction oracle:
tools/check_engine_cache_binary.py executes the complete original constructor,
metadata mapping/lookup, CE normalization, SOFTWARE helper and table lookup
instructions in isolated Unicorn memory. Original ELF relocations and readonly
data are loaded. OS allocation/copy/bitvector functions, original GPU access/
attachment predicates and register reads use deterministic mocks; allocations
are zeroed in the fixture. No native target or physical GPU executes.
Eight cases cover four success order/metadata combinations, unknown engine after
one valid row, SOFTWARE-finalization failure and two allocation failures. Success
cases also verify an existing cache causes no additional reads/allocations.
See engine-cache-binary.json and engine_cache_vectors.rs.
Defined-field comparisons and inactive-lane audit:
Original constructor scratch arrays copy two PBDMA/fault-ID lanes even when
count=1. The inactive lane may contain prior engine/stack values. Tests compare
all16 data words, count/name bytes and only count-valid ID/fault-ID lanes. This
is an explicit observed-invariant comparison, not full byte equality or a claim
that every original consumer ignores inactive data.
Actual consumers verified: _nv040255rm PBDMA lookup and _nv027765rm CE selection
are count gated; _nv028339rm channel-quiesce loops index<count. Normal RUNLIST
GetPbdmaIds returns pointer/count and its active result is invariant when the
inactive lane changes. SOFTWARE helper copies both lanes without inspecting the
inactive value, so differences can propagate.
A concrete exception is retained: raw GetPbdmaIds selector17 treats the second
ID lane as a column without count gating. Mutating that inactive lane changes
its original status0->0x1f. Rust's typed list API rejects that unsupported
selector. Other recorded direct/indirect consumers have not all been audited;
global semantic equivalence is not claimed. engine-cache-consumer-audit.json
lists verified paths, the mutation counterexample and unverified caller inventory.
Column15 and unspecified allocator/padding observations also remain unproven.
Validation scope:
Four focused tests cover four original success invariant sets, SOFTWARE source,
capacity failure retention/discard/retry, malformed partial staging, empty tables,
idempotent publication, foreign owner rejection and explicit clear. Workspace
strict Clippy passes after focused validation. No root timer/status/ledger/VM or
lifetime integration files were changed in this cache phase.
Remaining integration dependencies:
Place the cache in real allocated GPU-owned storage and bind it to original
access/attachment/lock prerequisites; construct other KernelFifo side metadata
(valid fault-ID bitvectors and counters) and cleanup at that owning layer;
audit remaining raw/inactive-column consumers and unknown/nonhost policies.
Owned channel/group scheduling, non-replayable fault servicing, restart and
submission remain separate. Software publication is not hardware-ready state.