Files
nvdriver/tools/acr_bootstrap_notes.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

216 lines
40 KiB
JSON

{
"scope": "What the original 580.178.04 driver does on one Tesla V100 (GV100, 0000:b3:00.0) between 'BAR2 bound' and 'FECS and GPCCS running from authenticated images', and how far the Rust sources are from it. Derived by tools/analyze_acr_bootstrap.py from the BAR0 transcript, a run-length extract of the same GPU's BAR1/BAR2 events, the firmware container and the original kernel object. Curated text (step descriptions, code readings, gap table, order, unknowns) lives in tools/acr_bootstrap_notes.json; everything numeric in transcript_observation, container_contents and decoded_structures is recomputed on each run. No GPU was touched for this report.",
"evidence_categories": {
"transcript_observation": "Register and BAR2 accesses recorded by mmiotrace while the original driver ran. Lost-event markers end before Load (see inputs), so the Load and PostLoad windows are complete as far as mmiotrace decodes instructions. rep movsb accesses are recorded with address and length only.",
"container_contents": "Bytes of gv100.fw records and of packed descriptors in the original object's read-only data, decoded with raw DEFLATE.",
"original_code.verified_in_disassembly": "Instruction bytes and relocation targets checked by the tool in the original object on every run.",
"original_code.pseudocode_reading": "Read from Ghidra pseudocode only; inferred, not checked instruction by instruction.",
"existing_rust": "Inspection of src/nvidia/src and of the oracle reports the modules cite.",
"external_knowledge": "Structure layouts or behaviour known from nouveau/nvgpu or the public open-gpu-kernel-modules headers; not established from this driver's code.",
"inference": "Conclusions that combine the above. Each states what it rests on."
},
"blob_entry_names": ["NVDEC", "GPCCS", "FECS", "PMU", "SEC2"],
"wpr_image_note": "One BAR2 mapping at 0x2000 covers the whole image. For each client the driver writes, in this order, the 24-byte WPR header (table at blob offset 0, 24 bytes per entry), the 240-byte LSB header, the 84-byte boot descriptor when the client has one, and the image with 32-bit stores; a 0xffffffff terminator follows the fifth header. Header and descriptor bytes are rep movsb accesses, so only their addresses and lengths are in the trace. Falcon names are inferred from the image contents (boot loader entry constants, exact equality with the FECS and GPCCS fixtures) and from the getters that own the matching descriptors.",
"sec2_hs_descriptor_notes": [
"This is the generic boot-loader descriptor, not the ACR descriptor. ctxDma 1 with codeDmaBase 0x1000 is a Falcon virtual address inside the address space bound through 0x87054 = 0x407fdf78 (instance block 0x7fdf78000), where the 18,176-byte HS image was mapped.",
"reserved[2..3] are 0x482c0008 and 0xffff8c8f: together a kernel virtual address (0xffff8c8f482c0008). The original leaves stale stack or heap bytes there; a reimplementation cannot and need not reproduce them (inference: the boot loader ignores reserved words).",
"signature[] is zero here; the HS signature lives inside the image data (patch location tag 0x3b = 0x3e20 for bundle 0x11430c8).",
"Before the start the driver writes MAILBOX0 = 0xfe, BOOTVEC = 0xfd00 and loads 512 boot-loader bytes at IMEM 0xfe00 with tags 0xfd and 0xfe. After the halt both mailboxes read 0."
],
"acr_descriptor": {
"structure": "RM_FLCN_ACR_DESC (public src/nvidia/arch/nvalloc/common/inc/rmlsfm.h), 0x78 bytes: signatures[4] 0x00, wprRegionID 0x10, wprOffset 0x14, mmuMemoryRange 0x18, regions.noOfRegions 0x1c, regionProps[2] at 0x20 and 0x3c (startAddress, endAddress, regionID, readMask, writeMask, clientMask, shadowMemStartAddress), ucodeBlobSize 0x58, ucodeBlobBase 0x60, vprDesc 0x68.",
"where_it_travels": "It is not the 84-byte DMEM block. _nv016753rm fills a 0x78-byte record that is placed in the HS ACR image's data section; the image (18,176 bytes) is copied to framebuffer memory with rep movsb (full-trace lines in transcript_observation.between_blob_and_sec2_start.hs_image_upload) and the boot loader DMAs it into the Falcon. Its bytes are therefore not in the trace.",
"fields_written_by_nv016753rm": {
"category": "pseudocode_reading (the shift by 8 of the shadow address and the field offsets 0x18 relative to a region record are visible in the disassembly excerpt the tool checks)",
"0x1c noOfRegions": "OBJACR+0x394",
"region startAddress": "physical address of the primary allocation >> 8",
"region endAddress": "(physical address of its last byte + 1) >> 8",
"region regionID": "1-based loop index",
"region readMask, writeMask, clientMask": "words +0, +4 and +0x10 of the 0x38-byte region record at OBJACR+0x3a0",
"region shadowMemStartAddress": "physical address of the shadow allocation >> 8 when OBJACR+0x386 is set, else 0",
"0x10 wprRegionID, 0x14 wprOffset": "filled by _nv016932rm from the registered request with id 1"
},
"values_expected_on_this_gpu": {
"category": "inference from the WPR readback after the run and the blob size",
"startAddress": "0x7fde800 (WPR start 0x7fde80000)",
"endAddress": "0x7fdf600 if the region is the 0xe0000 bytes mapped for the blob",
"readMask, writeMask": "0xc each: the readback words 0x80000c0 and 0x80000c1 carry 0xc in bits 7:4, the value of LSF_WPR_REGION_RMASK/WMASK in the public header and of lsf_entry.rs AllocationRequest attributes [12, 12]",
"shadowMemStartAddress, clientMask, wprRegionID, wprOffset": "not observable in the trace"
}
},
"sec2_ls_descriptor_notes": [
"Written by the driver itself to SEC2 DMEM 0 after two PMU command/reply exchanges, followed by MAILBOX0 = 1 and CPUCTL_ALIAS = 2. SEC2 CPUCTL reads 0x50 (halted, alias enabled) before the start.",
"codeDmaBase and dataDmaBase are physical framebuffer addresses inside the WPR (ctxDma 6). codeDmaBase is the SEC2 image's blob offset plus 0x200 above the WPR start, which confirms that blob offsets are WPR offsets and that the WPR starts at 0x7fde80000.",
"argc 1, argv 0xff88: an argument block near the top of DMEM. No DMEM write to 0xff88 is in the transcript; who places the arguments is not established."
],
"pmu_arguments_notes": [
"48 bytes at DMEM 0xffd0 (DMEM size 0x10000 minus 0x30), then BOOTVEC 0x5e00, CPUCTL 0x52 and CPUCTL_ALIAS 2. PMU CPUCTL reads 0x50 before the start, so the HS ACR had already placed the LS PMU image and boot loader.",
"word 0 = 0x202fbf00 = 540,000,000 (a clock frequency in Hz by its value). Words 7 and 9 are 0x4000000 and 0x20207a00; the rest are zero.",
"The public headers of this release do not define the PMU argument structure. nvgpu's pmu_cmdline_args (cpu_freq_hz, trace buffer, secure mode, gc6 context, super surface memory descriptors) starts with the frequency too, but the remaining words were not matched to it. Treat the layout as unknown; a byte-identical block can be replayed only if the two non-zero words turn out not to depend on run-time addresses."
],
"hal_values": {
"OBJACR": {"+0x37f": "1 (RMAcrExecuteOnSec2 default: the HS ACR runs on SEC2)", "+0x385": "1 (use the copy engine for the shadow copy)", "+0x386": "1 (a shadow allocation exists)", "+0x387": "0 (no shared sub-WPR header table)", "+0x388": "0", "+0x391": "0", "+0x392": "0 (primary allocation in framebuffer memory, 128 KiB alignment)", "+0x110": "_nv016753rm", "+0x128": "_nv016931rm", "+0x150": "_nv016745rm", "+0x180": "_nv016923rm", "+0x1f0": "_nv016889rm", "+0x358": "_nv016860rm", "+0x368": "_nv016963rm"},
"OBJSEC2": {"+0x2d8": "_nv055721rm (LS image bundle)", "+0x3a0": "_nv055663rm (HS boot loader bundle)", "+0x3f0": "_nv055933rm (Load)", "+0x50a/+0x50b/+0x50e": "1"},
"OBJBSP": {"+0x260": "_nv018230rm (HS image bundle run on NVDEC)", "+0x288": "_nv018329rm (LS image descriptor)"},
"OBJLSFM": {"+0x100": "_nv043212rm", "+0x118": "_nv043233rm"},
"PMU class (unlabelled, engine ordinal 38)": {"+0x318": "_nv052099rm (LS image bundle)"},
"Falcon object (reports/gpu-acr-falcon-bindings.json)": {"+0x228": "_nv028570rm (direct HS load)", "+0x248": "_nv028470rm (HS virtual-DMA launch)", "+0x250": "_nv028502rm", "+0x1c8": "_nv028764rm (start)", "+0x268": "_nv028781rm (wait)", "+0x2e8": "_nv028579rm"}
},
"pseudocode_reading": [
{"function": "_nv016956rm", "role": "OBJACR Load", "reading": "After policy checks it calls a function of the object at GPU+0x2120 (+0x2f8), OBJACR+0x180 (_nv016923rm) unless the VBIOS object's +0x2cf byte is set, OBJACR+0x128 (_nv016931rm, the bootstrap), _nv016973rm, and, when SEC2+0x513 is set and ACR is not disabled, _nv055814rm (SEC2)."},
{"function": "_nv016931rm", "role": "OBJACR+0x128, ACR bootstrap", "reading": "Writes the WPR image through LSFM (_nv043215rm with the region descriptor at LSFM+0x1a8), calls _nv016747rm, selects the HS image type (1 when OBJACR+0x37f is set and GPU+0x4de4 is zero) and launches it with _nv016741rm, then _nv016974rm and a function of the object at GPU+0x1ec0 (+0x1058)."},
{"function": "_nv043215rm", "role": "LSFM WPR image writer", "reading": "Maps the region (_nv044028rm, flag 0x16), walks the client list: header at index*0x18, LSB header at the client's lsbOffset, boot descriptor (_nv043231rm) only when the Falcon's +0x650 equals 1 and the client has no alternative descriptor, a sub-descriptor for the image (_nv043696rm), image preparation (_nv028614rm, 4,918 bytes: decodes packed descriptors) and the image write (_nv028571rm). Writes the terminator and unmaps (_nv044029rm)."},
{"function": "_nv016753rm", "role": "OBJACR+0x110, region gathering and shadow copy", "reading": "For each region: start and end addresses >> 8, masks, shadow address; then either _nv019039rm/_nv019032rm (copy-engine utility object), _nv044027rm(memory manager, destination = shadow descriptor, source = primary descriptor, size = shadow size, flags 0x40) and _nv019035rm, or the CPU path. The function name string in its lock calls is acrGatherWprInformation_GM200."},
{"function": "_nv016731rm", "role": "OBJACR construct", "reading": "Reads registry values, among them RMAcrUseCeForShadowCopy whose low byte replaces OBJACR+0x385, RMAcrExecuteOnSec2 (+0x37f), RMDisableAcr, RMEnableAcr."},
{"function": "_nv031028rm", "role": "writer of GPU+0x4de4 and +0x4de5", "reading": "Sets the two bytes from _nv030705rm and from bits 13:12 of a configuration register read; the same branches log and set other virtualization-looking flags. Meaning inferred: the GPU runs as a guest device (two kinds). On a bare-metal V100 both are zero, consistent with the trace taking the copy-engine path."},
{"function": "_nv045174rm", "role": "memory-system function that runs the NVDEC HS image", "reading": "Requires the NVDEC object (GPU+0x2080), calls _nv018167rm (reads the bundle from OBJBSP+0x260: tags 0x23/0x18 when 0x24/0x26 are absent, signatures 0xd/0xe, patch tags 0x31/0x32), _nv016965rm (signature placement), then the Falcon's +0x228 (_nv028570rm) or +0x230. Only when that returns 0 does it set NVDEC+0x444 and call the memory-system function at +0xc80; a failure is logged and returned."},
{"function": "_nv046005rm / _nv044383rm", "role": "VPR information read and write around the NVDEC run", "reading": "_nv046005rm reads 0x100cd0 through its index field (start, end, enable bit 4 of index 2, further fields); _nv044383rm writes 0x100cd8 with index 2 and 3 (and 0 and 1 when a VPR allocation exists). The traced writes are 0x2 and 0x3, the branch without an allocation."},
{"function": "_nv055933rm / _nv055814rm / _nv028572rm", "role": "OBJSEC2 Load and LS start", "reading": "Not read in detail. _nv055933rm (1,087 bytes) reaches _nv055814rm (339) and _nv028572rm (868); the traced sequence is two PMU exchanges, an 84-byte descriptor to DMEM 0, MAILBOX0 = 1, CPUCTL_ALIAS = 2."}
],
"rust_findings": [
"The FECS and GPCCS LS images assembled by the existing fixtures (analysis/lsf-580/*-original-image.bin, the reference of gpu/lsf_image.rs) are byte-identical to the two images the original wrote on hardware.",
"The placement arithmetic of gpu/lsf_entry.rs reproduces every traced offset of the five-client image once the bootloader-data reservation is skipped for the client without a boot descriptor (NVDEC). Entry::place has only the branch with the reservation.",
"gpu/wpr_shadow.rs implements the CPU branch of _nv016753rm. The original takes it only when RMAcrUseCeForShadowCopy has a zero low byte or the GPU is a guest device; the traced run used the copy engine. The CPU branch is a legitimate original path, selected by configuration.",
"gpu/falcon_boot.rs (parent of the SEC2 HS launch) and gpu/falcon_imem.rs match the traced order: reset pulses, interrupt mask, instance bind, 84-byte descriptor, 512 boot-loader bytes at 0xfe00 with tags 0xfd/0xfe, MAILBOX0 0xfe, BOOTVEC 0xfd00, start, wait. Their providers (reset, Falcon address space, mapping, DMEM, start, wait) have no production implementer.",
"There is no Rust for the direct HS load on NVDEC (_nv028570rm), for PMU or SEC2 LS image and descriptor handling, for the LS starts of PMU and SEC2, for the PMU request that bootstraps SEC2, FECS and GPCCS, or for a copy-engine utility channel.",
"gpu/pmu_queue.rs, pmu_init.rs and pmu_command_memory.rs implement command and message queues inside PMU DMEM. After the LS PMU start the transcript has no PMU DMEM port access at all up to the end of PostLoad: 0x10a804 and 0x10a4cc advance by one per command or message (0x10a804 wraps from 0xf to 0) while 2,048-byte and 64-byte rep movsb runs appear in BAR2. The LS PMU of this driver uses queues of fixed elements in framebuffer memory, which the Rust transport does not implement.",
"The firmware container lacks every image listed under container_contents.loaded_on_hardware_but_absent_from_container. tools/extract_gv100_firmware.py needs the bundles 0x1146eb0, 0x1143718, 0x1140490 and the descriptor 0x1147220 added; the PMU LS signature source is not identified yet."
],
"external_knowledge": [
"Falcon register names (CPUCTL 0x100, BOOTVEC 0x104, IMEMC/IMEMD/IMEMT 0x180/0x184/0x188, DMEMC/DMEMD 0x1c0/0x1c4, CPUCTL_ALIAS 0x130, MAILBOX0/1 0x40/0x44, ENGINE_RESET 0x3c0, instance bind 0x054) follow nouveau's falcon code.",
"nouveau runs an HS binary on NVDEC ('nvdec/scrubber') on GP102 and later when 0x100cd0 index 2 reports bit 4, to release a VPR left locked. The image the original runs here is a different build with the same role by its position between the VPR reads and writes; its purpose is inferred, not read from its code.",
"LSF_WPR_HEADER (falconId, lsbOffset, bootstrapOwner, bLazyBootstrap, binVersion, status), LSF_LSB_HEADER (192-byte signature block plus twelve words), RM_FLCN_BL_DMEM_DESC and RM_FLCN_ACR_DESC are public (rmlsfm.h, rmflcnbl.h). LSF Falcon ids: PMU 0, FECS 2, GPCCS 3, NVDEC 4, SEC2 7.",
"The 36-byte HS descriptors (tags 0x18/0x19/0x1a) read as nouveau's HS load header: non-secure code offset and size, data offset and size, application count, application code offset and size."
],
"inference": [
{"claim": "The five BAR2 copies are the image parts of one composed WPR image (headers, LSB headers, boot descriptors, images), not separate uploads and not a shadow.", "rests_on": "single mapping, 24/240/84-byte runs at the offsets the LSFM placement arithmetic gives, terminator after five headers, _nv043215rm call order checked in disassembly"},
{"claim": "Four copies exceed every container record because the container omits them: they are whole packed descriptors of the original object (NVDEC LS 230,144; PMU LS 288,512; SEC2 LS 204,544 bytes) and the FECS image, which is assembled from container records (boot loader 0x1149308 + netlist code and data). Only the GPCCS image (17,408) is smaller than the largest record.", "rests_on": "exact SHA-256 equality with decoded descriptors; equality with the FECS/GPCCS fixtures"},
{"claim": "Client order in the image is NVDEC, GPCCS, FECS, PMU, SEC2.", "rests_on": "image identification; the header bytes with the Falcon ids are not in the trace"},
{"claim": "The copy-engine channel copies the 0xe0000-byte primary allocation (the image just written, at 0x7fde80000) to the shadow allocation, both in framebuffer memory. It is not a system-memory to VRAM copy.", "rests_on": "disassembly of _nv016753rm (source = primary descriptor, destination = shadow descriptor, size from the shadow descriptor); the image is written through BAR2 immediately before; the push buffer itself is not in the trace"},
{"claim": "The HS ACR on SEC2 copies the shadow into the region, verifies it and locks the region as WPR; it also places the LS PMU (PMU CPUCTL 0x50 afterwards).", "rests_on": "public field comment of shadowMemStartAddress, WPR registers reading 0x7fde802/0x7fdf403 after the run, mailboxes 0; the firmware's own behaviour is not observed"},
{"claim": "SEC2, FECS and GPCCS are prepared for their LS start by requests sent to the LS PMU; the driver then enables interrupts and writes CPUCTL_ALIAS = 2 itself.", "rests_on": "each start is preceded by PMU queue traffic and finds CPUCTL = 0x50 without any driver write to that Falcon's IMEM/DMEM (SEC2: descriptor only). The request payloads are rep movsb data and were not read."},
{"claim": "The NVDEC run is a VPR scrubber or unlock binary.", "rests_on": "position between _nv046005rm reads of 0x100cd0 and _nv044383rm writes of 0x100cd8; the nouveau analogue. The VPR words read identically before and after (0x1ffff000, 0x1, 0x2a)."}
],
"answers": {
"1_step_list": "transcript_observation.steps: thirteen steps with transcript line ranges, times, full-trace line ranges where BAR2 is involved, and the collapsed register sequence of each.",
"2_what_is_loaded": "transcript_observation.falcon_memory_loads and .wpr_image give sizes, hashes and identification. NVDEC HS: descriptor 0x114b3a8 (3,840 bytes: 0x100 non-secure, 0xd00 secure, 0x100 data with the tag 0xe signature at data offset 0), exact. SEC2 HS boot loader: first 512 bytes of container record 0x1153d60, exact. WPR images: NVDEC 0x1147220, PMU 0x114f6f8, SEC2 0x1153b38 exact whole descriptors (absent from the container); GPCCS and FECS equal the existing fixtures. HS ACR image: 18,176 bytes by rep movsb, content not recorded, size of bundle 0x11430c8 tags 0x24/0x26. WPR layout: header table at 0 (24 bytes per client, room for 0x300 bytes), LSB headers 256-aligned, images 4 KiB aligned, 256 bytes of boot descriptor after an image, total 0xc1000, allocation 0xe0000 (128 KiB alignment).",
"3_nvdec": "Bundle 0x1146eb0 through OBJBSP+0x260, run by _nv045174rm with the direct loader _nv028570rm: PMC bit 15 reset, IMEM 0x100 non-secure at 0 (tag 0), IMEM 0xd00 secure at 0x100 (tags 1..13), DMEM 0x100 at 0, BOOTVEC 0, CPUCTL 2, 21 polls to halt (63 microseconds). The driver reads no mailbox afterwards. In the code the Falcon call's status gates one following memory-system call and is returned; the VPR words are the same before and after.",
"4_descriptors": "decoded_structures: the SEC2 84-byte block is RM_FLCN_BL_DMEM_DESC (virtual DMA, code at Falcon VA 0x1000, data at 0x3f00); the ACR descriptor proper travels inside the HS image and is not in the trace; the SEC2 LS block is the same structure with physical WPR addresses; the PMU arguments are 48 bytes of which only the first word is understood.",
"5_copy_engine": "It copies the WPR primary allocation to its shadow, both in VRAM. The alternative without a channel exists in the original: _nv016753rm takes the CPU-mapping branch when GPU+0x4de4/+0x4de5 are non-zero or OBJACR+0x385 is zero. On GV100 the property is 1 and the constructor replaces it with the low byte of the registry value RMAcrUseCeForShadowCopy when that key exists, so the CPU branch needs that key set to a value with low byte 0. wpr_shadow.rs implements that branch.",
"6_gap": "gap_table and recommended_order."
},
"steps": [
{"id": 1, "name": "NVDEC HS run inside MemorySystem Load", "transcript_lines": [139269, 140316], "sequence_limit": 80,
"summary": "VPR words read through 0x100cd0 (index 0, 1, 2 -> 0x1ffff000, 0x1, 0x2a). NVDEC interrupts masked, PMC_ENABLE bit 15 cleared and set, memory scrub wait on DMACTL, registers 0x84084, 0x85320-0x85330, 0x84134, 0x84674, 0x84624 prepared, DMACTL 0. IMEMC 0x1000000 tag 0: 256 bytes. IMEMC 0x11000100 tags 1..13: 3,328 bytes secure. DMEMC 0x1000000: 256 bytes. BOOTVEC 0, CPUCTL 2, 21 CPUCTL polls until 0x10. VPR words read again (unchanged), then 0x100cd8 = 2 and 3.",
"original": ["_nv046005rm", "_nv045174rm", "_nv018167rm", "_nv016965rm", "_nv028570rm", "_nv028523rm", "_nv028452rm", "_nv028782rm", "_nv044383rm"]},
{"id": 2, "name": "WPR image written through BAR2 (LSFM)", "transcript_lines": [140591, 140620], "sequence_limit": 60,
"summary": "BAR0 shows only PMU 0x10ac08/0x10a100/0x10a108 and SEC2 0x87108 reads and BAR2 TLB invalidates. In BAR2: 1,792 bytes of page-table entries (224 pages), then per client header, LSB header, boot descriptor and image as listed in wpr_image; terminator; a second 1,792-byte page-table run (unmap). 1.24 s under mmiotrace, of which 0.35 s are the image copies; the pauses before the GPCCS, PMU and SEC2 images (0.39 s, 0.05 s, 0.39 s) have no register access (image preparation by inference).",
"original": ["_nv016931rm", "_nv043215rm", "_nv043231rm", "_nv043696rm", "_nv028614rm", "_nv028571rm", "_nv044028rm", "_nv044029rm"]},
{"id": 3, "name": "early FIFO load inside the ACR bootstrap", "transcript_lines": [140621, 140934], "sequence_limit": 60,
"summary": "Bus master off, PMC_ENABLE bit 8 pulsed, bus master on, 0x1140, BAR1 base read, 0x12d0 = 0x2800, then the FIFO setup (interrupts, 14 PBDMAs, 13 runlists, timeouts, 0x2254 = 0x10000000). Same shape as the FIFO Load later at 165084.",
"original": ["_nv019039rm", "_nv019032rm", "_nv043991rm", "_nv028309rm", "_nv028308rm"]},
{"id": 4, "name": "copy-engine utility channel: primary to shadow copy, then HS image upload", "transcript_lines": [140935, 141022], "sequence_limit": 100,
"summary": "Six page-sized allocations zero-filled through BAR2, a page directory (invalidate with pdb 0x7fdf7d0), channel 0 instance block written (USERD 0x7fdf78000, page directory 0x7fdf7dc00), 0x800000 = 0x807fdf77 and enable, runlist 6 with two entries (0x2270 = 0x7fdf76, 0x2274 = 0x600002), USERD put = 1 (BAR2 0x708c), doorbell 0x810090 = 0. 80 microseconds later the channel is disabled, 0x2634 = 0x1000000, unbound, FIFO interrupts and 0x2528 off. Then 18,176 bytes are written by rep movsb at BAR2 0x2000 (the HS ACR image). The push buffer and GPFIFO are not in the trace (system memory by inference).",
"original": ["_nv016753rm", "_nv044027rm", "_nv019035rm", "_nv043854rm", "_nv016741rm", "_nv016905rm", "_nv016965rm", "_nv016748rm"]},
{"id": 5, "name": "SEC2 reset and HS ACR launch", "transcript_lines": [141023, 141316], "sequence_limit": 140,
"summary": "ENGINE_RESET 0x873c0 pulsed three times, each followed by DMACTL polls until 0x1; PMC_ENABLE bit 14 cleared and set once; 0x87084 = 0x140000a1; IRQMCLR = 0xffffffff. Six allocations zero-filled, Falcon address space built (invalidate with pdb 0x7fdf770). ITFEN bit 0, 0x87604, instance 0x87054 = 0x407fdf78, DEBUG1 bit 16, 0x870a4 bit 3, IRQSCLR 8, CTXACK 2. DMEMC 0x1000000: 84 bytes. IMEMC 0x100fe00 tags 0xfd, 0xfe: 512 bytes. MAILBOX0 = 0xfe, BOOTVEC = 0xfd00, CPUCTL = 2.",
"original": ["_nv028470rm", "_nv028467rm", "_nv028746rm", "_nv028420rm", "_nv028379rm", "_nv028759rm", "_nv028457rm", "_nv028456rm", "_nv028523rm", "_nv028579rm", "_nv028764rm", "_nv028502rm"]},
{"id": 6, "name": "HS ACR runs on SEC2", "transcript_lines": [141317, 147252], "sequence_limit": 30,
"summary": "5,922 CPUCTL polls over 17 ms until 0x10, IRQSCLR, three allocations zero-touched (teardown), invalidate, MAILBOX0 and MAILBOX1 read: both 0.",
"original": ["_nv028781rm", "_nv028782rm"]},
{"id": 7, "name": "WPR region readback", "transcript_lines": [147253, 147277], "sequence_limit": 40,
"summary": "0x100cd4 index 2 -> 0x7fde802, 3 -> 0x7fdf403, 0 -> 0x80000c0, 1 -> 0x80000c1, 4 -> 0x1ffffe04, 5 -> 0x5; read twice.",
"original": ["_nv016745rm", "_nv016974rm"]},
{"id": 8, "name": "LS PMU start", "transcript_lines": [147278, 147456], "sequence_limit": 120,
"summary": "CPUCTL reads 0x50. Twice: IRQMCLR, ENGINE_RESET written 0 with ten readbacks, MAILBOX0 = 0, 0x10a134 = 0x20008, 0x10aa74/0x10ae74 = 0, 0x10aa70 = 0x45, IRQDEST = 0xff81ff52, IRQMSET = 0xf3. Address space allocations, ITFEN bit 0, DEBUG1 bit 16, instance 0x10a480 = 0x407fdf7e, CTXACK 2, 0x10ae00-0x10ae10 = 4, 0, 4, 5, 6. DMEMC 0x100ffd0: 48 bytes of arguments. BOOTVEC = 0x5e00, CPUCTL = 0x52, CPUCTL_ALIAS = 2, OS = 0x2498436.",
"original": ["_nv052277rm", "_nv051924rm", "_nv052252rm"]},
{"id": 9, "name": "PMU INIT message and first commands (queues in framebuffer memory)", "transcript_lines": [147574, 147625], "sequence_limit": 60,
"summary": "Message tail 0x10a4cc 0 -> 1, command head 0x10a804 0 -> 1, interrupt clear 0x10a004 = 0x40. No PMU DMEM port access. The stream continues to line 164712 with timer and interrupt polling between replies.",
"original": ["_nv051847rm"]},
{"id": 10, "name": "LS SEC2 start (OBJSEC2 Load)", "transcript_lines": [164966, 165083], "sequence_limit": 100,
"summary": "ITFEN bit 0 cleared, IRQMCLR. Two PMU exchanges (command head 0xf -> 0, then 0 -> 1). IRQMSET = 0xfff2, IRQDEST = 0xfff2, DMEMC 0x1000000: 84 bytes, MAILBOX0 = 1, CPUCTL reads 0x50, CPUCTL_ALIAS = 2, OS = 0x18e6cc3, ITFEN = 7, 0x87134 = 0x20008, 0x87674 = 0, 0x8783c = 0xfe.",
"original": ["_nv055933rm", "_nv055814rm", "_nv028572rm", "_nv028388rm", "_nv028500rm", "_nv055786rm", "_nv055949rm"]},
{"id": 11, "name": "FECS start (KernelGraphics PostLoad)", "transcript_lines": [166380, 166428], "sequence_limit": 60,
"summary": "FECS MAILBOX1 = 0, IRQMCLR, 0x409840 = 0xffffffff, DMACTL = 0, 0x409a20 = 0x80000002. One PMU exchange (head 4 -> 5). IRQMSET = 0xffd2, IRQDEST = 0xfff2, CPUCTL reads 0x50, CPUCTL_ALIAS = 2, ITFEN = 7.",
"original": ["_nv028764rm", "_nv028385rm"]},
{"id": 12, "name": "GPCCS start", "transcript_lines": [166429, 167028], "sequence_limit": 40,
"summary": "One PMU exchange (head 5 -> 6) with timer and interrupt polling while waiting, then GPCCS IRQMSET = 0xffd2, IRQDEST = 0xfff2, CPUCTL reads 0x50, CPUCTL_ALIAS = 2, ITFEN = 3.",
"original": ["_nv028764rm"]},
{"id": 13, "name": "FECS ready wait and first mailbox methods", "transcript_lines": [167029, 167097], "sequence_limit": 80,
"summary": "0x409800 polled until 1 (eight reads), cleared, then methods through 0x409500/0x409504: 0x21 with data 0x3fffffff, 0x10, 0x16, 0x25, 0x1a returning context sizes.",
"original": ["_nv055403rm", "_nv033685rm", "_nv031747rm"]}
],
"gap_table": [
{"step": "0 prerequisites", "what": "BAR2 mappings of framebuffer allocations with TLB invalidate, VRAM allocator near the top of memory, Falcon instance blocks and page directories",
"rust": ["mmu/bar2.rs", "mmu/vram.rs", "gpu/acr_image.rs"], "oracle": "partial (formats and allocation ABI only)",
"missing": "production providers: map, write and unmap an allocation through BAR2, including the page-table entry writes seen as 8-byte-per-page runs at BAR2 0xfae000; zero fill of new allocations",
"original_functions": ["_nv043694rm", "_nv043691rm", "_nv043739rm", "_nv043773rm", "_nv044028rm", "_nv044029rm", "_nv043721rm"]},
{"step": "1 NVDEC HS run", "what": "direct IMEM/DMEM load and start of bundle 0x1146eb0 on NVDEC",
"rust": ["gpu/falcon_imem.rs", "gpu/firmware_signature.rs", "gpu/firmware_unpack.rs"], "oracle": "yes for the IMEM transfer and signature placement; none for the parent",
"missing": "the bundle in the container; _nv045174rm, _nv018167rm, _nv028570rm, the DMEM writer _nv028452rm, NVDEC reset and pre-load register writes (_nv028445rm and the object's +0x220), the wait; the VPR read/write pair around it",
"original_functions": ["_nv045174rm", "_nv018167rm", "_nv028570rm", "_nv028445rm", "_nv028452rm", "_nv028782rm", "_nv046005rm", "_nv044383rm"]},
{"step": "2 WPR image", "what": "five-client image with headers, LSB headers, boot descriptors",
"rust": ["gpu/lsf_image.rs", "gpu/lsf_entry.rs", "gpu/gr_images.rs", "gpu/acr_image.rs"], "oracle": "yes for FECS/GPCCS image, headers, placement and boot descriptor; the two images also equal the hardware trace",
"missing": "NVDEC, PMU and SEC2 clients: images in the container, their LSB header fields (from the 900-byte and 656-byte descriptors and the signatures), their boot descriptors, the client without a bootloader-data reservation, client enumeration order, region registration (_nv016955rm, _nv016940rm, _nv016937rm), and the BAR2 writer",
"original_functions": ["_nv043236rm", "_nv043182rm", "_nv043215rm", "_nv043231rm", "_nv028614rm", "_nv028571rm", "_nv043197rm", "_nv016955rm", "_nv027605rm", "_nv029864rm"]},
{"step": "3-4 shadow copy", "what": "primary to shadow copy and the 0x78-byte ACR descriptor fields",
"rust": ["gpu/wpr_shadow.rs", "fifo/init.rs", "fifo/reset.rs", "fifo/context.rs"], "oracle": "yes for the CPU branch of _nv016753rm; FIFO leaves only",
"missing": "copy-engine route: FIFO load, channel with instance block, USERD, GPFIFO, push buffer with copy methods, runlist submit, completion wait and teardown (the copy-engine utility object and _nv043991rm). The CPU branch avoids all of it but is selected in the original only by RMAcrUseCeForShadowCopy or on guest devices; using it is a deliberate, declared deviation from the traced path",
"original_functions": ["_nv016753rm", "_nv016932rm", "_nv019039rm", "_nv019032rm", "_nv043991rm", "_nv044027rm", "_nv019035rm"]},
{"step": "4-6 HS ACR on SEC2", "what": "HS image selection, signature patch, descriptor patch, upload, SEC2 reset, address space, boot loader, start, wait",
"rust": ["gpu/falcon_boot.rs", "gpu/falcon_imem.rs", "gpu/acr_image.rs", "gpu/firmware_signature.rs", "gpu/mc_reset.rs"], "oracle": "yes for the launch parent (64 cases), IMEM transfer, image packaging prefix",
"missing": "providers behind falcon_boot::BootIo: SEC2 reset _nv028467rm, Falcon address space _nv028420rm and mapping _nv028379rm, instance bind _nv028759rm, DMEM writers _nv028457rm/_nv028456rm, start, wait; the image selector _nv016905rm (4,454 bytes) for type 1 and placement of the ACR descriptor in the image data",
"original_functions": ["_nv016741rm", "_nv016905rm", "_nv016965rm", "_nv016748rm", "_nv016747rm", "_nv028470rm", "_nv028467rm", "_nv028420rm", "_nv028379rm", "_nv028759rm", "_nv028457rm", "_nv028456rm", "_nv028764rm", "_nv028781rm", "_nv028782rm"]},
{"step": "7 WPR readback", "what": "0x100cd4 region bounds and masks", "rust": ["gpu/acr_wpr_region.rs"], "oracle": "yes (4,081 cases) and a unit test with trace lines",
"missing": "caller and comparison against the expected region (_nv016974rm)", "original_functions": ["_nv016745rm", "_nv016974rm", "_nv016973rm"]},
{"step": "8 LS PMU start", "what": "reset, interrupt setup, instance bind, 48-byte arguments, start",
"rust": ["gpu/pmu_reset.rs", "gpu/pmu_dmem.rs"], "oracle": "yes for the reset register and the DMEM port",
"missing": "argument block contents, instance bind and address space for the PMU, the start sequence; the functions are not identified beyond _nv052277rm/_nv051924rm",
"original_functions": ["_nv052277rm", "_nv051924rm", "_nv052252rm"]},
{"step": "9 PMU transport", "what": "INIT message, command and message queues",
"rust": ["gpu/pmu_init.rs", "gpu/pmu_queue.rs", "gpu/pmu_command_memory.rs", "gpu/pmu_reply.rs", "gpu/pmu_sequence.rs"], "oracle": "yes, but for queues inside DMEM",
"missing": "queues of fixed elements in framebuffer memory (element indices in 0x10a804/0x10a4c8/0x10a4cc, 2,048-byte command elements and 64-byte message reads through BAR2), the surface that holds them and its hand-over to the PMU; the request that bootstraps a Falcon",
"original_functions": ["_nv051847rm"]},
{"step": "10 LS SEC2 start", "what": "PMU bootstrap request, 84-byte descriptor, start",
"rust": [], "oracle": "none",
"missing": "everything: _nv055933rm path, descriptor builder for SEC2 (shares _nv043231rm), argument block",
"original_functions": ["_nv055933rm", "_nv055814rm", "_nv028572rm", "_nv028388rm", "_nv028500rm", "_nv055786rm", "_nv055949rm"]},
{"step": "11-13 FECS and GPCCS", "what": "PMU bootstrap requests, interrupt enables, alias start, ready wait, mailbox methods",
"rust": ["gpu/fecs_mailbox.rs", "gpu/gr_load.rs"], "oracle": "partial (mailbox primitives)",
"missing": "the bootstrap request, the pre-start register writes, the ready wait on 0x409800; GR Load before it (netlist register lists, segment 66 of the segment map) is a prerequisite of a usable FECS, not of its start",
"original_functions": ["_nv055403rm", "_nv033685rm", "_nv031747rm", "_nv028764rm", "_nv028385rm"]}
],
"recommended_order": [
{"n": 1, "do": "Extend the container: add bundles 0x1146eb0 (NVDEC HS), 0x1143718 (PMU LS), 0x1140490 (SEC2 LS) and descriptor 0x1147220 (NVDEC LS) to tools/extract_gv100_firmware.py; add a test that decodes them to the hashes in this report.", "why": "nothing after BAR2 can run without these bytes; pure data work"},
{"n": 2, "do": "BAR2 allocation writer on hardware: allocate near the top of VRAM, write page-table entries, invalidate, write, read back, unmap. Validate against the traced invalidate sequence (0x100cb8 = 0x7fffa20, 0x100cec = 0, 0x100cbc = 0x80000005).", "why": "every later step stores its data this way; it can be tested alone with a read-back and no Falcon"},
{"n": 3, "do": "NVDEC HS run: translate _nv028570rm and its DMEM writer, replay bundle 0x1146eb0. Expected transcript: step 1, 992 writes, byte-exact streams with the hashes in falcon_memory_loads.", "why": "smallest complete Falcon launch (no address space, no DMA); proves reset, IMEM, DMEM, start and halt wait on hardware before SEC2 depends on them. Compare the VPR words before and after"},
{"n": 4, "do": "Complete the WPR image for five clients: LSB headers and boot descriptors for NVDEC, PMU and SEC2 from their descriptors, client order, the client without bootloader data. Check offsets against wpr_image and the image hashes; check the SEC2 boot descriptor against decoded_structures.sec2_ls_boot_descriptor with the WPR base substituted.", "why": "host-only work with exact expected values; the SEC2 descriptor is the one header-class structure whose bytes the trace does contain"},
{"n": 5, "do": "Shadow copy by the CPU branch (wpr_shadow.rs) behind an explicit configuration that mirrors RMAcrUseCeForShadowCopy = 0, and record it as a deviation from the traced default.", "why": "avoids FIFO, a channel and the copy engine before any Falcon runs; the branch is original code with an instruction oracle"},
{"n": 6, "do": "SEC2 HS ACR: providers for falcon_boot (reset, Falcon address space and mapping, instance bind, DMEM, start, wait), HS image type 1 with signature and ACR descriptor patched. Success criteria from the trace: halt, MAILBOX0 = MAILBOX1 = 0, 0x100cd4 index 2/3 = start/end of the allocated region, masks 0xc, PMU CPUCTL = 0x50.", "why": "first authenticated step; its outcome is fully observable in registers"},
{"n": 7, "do": "LS PMU start and the framebuffer queue transport, up to the INIT message.", "why": "the PMU is the agent that prepares SEC2, FECS and GPCCS; requires the argument block to be understood first (see unknowns)"},
{"n": 8, "do": "Falcon bootstrap request to the PMU for FECS and GPCCS, then interrupt enables, CPUCTL_ALIAS = 2, ready wait on 0x409800, mailbox methods. SEC2 LS start only if a later consumer needs it.", "why": "this reaches the goal state; SEC2 LS is not on the path to FECS/GPCCS by the trace order (it starts after GR Load and before FIFO Load, and nothing between it and the FECS start touches SEC2 queues)"},
{"n": 9, "do": "Replace the CPU shadow copy by the copy-engine channel when a channel exists for other reasons.", "why": "parity with the default path; not needed for bring-up"}
],
"surprises": [
"The trace does contain the composed WPR image, but its headers are invisible to tools that read only R/W lines: they are written with rep movsb, which mmiotrace logs as UNKNOWN events (1.76 million of them for this GPU's BAR2). The same holds for page-table entries, the HS ACR image upload and all PMU queue elements.",
"Four of the five images and the NVDEC HS image are not in gv100.fw. The 3,584-byte HS record that the segment map matched to the NVDEC run by size (bundle 0x1140830, OBJACR+0x358) is not what runs: the NVDEC image is the 3,840-byte descriptor 0x114b3a8 from OBJBSP+0x260.",
"NVDEC is an LS client of the WPR image (230,144 bytes, first entry) in addition to running an HS image earlier.",
"The existing FECS and GPCCS image assembly and the LSF placement arithmetic are confirmed byte-for-byte and offset-for-offset by hardware.",
"The 84-byte SEC2 block is the generic boot-loader descriptor with a leaked kernel pointer in its reserved words; the ACR descriptor is inside the uploaded image.",
"The copy-engine channel copies VRAM to VRAM (primary to shadow), completes within 80 microseconds, and has an original CPU alternative selected by a registry value.",
"After its LS start the PMU is never accessed through its DMEM port: commands and messages are fixed-size elements in framebuffer memory. The Rust PMU transport targets DMEM queues.",
"SEC2 is restarted in LS mode with a descriptor the driver writes itself, FECS and GPCCS without any driver write to their memories; all three follow PMU exchanges. The HS ACR runs on SEC2, the per-Falcon LS preparation is requested from the PMU."
],
"unknowns": [
{"what": "Bytes of the five WPR headers, five LSB headers, four boot descriptors, the ACR descriptor and the patched HS ACR image as the original wrote them.", "experiment": "Run the original functions in the existing instruction harness (the method of tools/gpu_lsf_entry_oracle.py) with five clients; or capture again with a probe on the copy routine (_nv052695rm / os_mem_copy) that logs source bytes for destinations inside BAR2. A second mmiotrace gives the same gaps."},
{"what": "Layout of the 48-byte PMU argument block and of the SEC2 argument block at 0xff88; whether words 7 and 9 of the PMU block depend on run-time addresses.", "experiment": "Read the callers that fill the block before the DMEM write (start from _nv052277rm/_nv051924rm and the DMEM writer's callers) in disassembly; compare the block across two boots of the original with a read-only BAR0 sampler extended to dump DMEM 0xffd0 is not possible once LS (DMEM is protected), so the code reading is the route."},
{"what": "The PMU requests that prepare SEC2, FECS and GPCCS (unit, command id, payload) and the format of the framebuffer queue elements.", "experiment": "Same copy-routine probe as above for BAR2 destinations 0x10200-0x18500 during PostLoad, or read the command builder: find the callers of the PMU command post routine reached from KernelGraphics PostLoad and OBJSEC2 Load."},
{"what": "Whether FECS and GPCCS can be started with SEC2 left in its post-ACR state (no LS SEC2).", "experiment": "Hardware test at the corresponding bring-up level once steps 1-8 exist; the trace order suggests yes but the firmware dependency is not visible."},
{"what": "Whether the NVDEC HS run is required for the HS ACR to succeed.", "experiment": "Hardware A/B at the SEC2 HS level: with and without the NVDEC run, compare mailboxes and 0x100cd4. The VPR words are identical before and after it in the trace, which suggests it changed nothing on this boot."},
{"what": "Physical address of the shadow allocation and of the HS image; contents of the page-table entries.", "experiment": "Not needed for a reimplementation (they are the allocator's choices) but can be read from PRAMIN or BAR2 under the original driver with the read-only register tool."},
{"what": "What the two 1 MiB allocations and the 31,232-byte allocation zero-filled through BAR2 during Init are (full-trace lines 30877576-32171138, partly lost).", "experiment": "Attribute by call site: the allocation descriptor creators (_nv043694rm) reached from the Init bodies of LSFM, ACR and PMU; the 0xe0000-byte region mapped in Load is a different size, so these are not simply the WPR primary and shadow."},
{"what": "Meaning of GPU+0x4de4/+0x4de5 beyond 'guest device'.", "experiment": "Read _nv031028rm and _nv030705rm in disassembly; not on the bring-up path for bare metal."},
{"what": "Source of the PMU LS signature (bundle 0x1143718 has only the image and a 900-byte descriptor; SEC2's bundle carries a 192-byte tag 0x27).", "experiment": "Inspect the 900-byte descriptor and the callers of _nv052099rm; look for 192-byte descriptors referenced from PMU functions."}
]
}