Files
nvdriver/reports/bringup-level8-9-code-review.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

30 KiB

Bring-up levels 8 and 9: kernel-safety and cleanup review

Date: 2026-11-19. Read-only review. Nothing was run on hardware, no module was loaded. Module the stack figures refer to: kernel-open/nvidia_rs.ko, SHA-256 42f120634e19ddaf… (built 22:40 UTC; the reviewed files are not newer than it; three unrelated src/nvidia/src/rmapi files are).

Verdict

One finding meets the brief's BLOCKING definition (a path that skips the unlock without raising the alarm). It needs a slow SEC2, so its likelihood is low, but the fix is small. Seven SHOULD-FIX findings follow. I found no unbounded register-polling loop, no reachable out-of-bounds index or overflow panic on device-provided data in the code I read, no use of BAR2 after unmap, and no double release.

Facts that shape the severity of everything below:

  • Cargo.toml sets overflow-checks = true and the panic handler is ud2 (src/nvidia/kernel/lib.rs:124). Any arithmetic overflow or slice-index panic is a kernel oops, and with panic_on_oops=1 a machine restart.
  • This machine has no IOMMU active (/sys/class/iommu is empty, nothing on the kernel command line). A DMA address is a physical address; a Falcon that still holds one after the page is freed writes into kernel memory.
  • saved PMC enable on this board is 0x42001120 (level 7 reports): bit 14 (SEC2) is clear, so the final PMC restore is what stops SEC2.

Findings

ID Severity Where What is wrong Failing scenario Suggested fix
F1 BLOCKING (by the brief's definition; low likelihood) kernel/acr_bringup.rs:1795-1818, with src/gpu/acr_load.rs:1019-1031 After a load whose SEC2 halt wait timed out, the regions are sampled once, immediately, while SEC2 is still running. If they read clear, no unload runs and no alarm is raised. Nothing stops SEC2 until the PMC restore at the end of direct_bringup (adapter_start.rs:1137), which comes after cleanup, the level 6 host unload, the BAR2 teardown and the inventory log with its firmware request. SEC2 takes longer than default_us (4 s) but finishes. wait_halt_for returns 0x65, load returns Ok(0x65), set_after_load = 0, loaded = false, so unload_result = None; still_set is read microseconds later and is also 0. SEC2 then sets region 1. Result: stage ffff0004, errno -5, no 414300ff note, regions locked, unlock never attempted. The tool reports passed: false (load without a confirmed clear), but the log shows the regions as clear. When the load did not return 0 and SEC2 CPUCTL is not halted: stop SEC2 first (PMC bit 14 off or its engine reset, as level 5 does for NVDEC), then sample. Independently, read both regions once more after cleanup (or after the PMC restore) and raise NOTE_ALARM there; run the unload if that read shows a region set.
F2 SHOULD-FIX kernel/pmu_bringup.rs:2275-2290 (release), 1779-1808 (order), kernel/acr_bringup.rs:1681-1700 Level 9 frees its two DMA allocations whatever the reset sequence and the unmappings returned. The status of pmu_reset_sequence is only logged (1786-1793); cleanup sets complete = false on a failed unmap and frees anyway. In the ACR cleanup the image and the flush page are freed before bus mastering is turned off. A request times out, so the transport is failed and the class Unload returns Err (fallback: reset, deferred = 7). The reset sequence ends early with a status (halt request timeout): the LS PMU keeps running. An unmap then fails part-way (pmu_bar2::unmap returns on the first BAR2 or flush error after surface_va.take(), so there is no retry). The buffer and second surface (0x19d0 and 0x1f5b0 bytes) go back to the page allocator while the PMU's page tables still point at them. Until the ACR unload resets the PMU, any PMU write lands in reused kernel pages. Needs two failures; the result is silent memory corruption on a machine with seven other GPUs in use. Free the two allocations only when the PMU is known stopped (detached, or reset sequence returned 0) and every unmap completed. Otherwise keep them until after the ACR unload and after bus mastering is off, or leak them and report it. In acr_bringup::cleanup, turn bus mastering off before releasing any DMA memory.
F3 SHOULD-FIX src/gpu/pmu_fbq.rs:451-532 (Transport::receive) The message loop has no iteration bound and no timeout check. It ends only when head equals tail, on a rejected or refused message, or on an access error. Every caller's deadline is checked outside it. The PMU posts events as fast as they are consumed (each costs a 0x40-byte BAR2 read and two dev_info lines), or head reads a constant value of 16 or more while all 16 elements hold acceptable messages. The loop never returns; the task spins under the GPU operation mutex, the RM API mutex and misc_mtx. In the runs I could construct it terminates (a never-written element has unit 0 and is refused; a PMU in reset reads head = tail = 0), so this is a missing guard, not a demonstrated hang. Count messages per call and return Err(INVALID_STATE) after 2 * ELEMENTS, or check the caller's timeout inside the loop.
F4 SHOULD-FIX kernel/acr_bringup.rs:1836-1839, 1844-1847; tools/run_hardware_first_open.py:862-875 Two arms report without looking at the cleanup bits: STAGE_UNLOAD_ONLY returns Ok(()), and STAGE_REFUSED returns -95 for a load that an unprovided service aborted after register writes. The tool never tests note 41430072 or the ACR stage; -95 is the errno it expects. Region 1 is set at entry; the unload clears it; bus mastering could not be turned off, or 0x100c10 was not restored, or the DMA context did not close (cleaned != 7). Stage 00080001, errno -95, regions_cleared_after_unload true: passed: true with incomplete cleanup. Add if cleaned == 7 to the unload-only arm; make incomplete cleanup STAGE_FAILED in every arm. In the tool, fail when cleanup_bits is present and not 00000007.
F5 SHOULD-FIX tools/run_hardware_first_open.py:851, 862-871 At --bringup 8 or 9, passed stays true when the requested level did not run: stage ffff0002 (refused) and ffff0003 (not run) are accepted, and so is the absence of every 4143xxxx/504dxxxx note (acr = {} gives loaded = False, pmu = {} gives no failure). Level 9 refuses in prepare (for example REFUSAL_LSFM). The ACR level returns -95 before any write; the open returns EOPNOTSUPP; the tool prints passed: true. The HANDOFF rule "level 9 only if level 8 passed and the regions were confirmed cleared" does catch this for level 8, because regions_cleared_after_unload is then None; the passed field alone does not. Report the outcome of the requested level separately (completed, refused, not run, failed) and set passed false unless the stage note of the requested level is the completed value.
F6 SHOULD-FIX kernel/adapter_start.rs:1133-1141 log_inventory(lease)?, lock_register_io()? and guard.write(PMC_ENABLE, saved)? each return before the PMC enable and bus interrupt-mask restore. The tool always loads with hardware_inventory=1. The path exists since level 1; it matters more now because level 9 leaves PMC bits 12 and 14 changed until this restore. A register read in the inventory fails after level 9 ran. direct_bringup returns; PMC enable keeps the level's value (Graphics off after PostUnload, SEC2 off after its unload) and BUS_INTR_EN_0 keeps the reset's value. Do both restores before the inventory, and do not let a failed PMC write skip the bus-mask write. Collect the errors and return the first one afterwards.
F7 SHOULD-FIX (consequence UNVERIFIED) kernel/dma.rs (no Drop), kernel/acr_bringup.rs:1701-1705, 1751-1755; kernel-open/nvidia/dma_adapter.c:78-90 LinuxDma has no destructor. If close() fails (-EBUSY: a slot still allocated) or the context is dropped on the bus-master refusal path, the C context leaks with a reference on nv_rs_pci. A level 9 allocation could not be released (system_release false), so nv_rs_dma_context_close returns -EBUSY. The kernel reports it (cleanup bit 4 clear, stage failed). At rmmod the PCI object is never released: pci_release_region, pci_disable_device and pci_dev_put do not run. Not traced further: I expect the original driver to fail to claim BAR0 afterwards, and /proc/iomem to hold a name pointer into unloaded module memory. I could not construct a reachable release failure. Give the context a forced teardown (free every slot, drop the PCI reference) for use after bus mastering is off, and call it when close fails.
F8 SHOULD-FIX src/gpu/pmu_fbq.rs:520 reply[..pending.bytes] is a panicking index. It is safe today only because every caller's buffer is at least as long as the request that is pending: execute_on passes the request itself; wait_init and drain pass 0x18 bytes and the only stale pending request is 0x18 bytes; the detach wait passes 0x14 bytes with pending == None. A ? exit from the wait loop (640-657) leaves pending set. A later caller passes a shorter scratch while a stale request is pending and its reply arrives: index panic, ud2, oops, restart. reply.get_mut(..pending.bytes).ok_or(INVALID_STATE)?, and clear pending on every exit of execute_on.
N1 NOTE kernel-open/nvidia/gpu_owner.c:211-219 The whole level runs inside misc_open, which holds the kernel's misc_mtx (the code comment says so; kernel source not checked), plus the RM API mutex and the GPU operation mutex. A hang in a level blocks every open of every misc device on the machine, and misc_deregister in rmmod. No change needed for the run; it raises the cost of F3.
N2 NOTE all wait loops; src/gpu/pmu_level.rs:471-483 Every polling loop I found is bounded by a deadline, but nothing bounds the level as a whole. With default_us = 4 s a run in which every wait times out busy-waits for tens of seconds; the memory-system quiesce alone can take 16 x 4 s. yield_now is a no-op. Not a hang. Each register access takes a mutex, which is a scheduling point under PREEMPT_VOLUNTARY, so I do not expect a soft-lockup report (inference). softlockup_panic and hung_task_panic are 0. Optional: a level-wide deadline after which remaining starts are skipped and only teardown runs.
N3 NOTE kernel/acr_bringup.rs:451-466, kernel/pmu_bringup.rs:616-632, 1320-1325 default_us and GPU+1e18 have no upper clamp (zero is handled: immediate expiry, and level 9 refuses 1e18 = 0). The clock is jiffies (clock_adapter.c:6-11), 4 ms steps. A scaled default (emulation scale 60, or 30 s with compute references) multiplies every wait in N2. Clamp both for bring-up.
N4 NOTE kernel/acr_bringup.rs:1840-1843 STAGE_COMPLETED does not require set_after_load. acr_load::load returns 0 only after check_regions matched, so the two can differ only if the registers changed in between. Load 0, regions read clear right after, unload 0: "completed" although level 9 was skipped. Add set_after_load to the arm.
N5 NOTE kernel/acr_bringup.rs:1684-1697 The flush page is freed even when the write that restores 0x100c10 failed. The register keeps a freed bus address. Bus mastering goes off a few lines later. Skip the release when the restore failed.
N6 NOTE kernel/adapter_start.rs:1256-1322 Every open runs the whole bring-up again; nothing in the kernel latches an alarm. A second open during a run blocks on misc_mtx. A second open after an alarm: region 1 set at entry, so unload only, and level 9 is not called (set_at_entry). Benign. None required.
N7 NOTE kernel/pmu_bringup.rs:530-537 field! hands out &mut to single Persist fields through a raw pointer while a core routine holds another field. I checked each use: no callback reaches the field its caller holds. None found. Keep the rule in the macro comment enforced in review.

What I checked and found sound

  • Loops. Every loop/while in acr_load, acr_load_bar2, acr_unload, nvdec_hs_run, pmu_ls_start, pmu_level, pmu_unload, falcon_ls_start, fecs_mailbox, pmu_bar2 and the kernel wait_init: each ends on a deadline or a fixed count. All timeout constants are 0x65 and match what the providers return. The two lowest_free loops strictly advance. Exception: F3.
  • Timeout sources. A zero interval falls back to default_us; a zero default_us expires at once. jiffies advances in process context with interrupts on.
  • BAR2. nv_rs_pci_bar2_access rejects a null mapping, a misaligned offset and offset > length - 4 under the access mutex, so an access after unmap or out of range is an error, not a fault. nv_rs_pci_bar2_unmap runs once, after upper_levels and the teardown; post_unload touches registers only. Level 9 refuses unless the surface plus 16 pages fits the 16 MiB mapping.
  • Device-provided indices and lengths. Queue positions are checked against 16 before use (pmu_fbq.rs:457, 623); message size is at most 0x30 into a 0x40 buffer; the INIT message's memory offset and size go through wrapping arithmetic and a 128-block cap; the clock and LTC arithmetic uses wrapping operations and guarded divisors; acr_load.rs:1308 subtracts only when store < start.
  • Unsafe blocks in the two files. Storage sizes and alignment are checked before each cast (Workspace, Composed, Bar2Services, Persist); Persist::initialise writes all 22 fields before any read; the MaybeUninit unload inputs are written whole; the image indices in acr_bringup::extra (up to 0x69e7) are below indices level 1 already used on hardware (0x6d29).
  • Locking. Order is misc_mtx, RM API mutex, GPU operation mutex, then the PCI access mutex or the DMA context mutex as leaves. The remove path takes operation then access, the same order. All are sleeping locks; allocations are GFP_KERNEL in process context. runtime_threads::with drops its lock before the callback.
  • Interrupts. No reviewed code writes 0x140/0x144, and both read 0 before and after level 7, so the PMU's interrupt does not reach the registered handler (table-driven Graphics writes not traced).

Stage and cleanup flow

Level 8 (bringup=8)

# Stage If it fails
1 Firmware request; read saved PMC enable and bus mask Return; nothing written
2 Level 3 reset, level 1 MC load, level 2 timer Later levels skipped; continues at 12
3 bar2_bringup: timeout, placement, saved PRAMIN window (reads) Return; nothing written by this step; continues at 12
4 BAR2 map; default window, VA space, commit Map failure: return. Setup failure: upper levels skipped, then 11
5 Level 5 NVDEC Levels 6 and 8 marked not run; 11
6 place_first (model); level 6 host load and unload Level 8 marked not run; 11
7 acr_bringup::run refusal checks (reads only) -95; 11
8 compose (reads); DMA context; bus mastering on -95; 11. Context leaks if only bus mastering failed (F7)
9 Gate; load Any result goes on to 10
10 Region read; unload if set at entry, load returned 0, or a region reads set; region read; alarm; cleanup (image, 0x100c10, flush page, bus mastering, DMA close) cleanup is always reached: there is no ? between the DMA context and it. Gap: F1
11 BAR2 teardown, BAR2 unmap, PRAMIN window restore Unmap always runs; the window write is the last statement
12 Inventory, PMC enable restore, bus mask restore F6

Level 9 (bringup=9)

Stages 1 to 5, 11 and 12 as above. Between them:

# Stage If it fails
6 Level 6 host load Levels 8 and 9 marked not run; host unload not needed
7 ACR refusals, compose, level 9 prepare (reads and allocation only) -95; host unload
8 DMA context, bus mastering, gate, ACR load Level 9 is not called unless the load returned 0, a region reads set and none was set at entry. Then as level 8 stage 10
9 init_locked: fills, two DMA allocations Graphics level still runs; no PMU start; 13
10 Graphics InitLocked and StateLoad Hook not called; StateUnload still runs once the load body ran; 13
11 PMU Load, INIT wait, SEC2 start, FECS/GPCCS start and sizes, drain Each failure skips the later starts; SEC2 unload runs if its started flag is set
12 Graphics StateUnload Always after the hook
13 PMU unload: class Unload, or fallback when it cannot run; reset sequence when asked; cleanup (deferred unmaps, space release, DMA release) No early return between init_locked and cleanup. Gap: F2
14 ACR unload, region read, alarm, ACR cleanup As level 8 stage 10
15 Host unload; Graphics PostUnload if a Falcon start was attempted Always

Level 9 reports completed only with all nine step bits; the ACR result is checked separately.

Stack depth

Method: objdump -dr of kernel-open/nvidia/nv-rust.o_binary; per function, 8 bytes for the return address plus every push and every sub $imm,%rsp (the same conservative count as tools/check_kernel_module.py, which I did not run because it writes a report file); call edges from relocations; the three trait-object calls (Between::run, WhileLoaded::run/prepare, graphics WhileLoaded::run) added by hand; longest path by depth-first search.

Chain Bytes
Level 9, deepest: nv_rs_gpu_first_open … fifo_bringup::level → pmu Level::run → acr_bringup::run → execute → compose → wpr_blob::compose_gv100_into → … → Decoder::compressed 8,928
Level 9, PMU part: … execute → Inner::run → gr_bringup::run → level_body → sequence → Start::run → fecs_discover → start_falcons → bootstrap_os → execute_on → pass → service → receive → surface_read 8,640
Level 8, deepest (same compose tail, without the FIFO hook frames) 7,712

The author's estimate of about 9 KiB holds for the Rust part. Largest single frame: 992 bytes. No recursion on the resolved graph. Not included: the VFS and misc_open frames above the entry (about 1 to 1.5 KiB, estimate), and C callees at the leaves (dev_info, mutex slow path, dma_alloc_coherent with reclaim at about 6.5 KiB depth). My estimate of the total is 11 to 12 KiB of 16 KiB. CONFIG_VMAP_STACK=y, so an overflow is a guard-page fault, not silent corruption. By-value structs: Bar2Services and Persist are built in allocated storage and the frame check on this binary confirms no large temporaries; that depends on the optimiser and must be re-checked on every rebuild.

Not reviewed

  • Whether any register value or sequence is right.
  • wpr_blob, firmware_unpack, and the page-table arithmetic of acr_load_bar2 and pmu_bar2 line by line. A clippy pass with arithmetic_side_effects and indexing_slicing flags 21, 38 and 63 sites in wpr_blob, acr_load_bar2 and pmu_bar2; their inputs are heap-model addresses and container fields, not device registers. I read the flagged sites of the other reviewed core files.
  • The start and unload bodies of falcon_ls_start and gr_fecs_start beyond their loops and flagged lines, including whether a Falcon is left running when a start aborts between its CPU start and its started flag. The notes say the PMC restore covers it.
  • The internals of nvdec_bringup, fifo_bringup and gr_bringup (they ran on hardware at levels 5 to 7); only their hooks and return paths.
  • device_software, the registry, the IRQ adapter, irq.rs beyond the mask-before-register call.
  • Kernel behaviour assumed from memory, not from source: misc_open locking, udelay range, might_sleep as a scheduling point.
  • Stack use of C callees; the kernel log (dmesg is restricted for this user); no tests were run.

Review fixes

Date: 2026-11-19, by the owner of the bring-up path. Nothing was run on hardware. The register sequence of a successful level 8 or 9 is unchanged: every change below is on a failure path, in the order of releases, in counters and notes, or in the tool. tools/validate_all.sh passed 30/30 afterwards (708 workspace tests) with kernel-open/nvidia_rs.ko SHA-256 16bb434b1b1565a4f230e9388e0cc12a7a03f1621ee16274319d4917ab26d934 (guest module 99f6f7b0ad69b3d1ecaf1f8d1eb1e65f851dd919c0d2b34fdb35340a00d0edf5); the oracle tests of the touched core modules pass with --include-ignored (acr_load 573-case comparison, acr_unload, pmu_fbq, pmu_events, pmu_irq_service, pmu_unload). Neither level has run on hardware, before or after these changes; both still need the user's explicit yes.

ID Fix Where Test
F1 After a load that did not return 0, SEC2 is read; unless it is halted it is stopped before the regions are sampled, with acr_load::stop_sec2: the disable phase of the Falcon reset _nv028467rm(gpu, falcon, 0) (interrupts masked and cleared, PMC enable bit of the engine off, engine reset register pulsed, scrub wait). That is the second of the three reset phases every launch itself starts with, so it is covered by the load oracle there. Note 41430033 says whether the stop completed, whether PMC enable changed and whether SEC2 then reads as disabled or halted; 41430034 holds PMC enable. A stop that is not confirmed raises the alarm and fails the level. The regions are read again after the unload, an unload now also runs when that read shows a region set and none had run, and they are read once more as the last access of execute after cleanup (note 41430073) and once more after the final PMC restore of direct_bringup at levels 8 and 9 (note 41430076). A region set at any of these raises 414300ff and fails the level and the open. core gpu/acr_load.rs (stop_sec2), gpu/level_guard.rs (Regions, unload_due); kernel acr_bringup.rs (stop_running_sec2, execute, regions_clear_at_end), adapter_start.rs acr_load::tests::stopping_sec2_clears_its_enable_bit_before_anything_else_is_read (write sequence on the load test model; nothing written when the bit is already clear); level_guard::tests::a_region_set_at_any_sample_raises_the_alarm
F1, what the original does Read from the Rust that matches the load oracle and from _nv028467rm's reproduced body, not from a new REA reading: after a halt wait that timed out the launcher writes nothing to SEC2 (it only restores register index 1 and returns 0x65 with Falcon+3b1 still set). The original has no reset at that point; the next launch, or the shutdown, resets the Falcon through the same _nv028467rm phases. The stop used here is therefore a replacement-only call of an original routine, at a place the original does not call it.
F2 ACR cleanup: order is now flush register, bus mastering off and read back, then the image and the flush page, then the DMA context. Memory is freed only when level_guard::dma_release allows it: bus mastering confirmed off, or the PMU reads as halted. Otherwise it is kept and note 41430074 names what was kept. Level 9 cleanup: the buffer and the second surface are freed by the level only when the PMU is known stopped (its Unload detached it, or the reset sequence returned 0) and every unmapping and the space release completed; otherwise they stay allocated (note 504d0078, step bit 8 not set, level fails) and the ACR cleanup, which runs after the ACR unload reset the PMU, frees them once bus mastering is confirmed off (note 41430075, forced close) or reports the leak. gpu/level_guard.rs (Reach, dma_release); kernel acr_bringup.rs::cleanup, pmu_bringup.rs::cleanup level_guard::tests::memory_is_freed_only_when_the_device_cannot_reach_it; the kernel glue has no host test
F3 Transport::receive takes at most RECEIVE_LIMIT = 32 messages (twice the queue) per call and then returns Err(INVALID_STATE); a new call starts a new count. No time check was added inside the loop: the provider has no call for one that the oracle rows contain, and every caller already checks its own deadline between calls, which the cap now makes reachable. With an element read and a handler call per message the cap bounds one call to 32 such steps. gpu/pmu_fbq.rs pmu_fbq::tests::a_queue_that_never_empties_ends_the_call; the oracle comparison transport_matches_the_original_instruction_oracle and the transcript test still pass
F4 An incomplete cleanup (cleaned != 7) is STAGE_FAILED in every arm, including unload-only and refused. STAGE_COMPLETED also requires that the regions read as set after the load (N4). kernel acr_bringup.rs::execute covered on the tool side by tools/bringup_verdict.py --check; no host test of the kernel arm
F4, F5 The pass rule for levels 8 and 9 is a function with its own check (tools/bringup_verdict.py, 20 cases, make check line): passed is false unless the requested level logged its completed stage; missing notes, refused, not run and unload-only fail; cleanup bits absent or incomplete after any write fail (41430072 must be 7, 504d0075 must be 0x3f); regions not confirmed clear at the end of cleanup or after the final restore fail; kept or leaked memory, an unconfirmed SEC2 stop and a spent start budget fail. The report gains requested_level_outcome. Note 4d4300fe (restore failed) also fails the run. tools/bringup_verdict.py, tools/run_hardware_first_open.py python3 tools/bringup_verdict.py --check
F6 The inventory is still logged before the restore (its values are the level's state, which the tool compares), but its result no longer returns early: the PMC enable write and the bus-mask write are both attempted whatever the inventory, the first lock attempt (retried once) or the other write returned; the first error is reported afterwards, and note 4d4300fe is logged when a restore did not happen. kernel adapter_start.rs::direct_bringup; gpu/level_guard.rs::first_error level_guard::tests::the_first_error_of_all_attempted_restores_is_reported; the kernel sequence itself has no host test
F7 LinuxDma has a destructor that frees nothing (the device might still reach the memory) and reports the leak with the number of live allocations in the kernel log (nv_rs_dma_context_leaked). New nv_rs_dma_context_force_close frees every allocation and drops the PCI reference; LinuxDma::force_close is unsafe and used only after bus mastering was confirmed off. The bus-master refusal path of the ACR level now closes its empty context instead of dropping it. A leak that remains possible (bus mastering could not be turned off and the PMU is not halted) is reported by notes 41430074 and by the destructor. kernel-open/nvidia/dma_adapter.c, .h; kernel dma.rs, acr_bringup.rs; kernel/verify-object.py allow-list tests/dma-mock/fixture.c::forced_close (in tools/test_dma_bridge.sh): close refused with live allocations, leak report, forced close frees both and returns the PCI references
F8 The reply copy uses a checked sub-slice (INVALID_STATE on a short buffer). execute_on clears pending on every exit: the wait is a helper whose result is examined after the clear. gpu/pmu_fbq.rs pmu_fbq::tests::a_reply_for_a_longer_request_is_refused_not_indexed, a_failed_wait_leaves_no_pending_request
N2 Level 9's starts (INIT wait, SEC2 start, FECS/GPCCS start and size queries) share one wall-clock budget of 8 default intervals, each interval capped at 30 s (level_guard::Budget). While it runs, every deadline the level's provider hands out is cut at the budget, and a start that would begin after it is skipped (note 504d0079 with the step). The teardown is not under the budget. gpu/level_guard.rs; kernel pmu_bringup.rs (Persist::budget, PmuIo::deadline, start_timer, Start::run) level_guard::tests::the_budget_cuts_waits_and_stops_further_starts
N5 The flush page is released only when 0x100c10 was restored or bus mastering is confirmed off. kernel acr_bringup.rs::cleanup none
"Not reviewed": Falcon running after an aborted start A SEC2 start that was begun counts as a started SEC2: the SEC2 unload runs when started() or when the start was attempted. For the PMU the load's error path already set the started state; for FECS and GPCCS the Graphics StateUnload and PostUnload already run after any attempt. kernel pmu_bringup.rs::Start::run none

Worst-case time under the three mutexes at level 9, with the default interval of 4 s (estimates from counting the timed waits on each path in the core modules, not measurements):

Before After
ACR load before the starts about 4 waits, 16 s unchanged
Starts (PMU load, INIT, SEC2, FECS/GPCCS, sizes) about 20 waits, 80 s; one receive call unbounded 32 s, fixed
Teardown (SEC2 unload 2, Graphics unload 1, PMU detach 1, memory quiesce up to 16, reset sequence 5, ACR unload about 5) about 30 waits, 120 s unchanged: about 120 s
Total about 3.5 minutes plus the unbounded call about 2.8 minutes

Not done, and why:

  • No new REA reading was made for F1; the statement about the original rests on the reproduced bodies and their oracle, as said above.
  • The teardown has no overall budget. Its waits are the ones that make the device safe to leave, and the largest (the per-LTC quiesce) is the original's own loop.
  • N1, N3 (beyond the 30 s cap inside the budget), N6 and N7 are unchanged.
  • The kernel glue (execute, both cleanup functions, Start::run, the end of direct_bringup) has no host test: its decisions were moved into gpu/level_guard.rs and tools/bringup_verdict.py, which have tests, but the calls themselves are compiled and read only, like the rest of acr_bringup.rs and pmu_bringup.rs.
  • The stack figures of this review were not recomputed. stop_running_sec2 and the larger cleanup are separate non-inlined frames off the deepest chains, but that is by reading, not by the frame check.