aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / docs / GB10_FIRMWARE_INVENTORY.md
| 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/<file>`); 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 <reason>`. |
| 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<stem>_BINDATA_LABEL_<label>_data`, the storage record |
| 529 | (both sizes, the data pointer, `bCompressed`), the archive table (`entryNum`, |
| 530 | order, labels), duplicate labels, more than 16 arrays or 8 MiB per array; |
| 531 | for compressed arrays the DEFLATE stream, the CRC-32 and the ISIZE trailer; |
| 532 | then the meaning: `UCODE_DESC_*` is 84 bytes, version 5, monitor enabled, |
| 533 | with manifest/monitor regions inside the matching `UCODE_IMAGE_*` and |
| 534 | 256-byte aligned; `UCODE_HASH` is 48 bytes and equals SHA-384 of |
| 535 | `UCODE_IMAGE`; `UCODE_SIG` and `UCODE_PKEY` are 384 bytes; any other label is |
| 536 | refused. Any failure prints `REFUSED: <reason>` and exits 2. |
| 537 | |
| 538 | Usage: `ck_gsp_bindata_extract extract FILE [--out DIR]` prints one |
| 539 | `array <function> <label> file=... stored=N compressed=yes|no size=N |
| 540 | sha256=...` line per array, the decoded descriptors, `hash384 ... equals |
| 541 | sha384(UCODE_IMAGE)` and `RESULT OK arrays=N`; `selftest` prints |
| 542 | `CK_GSP_BINDATA_EXTRACT_SELFTEST: PASS|FAIL (N checks, M failures)`. |
| 543 | |
| 544 | Evidence 2026-10-12 on the box: `CK_GSP_BINDATA_EXTRACT_SELFTEST: PASS (124 |
| 545 | checks, 0 failures)`, same under ASan/UBSan; both GB10B files extract with |
| 546 | `RESULT OK arrays=4` and the digests in section 3.3; |
| 547 | `CK_GSP_BINDATA_PIN: PASS`; a foreign C file is refused ("no arrays found"). |
| 548 | |
| 549 | The boot decision the driver makes for GB10B, as the native kernel would have |
| 550 | to mirror it [SOURCE kernel_gsp_gh100.c:833-995 `kgspBootstrap_GH100`, |
| 551 | reached for GB10B through the dispatch else-branch, g_kernel_gsp_nvoc.c:719]: |
| 552 | |
| 553 | 1. If a KernelFsp object exists and `PDB_PROP_KFSP_DISABLE_GSPFMC` is not |
| 554 | set: "boot GSP via FSP" (`kfspSendBootCommands`). GB10B is not in the |
| 555 | FSP-present chip list ("GH100 | GB100 | GB102 | GB110 | GB112 | GB202 | |
| 556 | GB203 | GB205 | GB206 | GB207"), so `PDB_PROP_KFSP_IS_MISSING` is true |
| 557 | [g_kern_fsp_nvoc.c:227-236]: not this branch. |
| 558 | 2. Else if a KernelSec2 object has `PDB_PROP_KSEC2_BOOT_GSPFMC`: "boot GSP |
| 559 | via SEC2" (`ksec2SendBootCommands`, section 10). True for "GB10B | GB20B | |
| 560 | GB20C" [g_kernel_sec2_nvoc.c:446-450]: **this is the GB10B path.** |
| 561 | 3. Else the direct path `_kgspBootstrapGspFmc_GH100`: program |
| 562 | `NV_PGSP_FALCON_BCR_DMAADDR_FMCCODE/FMCDATA/PKCPARAM` from the GspRmBoot |
| 563 | image and the descriptor's monitorCode/monitorData/manifest offsets, then |
| 564 | `NV_PGSP_FALCON_CPUCTL_STARTCPU`. Not taken on GB10B. |
| 565 | |
| 566 | After the SEC2 send, in order: `ksec2WaitForGspTargetMaskReleased` |
| 567 | (conditional on `PDB_PROP_KSEC2_GSP_MODE_GSPRM`, kernel_sec2_gb10b.c:368 and |
| 568 | :224/:250/:469); `gpuTimeoutCondWait(_kgspLockdownReleasedOrFmcError)` |
| 569 | (kernel_gsp_gh100.c:492 onward: `NV_PFALCON_FALCON_MAILBOX0` carries ACR/FMC |
| 570 | error codes, treated as fatal; the boot-argument address may still sit in the |
| 571 | mailboxes until the FMC clears them); then any non-zero MAILBOX0 is "GSP-FMC |
| 572 | reported an error"; `kflcnIsRiscvActive`; then "Waiting for GSP fw RM to be |
| 573 | ready" (the RPC init handshake, section 8 item 4). Each of these is a |
| 574 | measurable checkpoint for the attended window, with its own timeout and its |
| 575 | own refusal line. Nothing in this section has been run on the chip. |
| 576 | |
| 577 | |
| 578 | ## 12. The boot-argument blocks, byte for byte [SOURCE] |
| 579 | |
| 580 | Tool: `native/kernel/tools/ck_gsp_boot_args_encode.c` (hosted C, no |
| 581 | dependencies). `make -C native/kernel gsp-bootargs-test` runs the self-test |
| 582 | (142 checks: compiler layouts, golden constants, round trips, every single- |
| 583 | field mutation refused); it is part of `make test`. Modes `wprmeta`, `libos`, |
| 584 | `logbuf`, `rmargs`, `mqtable`, `radix3` write a block; `check-wprmeta`, |
| 585 | `check-libos`, `check-rmargs` refuse any block that is not the fresh-boot |
| 586 | GB10B shape; `layout` prints the offsets. Nothing is sent anywhere. |
| 587 | |
| 588 | What the driver puts in system memory before it sends the SEC2 message of |
| 589 | section 10, every line from tag 580.173.02 (file:line in the tool header): |
| 590 | |
| 591 | 1. **GspFwWprMeta**, 256 bytes in one 4 KiB cached page. Host-filled fields |
| 592 | on GB10B: magic `0xdc3aae21371a60b3`, revision 1; bootloader = the |
| 593 | GspRmBoot PROD image (196,608 bytes, 4 KiB-aligned copy) with the |
| 594 | descriptor offsets code 0xb000, data 0xa00, manifest 0x0; the GSP-RM ELF |
| 595 | size and the physical address of the radix-3 root page; the signature |
| 596 | buffer (256-aligned, size rounded up to 256); `gspFwHeapSize` 133 MiB; |
| 597 | `nonWprHeapSize`, `frtsSize`, `vgaWorkspaceSize`, `pmuReservedSize`, VF |
| 598 | partition count all 0 on GB10B; optional crash-report queue; flags 0 |
| 599 | (`SCAN_RECOVERY_MARGIN` only on a retry with ECC disabled). Every FB |
| 600 | layout field (`gspFwRsvdStart` … `vgaWorkspaceOffset`), `bootCount` and |
| 601 | `verified` stay 0: the FMC/ACR fill them and set `verified` to |
| 602 | `0xa0a0a0a0a0a0a0a0`, which the host later checks. |
| 603 | Heap arithmetic: GB10B is ZERO_FB (memory size counted as 1 GB), so the |
| 604 | heap is OS carveout 22 MiB + base 14 MiB + 1 MiB + 96 MiB = 133 MiB, |
| 605 | clamped to at least 88 MiB; a registry override would be clamped to |
| 606 | [88, 280] MiB. The tool refuses anything outside that range. |
| 607 | 2. **Libos init arguments**, one 4 KiB **uncached** page of 32-byte entries |
| 608 | (id8, pa, size, kind, loc). GB10B (libos 3, release build, kernel logging |
| 609 | on) has exactly eight: LOGINIT, LOGINTR, LOGRM, LOGMNOC, LOGDBG (64 KiB |
| 610 | each), LOGROOT (4 KiB), LOGKRNL (64 KiB), then RMARGS (4 KiB, the |
| 611 | `GSP_ARGUMENTS_CACHED` page); all CONTIGUOUS/SYSMEM; id8 is the name |
| 612 | packed big-endian (RMARGS = `0x524d41524753`). Order and sizes are |
| 613 | refused if they differ. |
| 614 | 3. **Each log buffer** (cached, contiguous, 4 KiB aligned, zeroed) starts |
| 615 | with an 8-byte put pointer followed by its own page table: one physical |
| 616 | address per 4 KiB page. The init-argument `pa` is that first PTE. |
| 617 | 4. **GSP_ARGUMENTS_CACHED**, 88 bytes in one 4 KiB cached page: shared |
| 618 | message-queue buffer address, 129 page-table entries, command queue at |
| 619 | offset 4096, status queue at 266,240 (page table 4 KiB + command queue |
| 620 | 256 KiB); suspend/resume fields 0; `bDmemStack` 1; profiler 0; sysmem |
| 621 | heap address and size (512 MiB default on ZERO_FB, contiguous uncached). |
| 622 | The RPC shared buffer is 129 pages: page 0 holds the addresses of all 129 |
| 623 | pages (itself first), then 64 pages of command queue and 64 of status |
| 624 | queue. The element format inside those queues is item 4 of section 8. |
| 625 | 5. **Radix-3 page table** for the ELF: 4 KiB pages, 512 entries each, three |
| 626 | table levels then the data; level 0 must be one page (so up to 512 GiB). |
| 627 | For the pinned 75,012,080-byte container: 18,314 data pages, 36 level-2 |
| 628 | pages, 1 level-1, 1 level-0, tables 155,648 bytes, data at offset |
| 629 | 0x26000, allocation 75,169,792 bytes. The WPR meta carries the ELF size |
| 630 | and the level-0 page address. |
| 631 | |
| 632 | Where these sit in the SEC2 flow: the `GSP_FMC_BOOT_PARAMS` page (section |
| 633 | 10) carries both addresses: the WprMeta at offset 16 (`bootGspRmParams. |
| 634 | gspRmDescOffset`, size 256 at offset 12) and the libos init-argument page at |
| 635 | offset 48 (`gspRmParams.bootArgsOffset`, DMA target at 40; |
| 636 | kernel_gsp_gh100.c:457-461). The FMC hands the first to ACR/the bootloader |
| 637 | and the second to GSP-RM as its libos boot arguments; GSP-RM then finds the |
| 638 | RMARGS entry, reads `GSP_ARGUMENTS_CACHED` and maps the message queues. |
| 639 | Everything above |
| 640 | is what Linux prepares; whether the GSP-FMC on this board accepts exactly |
| 641 | this shape without Linux ever having run is INFERRED (medium) until the |
| 642 | attended window measures it. Caching note (section 4 of the hardware manual |
| 643 | skill): the libos page and the sysmem heap are the only **uncached** blocks; |
| 644 | the WprMeta, RMARGS, log buffers, radix-3 tables and queue buffer are cached |
| 645 | sysmem in the driver, so a native port must keep the same attributes or |
| 646 | flush explicitly. |
| 647 | |
| 648 | ## 13. The message queue, byte for byte [SOURCE] |
| 649 | |
| 650 | Backed by `native/kernel/tools/ck_gsp_rpc_encode.c` (`make -C native/kernel |
| 651 | gsp-rpc-test`; modes `selftest | layout | txheader | check-txheader | ring | |
| 652 | element | check-element | contplan | registry | check-registry`). Every value |
| 653 | is DOCUMENTED from open-gpu-kernel-modules 580.173.02; that the GSP-RM on |
| 654 | GB10B accepts the same bytes without Linux present is INFERRED (medium) until |
| 655 | the first attended run. Nothing here touches a device. |
| 656 | |
| 657 | 1. **Two rings in one 512 KiB buffer** (section 12 item 4: the RPC shared |
| 658 | buffer is one 4 KiB page table followed by the command queue then the |
| 659 | status queue, each 0x40000 bytes). Both use the shared ring library |
| 660 | (`msgq.c`). Each ring starts with a 32-byte producer header |
| 661 | `msgqTxHeader` {version 0, size, msgSize, msgCount, writePtr, flags, |
| 662 | rxHdrOff, entryOff} and holds the consumer's 4-byte `msgqRxHeader` |
| 663 | {readPtr} at `rxHdrOff`. The driver creates its command queue with size |
| 664 | 0x40000, msgSize 4096, header alignment 16, entry alignment 4096 and |
| 665 | `MSGQ_FLAGS_SWAP_RX`, so rxHdrOff = 32, entryOff = 4096, msgCount = |
| 666 | (0x40000 - 4096) / 4096 = 63, with 62 usable slots (one slot always stays |
| 667 | free). Golden header bytes: `00000000 00000400 00100000 3f000000 |
| 668 | 00000000 01000000 20000000 00100000`. Because both sides set SWAP_RX, |
| 669 | each side keeps the read pointer for the messages it consumes in its |
| 670 | **own** buffer: the CPU's readPtr for the status queue lives at offset 32 |
| 671 | of the command queue, and GSP's readPtr for the command queue lives at |
| 672 | offset 32 of the status queue. |
| 673 | 2. **Linking to GSP's status queue** (`msgqRxLink`, retried for up to 4 s by |
| 674 | `GspStatusQueueInit` with a health check): the CPU reads GSP's 32-byte |
| 675 | header from the status queue and refuses it with the library codes -2 |
| 676 | (msgSize < 16), -3 (msgSize > size), -6 (size < entryOff + msgSize), -7 |
| 677 | (size mismatch), -8 (msgSize mismatch), -9 (version != 0), -10 (rxHdrOff |
| 678 | < 32, entryOff < 36, or msgCount != (size - entryOff) / msgSize). The tool |
| 679 | applies the same checks (`check-txheader`) and also refuses writePtr >= |
| 680 | msgCount. |
| 681 | 3. **Ring arithmetic**: free = (readPtr + msgCount - writePtr - 1) mod |
| 682 | msgCount; available = (writePtr + msgCount - readPtr) mod msgCount; a |
| 683 | pointer at or beyond msgCount is corrupt and reads as 0 (`ring` mode). |
| 684 | 4. **One message** (`GSP_MSG_QUEUE_ELEMENT`, 80-byte header-plus-RPC-header |
| 685 | struct; `element` mode): bytes 0-31 authentication tag and AAD (zero |
| 686 | without confidential computing), u32 checkSum at 32, u32 seqNum at 36, |
| 687 | u32 elemCount at 40, then the 32-byte RPC header at 48: header_version |
| 688 | 0x03000000 (major 3, minor 0), signature 0x43505256, length = 32 + |
| 689 | payload, function, rpc_result = rpc_result_private = 0xFFFFFFFF |
| 690 | (pending), sequence, cpuRmGfid 0. The message length is 48 + rpc.length |
| 691 | and must be within [80, 65536]; it is zero-padded to a multiple of 8; |
| 692 | elemCount = ceil(length / 4096); seqNum is the queue's running transmit |
| 693 | count (0 for the first message ever sent, then +1 per accepted message); |
| 694 | checkSum is computed with the field zeroed as the XOR of every 64-bit |
| 695 | word, folded to (high 32) XOR (low 32), so a correct element XOR-sums to |
| 696 | zero. The driver copies it 4096 bytes at a time into successive ring |
| 697 | slots, publishes the new writePtr, then writes 0 to the doorbell |
| 698 | `NV_PGSP_QUEUE_HEAD(0)` = 0x110c00. RPC sequence: synchronous calls take |
| 699 | the driver's running RPC counter, asynchronous ones (including the two |
| 700 | pre-boot RPCs) carry 0. |
| 701 | 5. **Receiving** (`check-element` mode): the CPU reads slot 0 of the status |
| 702 | ring, takes elemCount from it, copies all slots, and refuses the message |
| 703 | if the XOR checksum over the padded length is not zero or the seqNum is |
| 704 | not the expected receive count (an older seqNum is consumed and the read |
| 705 | retried up to 3 times). Init is done when a message with function |
| 706 | `GSP_INIT_DONE` 0x1001, sequence 0 and rpc_result NV_OK arrives. |
| 707 | 6. **Oversize RPCs** (`contplan` mode): the largest single RPC is 65488 |
| 708 | bytes (65536 - 48). A larger buffer is sent as the real function with |
| 709 | length 65488 followed by messages whose function is |
| 710 | `CONTINUATION_RECORD` 71, each carrying up to 65456 payload bytes. |
| 711 | 7. **Before boot** the driver queues two asynchronous RPCs into the command |
| 712 | ring so they are the first things GSP-RM reads: `GSP_SET_SYSTEM_INFO` 72 |
| 713 | (payload `GspSystemInfo`: PCI/BAR physical addresses, PCI ids, chipset, |
| 714 | ACPI method data, hypervisor and VF state, host page size; 936 bytes, so |
| 715 | RPC length 968 in one slot; field offsets in the tool's `layout` output; |
| 716 | contents come from the real device, so this is attended-window work) and |
| 717 | `SET_REGISTRY` |
| 718 | 73 (payload `PACKED_REGISTRY_TABLE`, `registry` mode): u32 size, u32 |
| 719 | numEntries, then 16-byte entries {u32 nameOffset; u8 type; u32 data; u32 |
| 720 | length} followed by the packed NUL-terminated names and values in entry |
| 721 | order; a DWORD (type 1) keeps its value in `data` with length 4, STRING |
| 722 | (3) and BINARY (2) put their bytes after the name with `data` = their |
| 723 | offset. An empty registry is not sent at all; a zero-length string or |
| 724 | binary entry is dropped by the driver and refused by the tool. |
| 725 | 8. **Function and event numbers a native kernel must match**: NOP 0, |
| 726 | CONTINUATION_RECORD 71, GSP_SET_SYSTEM_INFO 72, SET_REGISTRY 73, |
| 727 | GSP_RM_CONTROL 76, GSP_RM_ALLOC 103; events GSP_INIT_DONE 0x1001, |
| 728 | GSP_RUN_CPU_SEQUENCER 0x1002, RC_TRIGGERED 0x1004, GSP_LOCKDOWN_NOTICE |
| 729 | 0x101c, GSP_POST_NOCAT_RECORD 0x1020; results RPC_UNKNOWN_FUNCTION |
| 730 | 0xFF100001 and RPC_INVALID_MESSAGE_FORMAT 0xFF100002 are what GSP-RM |
| 731 | returns for a wrong function number or a malformed header. |
| 732 | |
| 733 | Limits: the tool does not know which RPCs after init a native kernel must |
| 734 | send for device init, memory mapping, channel creation and submission |
| 735 | (section 8 item 4 remains open there), knows the size but not the contents |
| 736 | of `GspSystemInfo`, and does not cover the confidential-computing encryption path (assumed off, |
| 737 | as on this machine today). Caching note: the queue buffer is cached sysmem |
| 738 | in the driver with explicit store fences before each writePtr publish and |
| 739 | doorbell write; a native port must keep the fence or use uncached mappings. |
| 740 | |
| 741 | ## 14. The composed boot builder and the post-init RPCs (L192, 2026-10-20) [SOURCE / OBSERVED] |
| 742 | |
| 743 | Plain English: sections 10 to 13 described each piece the driver hands the chip, one at a |
| 744 | time, in standalone tools. `native/kernel/dev/gb10_gsp_boot.c` now builds all of them |
| 745 | together, in kernel-style C (no C library, no device access), into one block of memory with |
| 746 | real cross-links: the boot parameters point at the WprMeta page, the WprMeta page points at |
| 747 | the radix-3 table and the bootloader, the libos page points at the logs and the RPC |
| 748 | arguments, and so on. It also builds the single message SEC2 receives and the messages a |
| 749 | native kernel sends to GSP-RM after it is up. Nothing is loaded and no register is written: |
| 750 | the output is bytes and addresses, ready for an attended run that is not authorized here. |
| 751 | |
| 752 | ### 14.1 What the builder produces |
| 753 | |
| 754 | `gsp_boot_build(arena, inputs, plan)` lays out, every block 4 KiB aligned, in this order: |
| 755 | WprMeta page, libos init-argument page, the seven GB10B log buffers with their PTE prefix, |
| 756 | `GSP_ARGUMENTS_CACHED`, the 129-page RPC shared buffer (page table, command queue with its |
| 757 | `msgqTxHeader`, status queue left zero for GSP to create), the radix-3 table plus a copy of the |
| 758 | GSP-RM ELF, the GspRmBoot bootloader, the signature (size rounded up to 256), the GSP-FMC |
| 759 | image and `GSP_FMC_BOOT_PARAMS`. It queues the two pre-boot RPCs (`GSP_SET_SYSTEM_INFO` with the |
| 760 | caller's 936 bytes, then `SET_REGISTRY` when entries are given; both async, sequence 0, |
| 761 | element seqNum 0 and 1) and returns the SEC2 EMEM packet (MCTP dword `0x00000001` on GB10B, NVDM dword |
| 762 | `0x1410de7e`, 860-byte `NVDM_PAYLOAD_COT`, 868 bytes, QUEUE_TAIL 864). The firmware bytes, |
| 763 | the 512 MiB sysmem heap address, `GspSystemInfo` and the registry are inputs; the builder never |
| 764 | reads a file or a device. |
| 765 | |
| 766 | Post-init encoders over the same ring: `gsp_rpc_rm_alloc` (103), `gsp_rpc_rm_control` (76), |
| 767 | `gsp_rpc_rm_free` (10), `gsp_rpc_get_static_info` (65), and `gsp_mq_recv` for the status queue |
| 768 | (checksum, sequence and element-count checks; the CPU's readPtr lives in the command queue at |
| 769 | rxHdrOff 32, SWAP_RX). Messages stream into the ring slot by slot, including across the ring |
| 770 | end, with no large stack buffer. A full fence precedes every writePtr publish |
| 771 | (message_queue_cpu.c:574-576 uses `portAtomicMemoryFenceStore`); the doorbell write |
| 772 | (`NV_PGSP_QUEUE_HEAD(0)`) is the caller's and is not in this file. |
| 773 | |
| 774 | ### 14.2 New source findings |
| 775 | |
| 776 | 1. **No GFW-boot wait on GB10B** [SOURCE]: `kgspWaitForGfwBootOk` is bound to |
| 777 | `kgspWaitForGfwBootOk_ac1694` for "GB10B | GB20B | GB20C" (g_kernel_gsp_nvoc.c:1499-1513), |
| 778 | which is `return NV_OK;` (g_kernel_gsp_nvoc.h:1889-1891). The Linux driver does not wait for |
| 779 | a GPU firmware boot stage on this chip before talking to SEC2. Narrows section 8 item 3. |
| 780 | 2. **SEC2 send preconditions are software-only** [SOURCE]: `ksec2SafeToSendBootCommands_GB10B` |
| 781 | checks only `PDB_PROP_KSEC2_BOOT_GSPFMC` (kernel_sec2_gb10b.c:415-425), which is NV_TRUE for |
| 782 | GB10B (g_kernel_sec2_nvoc.c:446-455); `ksec2CanSendPacket_GB10B` requires EMEM queue |
| 783 | HEAD == TAIL (kernel_sec2_gb10b.c:344-353). After the packet: `_ksec2WaitForCmdHandling` |
| 784 | (MAILBOX0), then `kgspBootstrap_GH100` waits for the GSP target mask release, read as |
| 785 | `NV_PGSP + NV_PFALCON_FALCON_HWCFG2` being non-zero and not `0xBADF41xx` |
| 786 | (kernel_sec2_gb10b.c:265-283, kernel_gsp_gh100.c:897-910). Still [UNKNOWN]: whether SEC2 is |
| 787 | running and its EMEM queue empty when AIENOS starts without Linux; nothing in the driver |
| 788 | starts SEC2 itself. |
| 789 | 3. **Confidential computing is off by default** [SOURCE]: `PDB_PROP_CONFCOMPUTE_ENABLED` is set |
| 790 | NV_FALSE at construction (g_conf_compute_nvoc.c:235); the encrypted-queue branch of |
| 791 | `GspMsgQueueSendCommand` (message_queue_cpu.c:485-505) is only taken when it is enabled. |
| 792 | Strengthens section 8 item 5 [INFERRED (high)]. `GSP_FMC_BOOT_PARAMS.initParams.regkeys` is |
| 793 | `pCC->gspProxyRegkeys` (kernel_gsp_gh100.c:426); its value without CC is [UNKNOWN] and is a |
| 794 | builder input (default 0). |
| 795 | 4. **DMA targets in GSP_FMC_BOOT_PARAMS** [SOURCE]: `_kgspMemdescToDmaTarget` |
| 796 | (kernel_gsp_gh100.c:390-404) maps cached sysmem to `GSP_DMA_TARGET_COHERENT_SYSTEM` (1) and |
| 797 | uncached sysmem to `NONCOHERENT_SYSTEM` (2). The WprMeta page is cached and the libos page |
| 798 | uncached (kernel_gsp_tu102.c:120-171), so the boot descriptor target is 1 and the boot-args |
| 799 | target is 2. |
| 800 | 5. **`GSP_RM_ALLOC` length leaves the params out** [SOURCE]: `rpcRmApiAlloc_GSP` calls |
| 801 | `rpcWriteCommonHeader(.., sizeof(rpc_gsp_rm_alloc_v03_00))` (rpc.c:11195) and copies the |
| 802 | params after the fixed part without growing the length; `rpcWriteCommonHeader` sets |
| 803 | `length = 32 + paramLength` (rpc_common.c:183). The queue sizes, checksums and element |
| 804 | count from that length (message_queue_cpu.c:465-505) but copies whole 4 KiB slots, so the |
| 805 | params travel in the first slot outside the checksum. The builder reproduces this exactly |
| 806 | and refuses params that would spill past the first slot (more than 3,984 bytes). |
| 807 | `GSP_RM_CONTROL` does count its params (rpc.c:10978-10984: `sizeof(*rpc_params) + |
| 808 | paramsSize`). [UNKNOWN] whether GSP-RM would also accept a length that includes the alloc |
| 809 | params; I keep the driver's form. |
| 810 | 6. **`GET_GSP_STATIC_INFO` request** [SOURCE]: zero-filled, `length = 32 + |
| 811 | sizeof(GspStaticConfigInfo)`, refused by the driver above `maxRpcSize` |
| 812 | (rpc.c `rpcGetGspStaticInfo_v14_00`). `sizeof(GspStaticConfigInfo)` could not be computed: |
| 813 | gsp_static_config.h pulls nvassert.h, which requires an RM port header (`NV_PORT_HEADER`). |
| 814 | [UNKNOWN]; the builder takes the size as a parameter. |
| 815 | |
| 816 | ### 14.3 The object chain to a usable channel [OBSERVED on Linux, INFERRED for native] |
| 817 | |
| 818 | What my working Linux path asks the driver for, in order (physics `nvrm/nvrm.c` at e95e3ed, |
| 819 | the layer every chip result on this box went through): `NV01_ROOT_CLIENT`; |
| 820 | `NV0000_CTRL_CMD_GPU_GET_ID_INFO_V2`; `NV01_DEVICE_0`; `NV20_SUBDEVICE_0`; |
| 821 | `NV01_MEMORY_VIRTUAL`; `NV0080_CTRL_CMD_GPU_GET_CLASSLIST` (twice: count, then list); |
| 822 | `NV2080_CTRL_CMD_GR_GET_INFO`; `FERMI_VASPACE_A`; `NV2080_CTRL_CMD_GPU_GET_GID_INFO`; |
| 823 | `NV01_MEMORY_SYSTEM` per buffer; `KEPLER_CHANNEL_GROUP_A`; `FERMI_CONTEXT_SHARE_A`; |
| 824 | `BLACKWELL_CHANNEL_GPFIFO_A`; `BLACKWELL_COMPUTE_B`; |
| 825 | `NVC36F_CTRL_CMD_GPFIFO_GET_WORK_SUBMIT_TOKEN`; `NVA06C_CTRL_CMD_GPFIFO_SCHEDULE`. |
| 826 | |
| 827 | On Linux these reach CPU-RM first, and CPU-RM forwards to GSP-RM with `GSP_RM_ALLOC` / |
| 828 | `GSP_RM_CONTROL` the objects GSP owns, while doing memory descriptors, page tables and BAR |
| 829 | mappings itself. [INFERRED (medium)] a native kernel sends the same chain through |
| 830 | `gsp_rpc_rm_alloc` / `gsp_rpc_rm_control` with its own handles, after `GSP_INIT_DONE` and |
| 831 | `GET_GSP_STATIC_INFO`. [UNKNOWN] which objects GSP-RM accepts without the CPU-RM-side state |
| 832 | (VA space page directory via `SET_PAGE_DIRECTORY` 54, memory registration) and in what form: |
| 833 | that is the boundary with cut D (L193, GPU page tables and channel model) and is only |
| 834 | settled by reading CPU-RM's per-class forwarding and then by the chip. |
| 835 | |
| 836 | ### 14.4 How it is tested (host only) |
| 837 | |
| 838 | - `make -C native/kernel test-gb10-gsp-boot` (also part of `make test` and `make sanitize`): |
| 839 | every block decoded at hand-written byte offsets, cross-links, determinism, the ring |
| 840 | (full ring, wrap across the ring end, corrupt pointers), the status reader (empty, good, |
| 841 | bad checksum, bad sequence, bad element count) and every input refusal. |
| 842 | - `make -C native/kernel gb10-gsp-nvhdr-test`: the builder's mirror structs compared field by |
| 843 | field (offset and size) with the NVIDIA headers themselves, and a built plan decoded through |
| 844 | NVIDIA's own types (`GspFwWprMeta`, `LibosMemoryRegionInitArgument`, `GSP_ARGUMENTS_CACHED`, |
| 845 | `msgqTxHeader`, `rpc_message_header_v03_00`, `rpc_gsp_rm_alloc_v03_00`, |
| 846 | `rpc_gsp_rm_control_v03_00`, `NVOS00_PARAMETERS_v03_00`, `GSP_FMC_BOOT_PARAMS`, |
| 847 | `NVDM_PAYLOAD_COT`, function and event numbers). Needs the 580.173.02 source tree at |
| 848 | `OGKM_DIR` and fails without it; `make test` runs it through `gb10-gsp-nvhdr-check`, which |
| 849 | prints NOT_RUN instead when the tree is absent. |
| 850 | - `make -C native/kernel gb10-gsp-free`: compiled with the kernel's freestanding flags plus |
| 851 | `-Wstack-usage=4096`; no undefined symbols (no hidden memcpy/memset). |
| 852 | - `make -C native/kernel gb10-gsp-mutants`: four test-only mutants (readPtr read from the wrong |
| 853 | queue, checksum not stored, radix pointers shifted one page, alloc length counting the params) |
| 854 | must each make the test fail. |
| 855 | |
| 856 | Results with commands and exit codes are in the L192 handoff |
| 857 | (`~/handoffs/2026-10-20-gb10-gsp-host.md`). |
| 858 | |
| 859 | ### 14.5 Still needs the chip (unchanged authority: attended window only) |
| 860 | |
| 861 | Whether SEC2 accepts the packet with Linux absent; whether GSP-FMC accepts this WprMeta and |
| 862 | the 133 MiB heap; the real `GspSystemInfo` bytes; `sizeof(GspStaticConfigInfo)`; the per-class |
| 863 | CPU-RM work behind each forwarded alloc; reset and re-open after a failed boot (section 8 |
| 864 | item 7). The builder is not linked into any kernel image. |