Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/docs/GB10_FIRMWARE_INVENTORY.md # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / docs / GB10_FIRMWARE_INVENTORY.md` 864 lines · 60118 bytes Raw Blame History Rendered 1 # GB10 firmware inventory (aienos#286 cut C, host work only) 2 3 Report plus one hosted checker. No firmware was loaded, no device was touched, 4 no QEMU run was made. This is the "inventory of firmware and protocol sources, 5 parsers and refusal tests for firmware metadata. No loading" item of 6 docs/GB10_NATIVE_DEPENDENCY_MAP.md section 7. Any firmware load or GSP handoff 7 on the real machine stays an OPERATOR STEP (same document, section 7). 8 9 Tags: [OBSERVED] read on the Spark (Linux 7.0.0-1019-nvidia, 10 nvidia-open 580.173.02) on 2026-10-12. [SOURCE file:line] read in the named 11 file of NVIDIA/open-gpu-kernel-modules at tag `580.173.02` (the same version as 12 the driver on the box; fetched read-only into a scratch directory, not vendored). 13 [DOCUMENTED] quoted from a licence or manual. [INFERRED] reasoned from sources. 14 [UNKNOWN] nothing read answers it. 15 16 ## 1. Plain-English summary 17 18 - This inventory assumes the GPU in the Spark is NVIDIA's "GB10B" chip. Correction 2026-10-26 (NoNvDriver 19 review): that was never measured (PMC_BOOT_42 is unread), and the evidence points at GB20B instead. In 20 580.173.02, GB10B is Thor ("T264/GB10B", uvm_va_space.c:817; Thor is sm_110, the Spark is sm_121), and 21 GB10B's class list has BLACKWELL_COMPUTE_A only (g_gpu_class_list.c:2418-2487) while CUDA++ refuses to run 22 without BLACKWELL_COMPUTE_B and has passing chip receipts on this Spark (CUDApp 23 evidence/FB1-CUT5-HD128-`7dd92dc`). COMPUTE_B appears only for GB202-GB207, GB20B and GB20C. window1-pre.sh 24 now refuses unless window 0 reads CHIP_ID 0x1AB. To run it, three pieces of NVIDIA code have to be put in place 25 in a fixed order: a small signed "first stage" (GSP-FMC) that the SEC2 26 security engine on the chip verifies and starts, which then unpacks and starts 27 the big GSP-RM firmware (the GPU's own resource manager, 75 MB on disk), after 28 which the host talks to the GPU through message queues the GSP-RM serves. 29 - Only the big piece is a file on disk. The first stage, its hash, its signature 30 and its public key are compiled into the Linux driver module as byte arrays 31 (open source, MIT licence, in the public driver repository). The GB10B has no 32 separate "FSP" security processor on the GSP boot path and runs no VBIOS 33 FWSEC step; SEC2 does the work. [SOURCE, section 4] 34 - Everything AIENOS would need to *hand* to the chip is public and 35 redistributable unmodified under NVIDIA's firmware licence and the driver's 36 MIT licence. What is not public is what the chip's boot ROM, SEC2 firmware, 37 ACR and GSP-RM *do* internally, and the signing keys. [DOCUMENTED, section 6] 38 - A hosted checker now exists: `make -C native/kernel gsp-fw-inspect-test` 39 (tool native/kernel/tools/ck_gsp_fw_inspect.c). It parses the firmware 40 container exactly as the driver does, refuses every malformed shape it was 41 given in its self-test (22 mutations plus every truncation), and proves the 42 file on this box matches the pinned digest. It never loads anything. 43 - Two more hosted tools, same rule (nothing is ever sent to the chip): 44 `ck_gsp_cot_encode` builds and checks the exact message the driver sends to 45 SEC2 (section 10), and `ck_gsp_bindata_extract` reads the eight GB10B 46 firmware arrays out of the public driver source with my own inflater and 47 hash code, cross-checks every size, record and digest, and writes them as 48 files (section 11). A fourth, `ck_gsp_boot_args_encode`, builds and checks 49 the five memory blocks the driver hands to the GSP-RM boot (the 256-byte 50 WPR description, the libos argument page, the log-buffer tables, the 51 message-queue arguments and the three-level page table for the 75 MB 52 firmware), with the GB10B values traced line by line from the driver 53 (section 12). A fifth, `ck_gsp_rpc_encode`, builds and checks the message 54 queue itself: the two ring-buffer headers, one queue message with its 55 checksum and sequence numbers, the split of oversize messages, and the 56 packed settings table the driver sends first (section 13). `make -C 57 native/kernel test` runs all five self-tests. 58 - The largest remaining unknowns for a native bring-up (section 8) are the 59 SEC2 command protocol details beyond what the driver source shows, the 60 message-queue (RPC) protocol after the FMC starts GSP-RM, and 61 the state the SoC firmware (UEFI) leaves SEC2 and the GPU in at AIENOS entry. 62 Do not attach a calendar to cut C/D until those are measured on the machine. 63 64 ## 2. Identity of the device and the driver on the box [OBSERVED] 65 66 | Fact | Value | 67 |---|---| 68 | PCI address, id | `000f:01:00.0`, 10de:2e12 rev a1, subsystem 10de:21ec | 69 | Driver's supported-gpus entry | `{"devid":"0x2E12","subdevid":"0x21EC","subvendorid":"0x10DE","name":"NVIDIA GB10","features":[...,"kernelopen"]}` | 70 | nvidia-smi | Product NVIDIA GB10, Architecture Blackwell, VBIOS 9A.0B.2D.00.00, driver 580.173.02 | 71 | /proc/driver/nvidia/gpus/*/information | GPU Firmware 580.173.02, Video BIOS 9a.0b.2d.00.00, DMA 41 bits, IRQ 427 | 72 | Kernel module | /lib/modules/7.0.0-1019-nvidia/kernel/nvidia-580-open/nvidia.ko, 19,231,198 bytes, `license: Dual MIT/GPL`, declares `firmware: nvidia/580.173.02/gsp_ga10x.bin` and `firmware: nvidia/580.173.02/gsp_tu10x.bin` (modinfo) | 73 | Chip arch/impl in the driver | GB10B is `GPU_ARCHITECTURE_BLACKWELL_GB1XX` (0x01A0) implementation `GPU_IMPLEMENTATION_GB10B` (0x0B) [SOURCE src/common/inc/swref/published/nv_arch.h:51,111] | 74 75 ## 3. The firmware pieces, their identity and where each one lives 76 77 ### 3.1 GSP-RM container on disk (the only file-based piece) 78 79 Package `nvidia-firmware-580-580.173.02`, directory `/lib/firmware/nvidia/580.173.02/`. [OBSERVED] 80 81 | File | Bytes | SHA-256 | Used by GB10? | 82 |---|---|---|---| 83 | gsp_ga10x.bin | 75,012,080 | ``32cb7cf3e77f97e92f6e92135939ccb3ba382748144569c0dfccf3338d43d963`` | yes (section 3.2) | 84 | gsp_tu10x.bin | 30,471,256 | ``6f3ccbd570c7ac2a7ea910d9d87fc3d23db9ae3dfe82020ea07b17a30954495e`` | no (Turing/GA100 only) | 85 86 Container layout of gsp_ga10x.bin, as printed by `ck_gsp_fw_inspect inspect` 87 [OBSERVED]: ELF64, little-endian, type REL, machine RISC-V, 17 sections. 88 89 | Section | Offset | Size | Note | 90 |---|---|---|---| 91 | .fwimage | 64 | 74,969,088 | GSP-RM image; SHA-256 ``931add19204a5f0240442272f58fb2bc5db6cec4dd6f6341c1d888754146aa07`` | 92 | .note.gnu.build-id | 74,969,152 | 36 | NT_GNU_BUILD_ID ``b96f53b91f7ff27613d8afe25762756a42a4dc1e`` | 93 | .fwversion | 74,969,188 | 11 | `580.173.02` plus NUL | 94 | .fwsignature_gb20y, _cc_gb20x, _gb20x, _cc_gb10x, **_gb10y**, _gb10x, _cc_gh100, _gh100, _ad10x, _ga10x | 74,969,199 onward | 4,096 each | one per chip family; GB10B uses `.fwsignature_gb10y`, SHA-256 ``08541c3a909f8fd21c3eaf55fbe6c6c30ff2b7729e885417f3fcb06a4d108f2d`` | 95 | .symtab, .strtab, .shstrtab | 75,010,160 onward | 96, 466, 265 | ELF bookkeeping | 96 97 ### 3.2 How the driver picks that file and that signature section [SOURCE] 98 99 - File name: `#define NV_FIRMWARE_FOR_NAME(name) "nvidia/" NV_VERSION_STRING "/" name ".bin"` [kernel-open/nvidia/nv.c:27]; loaded with `request_firmware(&fw, nv_firmware_for_chip_family(fw_type, fw_chip_family), nvl->dev)`, "path is relative to /lib/firmware" [nv.c:4058-4062]. 100 - Chip family: `case GPU_ARCHITECTURE_BLACKWELL_GB1XX: if (gpuImpl == GPU_IMPLEMENTATION_GB10B) return NV_FIRMWARE_CHIP_FAMILY_GB10Y; else return NV_FIRMWARE_CHIP_FAMILY_GB10X;` [src/nvidia/arch/nvalloc/common/inc/nv-firmware-chip-family-select.h:58-62]. Family string: `case NV_FIRMWARE_CHIP_FAMILY_GB10Y: return "gb10y";` [kernel-open/common/inc/nv-firmware.h:63]. 101 - File for the family: GB10X, GB10Y, GB20Y, GB20X, GH100, AD10X all `return NV_FIRMWARE_FOR_NAME("gsp_ga10x");` [nv-firmware.h:95-102]; GA100, TU11X, TU10X get `gsp_tu10x` [nv-firmware.h:104-107]. So the file is `nvidia/580.173.02/gsp_ga10x.bin`. 102 - Section names: `GSP_VERSION_SECTION_NAME ".fwversion"`, `GSP_IMAGE_SECTION_NAME ".fwimage"`, `GSP_SIGNATURE_SECTION_NAME_PREFIX ".fwsignature_"`, `GSP_BUILD_ID_SECTION_NAME ".note.gnu.build-id"`, `GSP_CC_SIGNATURE_SECTION_NAME_PREFIX ".fwsignature_cc_"` [src/nvidia/generated/g_kernel_gsp_nvoc.h:269-274]. 103 - Signature prefix for GB10B: the HAL table assigns `kgspGetSignatureSectionNamePrefix_GB100` to "GB100 | GB102 | GB10B | ..." [g_kernel_gsp_nvoc.c:1809-1813]; that function returns the `_cc_` prefix only when confidential computing is enabled, else `GSP_SIGNATURE_SECTION_NAME_PREFIX` [src/nvidia/src/kernel/gpu/gsp/arch/blackwell/kernel_gsp_gb100.c:94-108]. The section name is prefix + family [kernel_gsp.c:4805-4840]. Confidential computing is not enabled on this box [INFERRED (high): nvidia-smi reports no CC mode; not separately verified], so the section is `.fwsignature_gb10y`. 104 - Version check: `.fwversion` must be nonzero, shorter than 64 bytes, NUL-terminated and equal to `NV_VERSION_STRING`, else `NV_ERR_INVALID_DATA` [kernel_gsp.c:4762-4786]. 105 - Section lookup bounds checks: ELF identifier, section header table validity, name index inside the names table, `portSafeAddU64(offset, size - 1)` inside the buffer [kernel_gsp.c:5115-5166]. 106 - What the driver then does with the pieces (not reproduced here): copies the signature into its own memory descriptor (`_kgspCreateSignatureMemdesc`), builds a radix-3 page table over `.fwimage` for the GSP's DMA (`kgspCreateRadix3`), keeps the build id [kernel_gsp.c:4871-4905]. 107 108 ### 3.3 GSP-FMC first stage and the boot descriptor, compiled into the driver [SOURCE] 109 110 The driver embeds these as C byte arrays ("bindata") with an MIT licence header 111 ("THIS FILE IS AUTOMATICALLY GENERATED"). For GB10B the HAL table selects 112 `kgspGetBinArchiveGspRmBoot_GB10B` [g_kernel_gsp_nvoc.c:788-790] and 113 `kgspGetBinArchiveGspRmFmcGfwProdSigned_GB10B` [g_kernel_gsp_nvoc.c:924-926] 114 (debug-fused parts use the `...DebugSigned_GB10B` archive, [889-891]). 115 116 | Archive label | Original file name (NVIDIA internal) | Bytes | Stored as | sha256 of the bytes [OBSERVED] | 117 |---|---|---|---|---| 118 | GspRmBoot_GB10B UCODE_IMAGE_PROD | kernel/inc/gspcc/bin/g_gsp_gb10b_dyn_prd_image.bin | 196,608 | raw | `427a691d8453f02548d395f40ac900eb0d5b8ea864e8f14f958eef890ba400a2` | 119 | GspRmBoot_GB10B UCODE_DESC_PROD | kernel/inc/gspcc/bin/g_gsp_gb10b_dyn_prd_desc.bin | 84 (RM_RISCV_UCODE_DESC) | deflate, 28 bytes | `8371a29f1c68da89b73bdc87af477c37f0b4e05939c58379d0e3d29efc5575b5` | 120 | GspRmBoot_GB10B UCODE_IMAGE_DBG | kernel/inc/gspcc/bin/g_gsp_gb10b_dyn_dbg_image.bin | 196,608 | raw | `709b88a88fc7ae9bd56b010bcc0a8269d4d40b3c0454aa5b366e8d562d83a404` | 121 | GspRmBoot_GB10B UCODE_DESC_DBG | kernel/inc/gspcc/bin/g_gsp_gb10b_dyn_dbg_desc.bin | 84 | deflate, 28 bytes | `8371a29f`... (byte-identical to DESC_PROD) | 122 | GspRmFmcGfwProdSigned_GB10B UCODE_IMAGE | kernel/inc/gspcc/bin/g_gsp_gb10b_dyn_prd_gfw_image.bin | 195,912 | raw | `b13ead4b9a6b8a0d268f3094cc4f4521d6be8a9a525edbc9a8f3f397c86f1f2e` | 123 | GspRmFmcGfwProdSigned_GB10B UCODE_HASH | g_gsp_gb10b_dyn_prd_gfw_hash.bin | 48 (SHA-384) | raw | `f0389f3a9ce3bb6093e80bfc924bbe2a4ece0199b080a37f64bc1fef63f7500c` | 124 | GspRmFmcGfwProdSigned_GB10B UCODE_SIG | g_gsp_gb10b_dyn_prd_gfw_sig.bin | 384 | raw | `9db429257a18e7c5c1a3df185001c671e21bec4e94c719a574d2ce72e2e07272` | 125 | GspRmFmcGfwProdSigned_GB10B UCODE_PKEY | g_gsp_gb10b_dyn_prd_gfw_pub_key.bin | 384 | raw | `e9bbc669c27ad8827b5bbc2b2f52fdb47718659a651088869a5f3b11d2df7816` | 126 127 Digests measured 2026-10-12 by `ck_gsp_bindata_extract` over the two files 128 fetched from the 580.173.02 tag (raw.githubusercontent.com, path 129 `src/nvidia/generated/`); the 580.173.02 Makefile pin 130 (`make -C native/kernel gsp-bindata-test`) checks the two image digests and 131 the decoded descriptor on every run. `UCODE_HASH` equals SHA-384 of 132 `UCODE_IMAGE` [OBSERVED, checked by the tool]. 133 134 Array storage format [SOURCE]: each array is a `BINDATA_STORAGE_PVT` record 135 (uncompressed size, compressed size, data pointer, bCompressed, 136 bFileOverride, bReferencedDuringLoad) and an archive table 137 (`BINDATA_ARCHIVE` with `entryNum` and label/storage pairs) [bin_data_pvt.h, 138 bin_data.h]. A compressed array is a gzip member without the 10-byte gzip 139 header: raw DEFLATE, then CRC-32 and ISIZE, little endian. The driver inflates 140 it with its own zlib-style decoder (`utilGzAllocate`/`utilGzGetData`, 141 bin_data.c:36-45,96); the nouveau extractor prepends exactly that header 142 before `gzip.decompress` [nouveau/extract-firmware-nouveau.py:107-108]. 143 The 28-byte descriptor is 20 bytes of fixed-Huffman DEFLATE plus the two 144 trailers [OBSERVED]; my decoder verifies both. 145 146 Source files: `src/nvidia/generated/g_bindata_kgspGetBinArchiveGspRmBoot_GB10B.c` 147 (2,466,261 bytes of C) and 148 `g_bindata_kgspGetBinArchiveGspRmFmcGfwProdSigned_GB10B.c` (1,238,060 bytes), 149 metadata comments at lines 31-40 and the storage records near the end of each 150 file. The README says the `nouveau/` script "is used to extract some of the 151 firmware binary images (and related data) encoded in the source code and store 152 them as distinct files. These files are used by the Nouveau device driver" 153 [README.md:170-173]; that script knows gh100, gb100 and gb202 FMC images, not 154 gb10b [nouveau/extract-firmware-nouveau.py:655-662,775-781]. DONE 155 2026-10-12: `ck_gsp_bindata_extract` (section 11) is that step, written 156 against the generated-file grammar and the storage records, not against the 157 nouveau script. 158 159 Descriptor decode [SOURCE rmRiscvUcode.h:36-87, 21 u32 fields; OBSERVED 160 values]: version 5; bootloader/riscvElf/swbrom offsets and sizes 0; 161 manifest at 0x0 size 0xa00; monitorData at 0xa00 size 0xa600; monitorCode at 162 0xb000 size 0x24d00 (ends at 0x2fd00, inside the 196,608-byte image); 163 bIsMonitorEnabled 1; appVersion 0; fbReservedSize 0; bSignedAsCode 0. The 164 driver shifts these offsets by `RISCV_BR_ADDR_ALIGNMENT` = 8 bits when it 165 programs them [kernel_gsp_gh100.c:47, kernel_gsp_ga102.c:44], so the tool 166 refuses any region that is not 256-byte aligned. 167 168 Which archive the driver picks for GB10B [SOURCE]: the HAL dispatch for 169 `kgspGetGspRmBootUcodeStorage` lands on the GB100 variant 170 [kernel_gsp_gb100.c:115-149], which outside confidential computing calls the 171 GA102 variant [kernel_gsp_ga102.c:101-120]: the `GspRmBoot` archive's 172 `UCODE_IMAGE_PROD` and `UCODE_DESC_PROD` (the DBG pair only on a debug-fused 173 part). The `GspRmFmcGfwProdSigned` quartet goes into the SEC2 chain-of-trust 174 payload (section 10). 175 176 ### 3.4 Pieces that are NOT on the host side at all 177 178 - SEC2's own firmware and the chip boot ROM: not loaded by the driver on GB10B. 179 The driver only sends SEC2 commands through its EMEM queue (section 4). Who 180 loads SEC2 firmware before Linux starts (SoC boot chain, UEFI) is [UNKNOWN] 181 from these sources. 182 - ACR (the access-control ucode that sets up the protected region WPR2) and 183 anything inside GSP-FMC and GSP-RM: NVIDIA binaries, run on the chip, not 184 readable by me (licence section 6). 185 - Booter Load/Unload ucodes (older dGPU path) and VBIOS FWSEC: not used on 186 GB10B (section 4). 187 188 ## 4. The loading path the pinned driver uses on GB10B [SOURCE] 189 190 This is the order the native kernel would have to reproduce. Only the parts 191 visible in the open driver are listed; what the chip does in between is 192 inferred from the driver's comments. 193 194 1. **No FSP on this chip.** `PDB_PROP_KFSP_IS_MISSING` is false only for 195 "GH100 | GB100 | GB102 | GB110 | GB112 | GB202 | GB203 | GB205 | GB206 | 196 GB207"; GB10B falls to the default, true [g_kern_fsp_nvoc.c:227-236]. 197 2. **SEC2 boots the GSP-FMC.** `PDB_PROP_KSEC2_BOOT_GSPFMC` is true exactly for 198 "GB10B | GB20B | GB20C" [g_kernel_sec2_nvoc.c:446-450]. The GSP code takes the 199 SEC2 branch when there is no FSP: `ksec2PrepareBootCommands_HAL` 200 [kernel_gsp_gh100.c:803-808] and "Starting to boot GSP via SEC2" then 201 `ksec2SendBootCommands_HAL` [kernel_gsp_gh100.c:868-872]. 202 3. **No VBIOS FWSEC step.** `kgspExtractVbiosFromRom` for GB10B is the stub 203 `_395e98` [g_kernel_gsp_nvoc.c:1300], which returns `NV_ERR_NOT_SUPPORTED` 204 [g_kernel_gsp_nvoc.h:1803-1805]; the init code treats that as "Extracting 205 VBIOS image from ROM is not supported" and continues [kernel_gsp.c:4053-4058]. 206 The VBIOS version string nvidia-smi shows therefore comes from elsewhere 207 (GSP-RM at runtime) [INFERRED (medium)]. 208 4. **No Booter ucodes.** `bPartitionedFmc` is true for "GH100 | GB100 | GB102 | 209 GB10B | ..." [g_kernel_gsp_nvoc.c:447-451]; with it set, "The secure boot 210 ucode is included in the partitioned FMC, no need for separate Booter 211 ucodes" [kernel_gsp.c:4076-4082]. 212 5. **Host-side preparation** (`kgspInitRm`): prepare the boot binary (copy the 213 GspRmBoot image into 4 KiB-aligned system memory flagged 214 `MEMDESC_FLAGS_ALLOC_IN_UNPROTECTED_MEMORY`, keep the 84-byte descriptor) 215 [kernel_gsp.c:4583-4640]; prepare the GSP-RM image (version check, `.fwimage`, 216 signature section, radix-3 page table, build id) [kernel_gsp.c:4848-4905]; 217 logging structures; wait for `GFW_BOOT` OK (`kgspWaitForGfwBootOk_HAL`); set 218 GPU time; libos init args and message-queue init args [kernel_gsp.c:4108-4165]. 219 6. **WPR meta for an integrated GPU.** `kgspPopulateWprMeta_GB10B` reuses the 220 GH100 layout, then sets `vgaWorkspaceSize = 0`, `pmuReservedSize = 0`, 221 `nonWprHeapSize = 0`, with the comment "For GB10Y, unlike on dGPU, this 222 structure is in sysmem" and the WPR2 layout diagram (WPR/LSB header, ACR 223 metadata, GSP FW heap, GSP FW ELF, boot bin) [kernel_gsp_gb10b.c:32-90]. 224 "The actual offsets are determined by secure ACR ucode and patched into the 225 GspFwWprMeta structure" [kernel_gsp_gb10b.c:33-35]. 226 7. **SEC2 command.** `ksec2SetupGspImages_GB10B` copies the FMC image into 227 system memory, writes its physical address into an `NVDM_PAYLOAD_COT` 228 (`gspFmcSysmemOffset`, `frtsSysmemSize` = image size), copies the 48-byte 229 hash, the 384-byte signature and the 384-byte public key into the payload, 230 and points `gspBootArgsSysmemOffset` at the cached GSP-FMC arguments 231 [kernel_sec2_gb10b.c:438-535]. `ksec2PrepareBootCommands_GB10B` allocates 232 the payload with `version = cotPayloadVersion` [561-583]; 233 `ksec2SendBootCommands_GB10B` sends it as `NVDM_TYPE_COT` through 234 `ksec2SendMessage` [612-623]. Transport: an MCTP/NVDM packet written a DWORD 235 at a time into SEC2 EMEM channel 0 (1 KiB) via `NV_PSEC_EMEMC`/`NV_PSEC_EMEMD`, 236 then queue head/tail writes (`NV_PSEC_QUEUE_TAIL` before `NV_PSEC_QUEUE_HEAD` 237 "because it will interrupt SEC2") [kernel_sec2_gb10b.c:36-210]. Register 238 definitions come from `published/blackwell/gb10b/dev_sec_pri.h`, 239 `dev_gsp.h`, `dev_falcon_v4.h` [kernel_sec2_gb10b.c:30-32]. 240 8. **Wait and hand over.** Wait for SEC2 to release the GSP target mask 241 (`ksec2WaitForGspTargetMaskReleased_HAL`), then for lockdown release or an 242 FMC error in `NV_PFALCON_FALCON_MAILBOX0`, program `NV_PFALCON_FALCON_OS` 243 with the descriptor's `appVersion`, confirm the RISC-V core is active, init 244 the status queue, wait for `kgspWaitForRmInitDone` [kernel_gsp_gh100.c:874-982]. 245 From then on the host talks to GSP-RM over the RPC message queues. 246 9. **Teardown and reset.** `kgspResetHw_GB100` (waits for reset access, then 247 resets the engine) [kernel_gsp_gb100.c:46-88]; `kgspTeardown_GH100` 248 [kernel_gsp_gh100.c:995]. Not read in detail here. 249 250 ## 5. Hosted checker: ck_gsp_fw_inspect 251 252 `native/kernel/tools/ck_gsp_fw_inspect.c`; Makefile targets `gsp-fw-inspect` 253 and `gsp-fw-inspect-test` (the latter is part of `make -C native/kernel test`, 254 so CI runs the self-test on every PR; the real-file step prints NOT_RUN when 255 `/lib/firmware/nvidia/580.173.02/gsp_ga10x.bin` is absent, as it is in CI). 256 257 - `inspect FILE [--family NAME] [--expect-version V]`: the driver's checks 258 from section 3.2 plus a bounds check on the build-id note, then SHA-256 of the 259 whole file, of `.fwimage` and of the selected signature section. Exit 0 and 260 `RESULT OK`, or exit 2 and `RESULT REFUSED `. 261 - `selftest`: a 640-byte valid container built in memory, then 22 single-field 262 mutations (bad magic, 32-bit, big-endian, wrong type, wrong machine, wrong 263 shentsize, zero sections, shstrndx out of range, table past end, string 264 table without NUL, name index past table, section past end, offset overflow 265 near 2^64, empty image, version without NUL, version text mismatch, 64-byte 266 version, empty signature, signature for another family only, wrong note 267 type, descriptor past section, truncated note) plus every truncation from 0 268 to 639 bytes; each must be refused for the named reason. 269 - Result on the box, 2026-10-12 [OBSERVED]: `CK_GSP_FW_INSPECT_SELFTEST: PASS 270 (22 mutations)`; `CK_GSP_FW_INSPECT_PIN: PASS` with the file digest equal to 271 the pin in the Makefile (`GSP_FW_SHA256`). 272 - It does not verify NVIDIA's signature over `.fwimage` (that is the chip's 273 job; format and keys are not mine) and it never loads anything. 274 275 ## 6. Licence limits [DOCUMENTED] 276 277 Firmware package: `/usr/share/doc/nvidia-firmware-580-580.173.02/copyright`, 278 "License: NVIDIA-graphics-drivers" (NVIDIA Driver License Agreement): 279 280 - 1.1(d): may "Distribute the SOFTWARE ... for use with operating system 281 kernels distributed under the terms of an OSI-approved open source license 282 ... provided that (i) the binary files thereof are not modified in any way 283 ... and (ii) this Agreement is provided to each SOFTWARE recipient". AIENOS is 284 Apache-2.0, an OSI-approved licence, so shipping the unmodified file plus the 285 agreement text is within this clause [INFERRED (high): plain reading, not 286 legal advice]. 287 - 2.1: firmware only on NVIDIA platforms; no translation to another 288 architecture or language. 2.2: no reverse engineering, decompiling or 289 disassembly of binaries. 2.3: no derivative works of binaries. 2.6: no 290 bypassing authentication or security mechanisms. 2.9: may not cause the 291 SOFTWARE to become subject to an open source licence. 292 - Consequence for this project: I may ship and load the bytes as they are, 293 parse their public container format (the driver does exactly that, in MIT 294 source), and must never patch, unpack `.fwimage`, or work around the 295 signature checks. A SEC2 refusal is final and is reported, never bypassed. 296 297 Driver source: `COPYING` says "Except where noted otherwise, the individual 298 files within this package are licensed as MIT"; every file read here carries 299 `SPDX-License-Identifier: MIT` (including the bindata arrays and 300 `kernel_sec2_gb10b.c`). The kernel module reports `Dual MIT/GPL`. Reading and 301 reimplementing the host-side protocol from MIT source is permitted; copying 302 code into AIENOS would require carrying the MIT notice (none was copied here). 303 304 ## 7. What this means for cut C and cut D 305 306 - Cut C "inventory" is done by this document; "parsers and refusal tests for 307 firmware metadata" by `ck_gsp_fw_inspect`. The next host-only steps that do 308 not need the machine: (a) DONE 2026-10-12: `ck_gsp_bindata_extract` 309 (section 11) writes the eight arrays as files with digests, own DEFLATE and 310 SHA-384, `make -C native/kernel gsp-bindata-test`; (b) DONE 2026-10-12: the encoder, decoder 311 and refusal tests for `NVDM_PAYLOAD_COT`, the MCTP/NVDM headers, the EMEM 312 packet and `GSP_FMC_BOOT_PARAMS` are `ck_gsp_cot_encode` (section 10); 313 (c) DONE 2026-10-12: `ck_gsp_boot_args_encode` (section 12) encodes, 314 decodes and refuses `GspFwWprMeta`, the libos init-argument page, the 315 log-buffer PTE prefix, `GSP_ARGUMENTS_CACHED`, the RPC shared-buffer page 316 table and the radix-3 ELF table with the GB10B populate values traced; 317 (d) DONE on the host side 2026-10-12: `ck_gsp_rpc_encode` encodes, decodes 318 and refuses the queue headers, queue elements, RPC headers, continuation 319 records and the packed registry table (section 13). What remains for item 320 4 of section 8 is the content of `GspSystemInfo` and the list of RPCs a 321 native kernel must issue after `GSP_INIT_DONE`, both of which need the real 322 device. 323 - The machine-side part of cut C (first SEC2 command, FMC boot, GSP-RM init 324 done) is an attended-window item under the P08 rules: documented cold power 325 state, no prior Linux GPU initialization, camera, abort rule, and the 326 B7b-style one-time boot entry. Nothing in this document authorizes it. 327 328 ## 8. Known unknowns 329 330 1. RESOLVED 2026-10-12 [SOURCE]: the `NVDM_PAYLOAD_COT` layout is 860 packed 331 bytes, GB10B uses version 1, signature and key sizes 384, hash 48; the 332 whole wire format is in section 10 and checked by `ck_gsp_cot_encode`. 333 2. RESOLVED on the host side 2026-10-12 [SOURCE]: `GSP_FMC_BOOT_PARAMS` 334 (section 10), `GspFwWprMeta` with every value `kgspPopulateWprMeta_GH100` 335 and `_GB10B` fill (heap 133 MiB, bootloader 196,608 bytes at descriptor 336 offsets 0xb000/0xa00/0x0, frts 0, nonWprHeap 0, FB layout left to the 337 FMC), the libos init-argument page (seven logs then RMARGS), the 338 log-buffer PTE prefix, `GSP_ARGUMENTS_CACHED` (message-queue offsets, 339 512 MiB sysmem heap on ZERO_FB) and the radix-3 ELF table are in section 340 12 and checked by `ck_gsp_boot_args_encode`. [INFERRED (medium)] that the 341 GSP-FMC accepts these exact values without Linux present: only the chip 342 can confirm that. 343 3. [UNKNOWN] What SEC2 requires to be already true when the first command 344 arrives (its own firmware loaded by the SoC boot chain? clocks? power 345 state?), and whether UEFI leaves the GPU in that state at AIENOS entry. 346 On Linux the driver finds "GFW_BOOT" complete before it starts 347 (`kgspWaitForGfwBootOk_HAL`); who completes it without Linux is not shown. 348 NARROWED 2026-10-20 (section 14.2 items 1-2): on GB10B that wait is a no-op 349 and the SEC2 send checks only a software property and EMEM HEAD == TAIL; what 350 stays UNKNOWN is whether SEC2 is running with an empty queue at AIENOS entry. 351 4. RESOLVED on the host side 2026-10-12 [SOURCE] for the transport: the queue 352 headers, element format, checksum, sequence rules, continuation records, 353 the init handshake (`GSP_INIT_DONE` 0x1001 with sequence 0 and result 354 NV_OK) and the two RPCs queued before boot (`GSP_SET_SYSTEM_INFO` 72, 355 `SET_REGISTRY` 73) are byte-exact in section 13 and `ck_gsp_rpc_encode`. 356 `GspSystemInfo` is 936 bytes (RPC length 968) under the natural layout 357 [INFERRED (high): struct text copied from the pinned headers and compiled; 358 no pack pragma]. Still [UNKNOWN]: the exact `GspSystemInfo` contents a 359 native kernel must send (they come from the real PCI/BAR/ACPI state), and 360 which RPCs after init are mandatory for device init, memory mapping, 361 channel and submit; the native kernel needs only a subset but it is not 362 established. 363 5. [UNKNOWN] Whether the confidential-computing (`_cc_`) sections or the SPDM 364 session are ever required on this platform. Assumed not [INFERRED (high)]; 365 default `PDB_PROP_CONFCOMPUTE_ENABLED` is NV_FALSE (section 14.2 item 3). 366 6. [RESOLVED on the host side 2026-10-12, SOURCE; consumer side INFERRED 367 (medium)] `GspRmFmcGfwProdSigned_GB10B` (image, hash, signature, public 368 key) is what SEC2 receives in the chain-of-trust payload (section 10). 369 `GspRmBoot_GB10B` (image plus RM_RISCV_UCODE_DESC) is what 370 `kgspPopulateWprMeta_GH100` describes to the FMC as the "GSP-FMC ucode" 371 bootloader: `sizeOfBootloader`, `sysmemAddrOfBootloader`, 372 `bootloaderCodeOffset`/`DataOffset`/`ManifestOffset` come from that image 373 and the descriptor's monitorCode/monitorData/manifest offsets 374 [kernel_gsp_gh100.c:295-335]; the direct boot-ROM path programs the same 375 three regions into `NV_PGSP_FALCON_BCR_DMAADDR_*` [kernel_gsp_gh100.c: 376 `_kgspBootstrapGspFmc_GH100`], which GB10B does not take (section 11). 377 Who reads the WprMeta bootloader fields on the SEC2 path (FMC or ACR) runs 378 inside NVIDIA code and is not readable. 379 7. [UNKNOWN] Reset and re-open behavior on GB10B after a failed FMC boot 380 (`kgspResetHw_GB100` waits for "reset access"); needed for the 381 resource-incarnation protection (#285) before any repeated attempt. 382 383 ## 9. Scope and limits of this document 384 385 Read: nv-firmware.h, nv-firmware-chip-family-select.h, nv_arch.h, nv.c (the 386 firmware load function only), kernel_gsp.c (init, container parsing, boot 387 binary), kernel_gsp_gh100.c (prepare, bootstrap), kernel_gsp_gb100.c, 388 kernel_gsp_gb10b.c, kernel_gsp_booter.c and kernel_gsp_fwsec.c (grep only), 389 kernel_sec2_gb10b.c, g_kernel_gsp_nvoc.c/.h, g_kernel_sec2_nvoc.c, 390 g_kern_fsp_nvoc.c (property tables only), the two GB10B bindata files 391 (metadata comments only), README.md, COPYING, the firmware copyright file; 392 for section 10 also kern_fsp_cot_payload.h, fsp_nvdm_format.h, 393 fsp_mctp_format.h, fsp_emem_channels.h, kernel_sec2.c (`ksec2SendMessage`, 394 `ksec2PollForCanSend`), g_kernel_sec2_nvoc.c/.h (version, sizes, SEID), 395 gspifpub.h, gsp_init_args.h, gsp_fw_wpr_meta.h, kernel_gsp_gh100.c 396 (`kgspSetupGspFmcArgs`), and published/blackwell/gb10b dev_sec_pri.h, 397 dev_gsp.h, dev_falcon_v4.h; for sections 3.3 and 11 also rmRiscvUcode.h, 398 bin_data.c, bin_data.h, bin_data_pvt.h, kernel_gsp_ga102.c, 399 nouveau/extract-firmware-nouveau.py (lines 82-114 only), kernel_gsp_gh100.c 400 (`kgspBootstrap_GH100`, `_kgspLockdownReleasedOrFmcError`, 401 `kgspPopulateWprMeta_GH100`, `_kgspBootstrapGspFmc_GH100`), g_kern_fsp_nvoc.c 402 (the `PDB_PROP_KFSP_IS_MISSING` chip list), and the full bindata record 403 tables of both GB10B files; for section 12 also gsp_fw_wpr_meta.h, 404 libos_init_args.h, gsp_fw_heap.h, gsp_init_args.h, nvrm_registry.h (heap 405 and stack keys), nv-firmware-registry.h, nvtypes.h (`NvLength`), g_gpu_nvoc.c 406 (the ZERO_FB chip list), g_kernel_gsp_nvoc.c/.h (frts, heap, log-count, 407 libos-version and kernel-logging HAL tables), kernel_gsp.c (`kgspSetupLibos 408 InitArgs_IMPL`, `_kgspGenerateInitArgId`, `kgspPopulateGspRmInitArgs_IMPL`, 409 `kgspCreateRadix3`, `_kgspCalculateFwHeapSize`, `kgspGetFwHeapSize_IMPL`, 410 `kgspInitLogging`, log registration), kernel_gsp_tu102.c (the boot-argument 411 allocations), kernel_gsp_gh100.c (`kgspPopulateWprMeta_GH100`), kernel_gsp_ 412 gb10b.c (`kgspPopulateWprMeta_GB10B`), message_queue_cpu.c, message_queue.h, 413 message_queue_priv.h (sizes and page table only); for section 13 also 414 msgq.c, msgq_priv.h (the shared ring library), message_queue_cpu.c 415 (`GspMsgQueueSendCommand`, `GspMsgQueueReceiveStatus`, `GspStatusQueueInit`), 416 message_queue_priv.h (`GSP_MSG_QUEUE_ELEMENT`, `_checkSum32`), 417 g_rpc-message-header.h, rpc_headers.h, rpc_global_enums.h, rpc_common.c 418 (`rpcWriteCommonHeader`), rpc.c (`_issueRpcLarge`, `rpcSetRegistry_v17_00`, 419 `rpcGspSetSystemInfo_v17_00`), kernel_gsp.c (`_kgspRpcSendMessage`, 420 `kgspInitRm`, `kgspWaitForRmInitDone`), kernel_gsp_tu102.c 421 (`kgspSetCmdQueueHead`), dev_gsp.h (Turing, `NV_PGSP_QUEUE_HEAD`), os.c and 422 arch/nvalloc/unix/src/registry.c (`RmPackageRegistry`), g_os_nvoc.h 423 (`PACKED_REGISTRY_TABLE`), gsp_static_config.h (`GspSystemInfo`), 424 g_chipset_nvoc.h (`BUSINFO`), gpu_acpi_data.h (`ACPI_METHOD_DATA`), 425 ctrl0073system.h (`NV0073_CTRL_SYSTEM_ACPI_ID_MAP_MAX_DISPLAYS`), 426 nvacpitypes.h and acpigenfuncs.h (DSM enums; not part of `GspSystemInfo`). 427 Not read: the RPC set after init, ACR or GSP internals (not available). No Context7 or web manual covers this layer; the 428 DGX Spark user guide is silent on GSP firmware loading (DOCS SILENT on native 429 GSP bring-up). 430 431 ## 10. The SEC2 chain-of-trust message, byte for byte [SOURCE] 432 433 Everything in this section is read from open-gpu-kernel-modules tag 434 580.173.02 and mirrored by `native/kernel/tools/ck_gsp_cot_encode.c` 435 (`make -C native/kernel gsp-cot-test`, part of `make test`). Nothing here was 436 sent to the device. 437 438 Transport. NVDM (NVIDIA Data Model) over MCTP over SEC2 EMEM channel 0, 439 1024 bytes (`fsp/fsp_emem_channels.h:9-11`; `kernel_sec2_gb10b.c:36-41`, 440 `:322-333`). A packet is two header dwords then the payload 441 (`kernel_sec2.c:50-52`, `:305-325`): 442 443 | dword | field | value for the boot message | source | 444 |---|---|---|---| 445 | 0 | MCTP transport header. Layout (GB20B form): SOM bit 31, EOM bit 30, SEQ 29:28, TO 27, TAG 26:24, SEID 23:16, DEID 15:8, RSVD 7:4, VERSION 3:0 | **GB10B: `0x00000001`**, the HAL constant; the driver does not build SOM/EOM on GB10B. (GB20B/GB20C: `0xC0000000` = SOM=1, EOM=1, SEQ=0, SEID=0.) Corrected 2026-10-26; this row said `0xC0000000` for GB10B | `kernel_sec2.c:320` calls `ksec2CreateMctpHeader_HAL`; GB10B binds `ksec2CreateMctpHeader_539ab4` = `return 1;` (`g_kernel_sec2_nvoc.c:786-788`, `g_kernel_sec2_nvoc.h:853-855`); GB20B/GB20C bind `ksec2CreateMctpHeader_GB20B` (`kernel_sec2_gb20b.c:206-219`) | 446 | 1 | NVDM header: TYPE 6:0 = 0x7e (vendor PCI), IC 7 = 0, VENDOR_ID 23:8 = 0x10de, NVDM_TYPE 31:24 | `0x1410DE7E` (NVDM_TYPE_COT = 0x14) | `fsp_mctp_format.h:17-22`; `fsp_nvdm_format.h:14`; `kernel_sec2_gb10b.c:391-402` | 447 448 A message longer than 1016 bytes would continue in packets that carry only 449 the MCTP dword with SOM=0 and SEQ = (n mod 4) (`kernel_sec2.c:330-357`); the 450 boot message is 860 bytes, so it is always one packet, and the driver sends 451 only this one command on the channel (`kernel_sec2_gb10b.c:719-722`). 452 453 Payload `NVDM_PAYLOAD_COT`, `#pragma pack(1)`, 860 bytes 454 (`src/nvidia/inc/kernel/gpu/fsp/kern_fsp_cot_payload.h:12-29`): 455 456 | offset | size | field | GB10B value | source | 457 |---|---|---|---|---| 458 | 0 | 2 | version | 1 | `g_kernel_sec2_nvoc.c:478-482` | 459 | 2 | 2 | size | 860 (`sizeof`) | `kernel_sec2_gb10b.c:580-581` | 460 | 4 | 8 | gspFmcSysmemOffset | physical address of the GSP-FMC image in system memory | `:507` | 461 | 12 | 8 | frtsSysmemOffset | 0 (never set) | `:578` zero-fill | 462 | 20 | 4 | frtsSysmemSize | the GSP-FMC image size (195,912), sic | `:508` | 463 | 24 | 8 | frtsVidmemOffset | 0 | `:578` | 464 | 32 | 4 | frtsVidmemSize | 0 | `:578` | 465 | 36 | 48 | hash384 | `UCODE_HASH` array | `:514` | 466 | 84 | 384 | publicKey | `UCODE_PKEY` array | `:526-527`; size `g_kernel_sec2_nvoc.c:475-476` | 467 | 468 | 384 | signature | `UCODE_SIG` array | `:519-520`; size `g_kernel_sec2_nvoc.c:472-473` | 468 | 852 | 8 | gspBootArgsSysmemOffset | physical address of `GSP_FMC_BOOT_PARAMS` | `:532`, `:241-258` | 469 470 The packet is therefore 868 bytes. It is written at EMEM offset 0 with the 471 write auto-increment bit, one dword at a time, then QUEUE_HEAD(0) = 0 and 472 QUEUE_TAIL(0) = 864 (padded size minus one dword) (`kernel_sec2_gb10b.c: 473 700-732`, `:108-152`, `:160-210`). The channel may be written only while 474 HEAD == TAIL (`:344-356`, polled `kernel_sec2.c:605-640`); the command counts 475 as handled once FALCON_MAILBOX0 no longer reads `0xc001cafe` (`:285-297`); 476 before the boot the driver also waits until the GSP falcon's HWCFG2 register 477 reads non-zero and not the `0xBADF41xx` "target locked" pattern (`:262-281`). 478 Register addresses for GB10B: `published/blackwell/gb10b/dev_sec_pri.h` 479 (MAILBOX0/1, QUEUE_HEAD/TAIL(i), EMEMC(i), EMEMD(i)), `dev_gsp.h` (NV_PGSP 480 base), `dev_falcon_v4.h` (HWCFG2); the tool does not use them. 481 482 Boot arguments the payload points at: `GSP_FMC_BOOT_PARAMS` 483 (`src/nvidia/arch/nvalloc/common/inc/gsp/gspifpub.h`), natural C layout, 88 484 bytes on the LP64 ABI the driver and this host share (the self-test checks the 485 offsets against the compiler); filled by `kgspSetupGspFmcArgs_GH100` 486 (`kernel_gsp_gh100.c:415-470`), allocated 4 KiB aligned (`:164`): 487 488 | offset | size | field | fresh-boot value | 489 |---|---|---|---| 490 | 0 | 4 | initParams.regkeys | 0 unless CC or NVLink proxy keys | 491 | 8 | 4 | bootGspRmParams.target | DMA target of the descriptor (0 FB, 1 coherent sysmem, 2 non-coherent sysmem) | 492 | 12 | 4 | bootGspRmParams.gspRmDescSize | 256 (`sizeof GspFwWprMeta`) | 493 | 16 | 8 | bootGspRmParams.gspRmDescOffset | physical address of the `GspFwWprMeta` | 494 | 24 | 8 | bootGspRmParams.wprCarveoutOffset | not set by the driver (0) | 495 | 32 | 4 | bootGspRmParams.wprCarveoutSize | not set (0) | 496 | 36 | 1 | bootGspRmParams.bIsGspRmBoot | 1 | 497 | 40 | 4 | gspRmParams.target | DMA target of the libos init arguments | 498 | 48 | 8 | gspRmParams.bootArgsOffset | physical address of the libos init arguments | 499 | 56 | 24 | gspSpdmParams | only with SPDM (assumed off) | 500 | 80 | 8 | gspRmMemParams.flushSysmemAddrVal{Lo,Hi} | only with CC (0) | 501 502 INFERRED, enforced by the tool but not a driver check: the image address is 503 4 KiB aligned (the driver maps `NV_ALIGN_UP(size, 0x1000)` bytes of 504 page-granular system memory, `kernel_sec2_gb10b.c:489-495`) and every 505 system address fits the 41-bit DMA window `/proc/driver/nvidia/gpus` reports 506 for this GPU (section 2; `--dma-bits` overrides). 507 508 Evidence 2026-10-12 on the box: `CK_GSP_COT_ENCODE_SELFTEST: PASS` (80 checks: 509 both layouts against the compiler, golden header words, encode/decode round 510 trips, 46 field mutations and every header truncation refused by name), same 511 under ASan/UBSan. 512 513 ## 11. Extracted arrays and the GB10B boot decision [SOURCE] 514 515 Tool: `native/kernel/tools/ck_gsp_bindata_extract.c` (hosted C, no 516 dependencies beyond my own `native/argus/sha256.c`; SHA-384, CRC-32 and the 517 raw-DEFLATE decoder, stored/fixed/dynamic blocks, are in the tool). 518 `make -C native/kernel gsp-bindata-extract` builds it; 519 `make -C native/kernel gsp-bindata-test` runs the self-test and, when the two 520 driver files are present under `GSP_BINDATA_DIR` (default 521 `~/.cache/aienos/open-gpu-kernel-modules-580.173.02`), the pin check; it is 522 part of `make test`. Without the files the pin line reads `NOT_RUN`, never 523 PASS. 524 525 What it checks before it writes a byte: the generated-file grammar 526 (`FUNCTION`, `FILE NAME`, `FILE TYPE BINARY`, `COMPRESSION`, `COMPLEX_STRUCT 527 NO`, `DATA SIZE`, `COMPRESSED SIZE`), the array identifier 528 `kgspBinArchive_BINDATA_LABEL_