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/patches/365740955dc4f171 # 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 ## GitHub aien-dev/aienux#319 (code only) closed derived `365740955dc4f171` #319 Imported from GitHub aien-dev/aienux#319 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `fcb3113c3e91d709fab10d408a3bdf8fb8e7d8ee` · Head `22f8f8a5a34c7a6baf2b18849fd91e772737cc2c` ### Apply it ``` git checkout -b patch-365740955dc4f171 fcb3113c3e91d709fab10d408a3bdf8fb8e7d8ee curl -fsSL https://interplane.io/drakestapleton/aienux/patches/365740955dc4f171.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/aienux 319 22f8f8a5a34c7a6baf2b18849fd91e772737cc2c ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aienux","number":319,"url":"https://github.com/aien-dev/aienux/pull/319","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:12Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.crumb b/.crumb index 5fc298a6..1e13cc87 100644 --- a/.crumb +++ b/.crumb @@ -27,33 +27,33 @@ "purpose": "Directory crates. Purpose not yet described by a human." }, { - "digest": "7e7934c11eb156bf4249648ef757d6135570877703a1ccab214c07cb5a57e235", - "last_commit": "f47f6c7", + "digest": "67c7dafea9dd11fce8a30e2758fc9c0553d5e75c442bc6c2c22f134a090a5008", + "last_commit": "e09825a", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, { - "digest": "362c8c616872caca2069f3e748db0d8fb7c807bff2771679c4973481a15901f2", - "last_commit": "f47f6c7", + "digest": "00b3df5ff408cf07d222d4ebd836026a58a12532ff116b765594246a09a901bc", + "last_commit": "e09825a", "name": "native", "purpose": "Directory native. Purpose not yet described by a human." }, { - "digest": "8f2ba6515d449096eccaa96e1d710d5556e36425d1b82eb8ef096d85200059f9", - "last_commit": "22eb360", + "digest": "348804e26984e873db9914d2a3ebfcf6c9ea02619247d78809999011b354e048", + "last_commit": "e09825a", "name": "scripts", "purpose": "Directory scripts. Purpose not yet described by a human." } ], - "children_root": "sha256:49ee7a6b7ab0a6a96d0329f00ef1839ff64e47aba7d5717ea27f8bbc865ace9f", - "compiled_at": "2026-10-12T11:44:52Z", + "children_root": "sha256:5e6b18b2f6fa0f85281593d5f46a2a039850a7a3bca50f3f06ad88dc557626f9", + "compiled_at": "2026-10-12T12:21:27Z", "compiler": "crumb-compile/1", - "digest": "sha256:1ee2a15770e45746c15c5cdea47206165cf26eda84c4a39d1746c1096d89e9cc", + "digest": "sha256:815433c9c8cef1effe798105427e5d1f18af2014f0d2265838d91ac870214cf6", "evidence_files": 155, "evidence_root": "sha256:d59c0cef4e7dd5172923754a95b411ca54b01f35baca4587f792f1b259f1eaf7", - "files": 3087, - "generated_at_commit": "f47f6c76286d7c85b9d038afc730619c54266a9f", - "source_tree": "sha256:8e951d5463b4dde2502e3e2c7324bae7586f14fb04ef2355bc493b66ec6120e1" + "files": 3091, + "generated_at_commit": "e09825afddde294659ca4a06354990e7ff530b62", + "source_tree": "sha256:6ffa7e6c4e272b46b100fa2f8b698c7d25588870c03b2f320d513ae2297e926a" }, "owner_lane": "", "provenance": { diff --git a/.github/workflows/workflow-files.yml b/.github/workflows/workflow-files.yml new file mode 100644 index 00000000..00cf3702 --- /dev/null +++ b/.github/workflows/workflow-files.yml @@ -0,0 +1,27 @@ +# Always-on guard: a workflow file GitHub cannot parse yields a run with zero +# jobs that never shows in the PR checks, so the job it carries silently stops +# running (2026-10-12: ck-kernel.yml, four hours). This job has no path filter +# and is a required check on main, so that silence becomes a red check. +name: Workflow files accepted + +on: + pull_request: + push: + branches: [main] + +permissions: + actions: read + contents: read + +jobs: + accepted: + name: workflow files accepted + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v4 + - name: Every workflow run on this commit has jobs + env: + GH_TOKEN: ${{ github.token }} + SHA: ${{ github.event.pull_request.head.sha || github.sha }} + run: sh scripts/workflow_files_check.sh "$SHA" diff --git a/docs/.crumb b/docs/.crumb index f1139326..9a9abe12 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -30,14 +30,14 @@ } ], "children_root": "sha256:baea130f2c52779b57d90139beb66ac01b21ab499d113471a334be5500f3e369", - "compiled_at": "2026-10-12T11:39:56Z", + "compiled_at": "2026-10-12T12:21:27Z", "compiler": "crumb-compile/1", - "digest": "sha256:7e7934c11eb156bf4249648ef757d6135570877703a1ccab214c07cb5a57e235", + "digest": "sha256:67c7dafea9dd11fce8a30e2758fc9c0553d5e75c442bc6c2c22f134a090a5008", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 70, - "generated_at_commit": "22eb3603074e5df77df9914dbd301d67122564b5", - "source_tree": "sha256:5641e25791a12e563582b9a529277f203c5ac192ffce39e8720ed47adc0edc19" + "generated_at_commit": "e09825afddde294659ca4a06354990e7ff530b62", + "source_tree": "sha256:479955d7d585b02e7323f4dbdbab0ac2ad395207ce4475eb4138b985ba7cb9ad" }, "owner_lane": "", "provenance": { diff --git a/docs/GB10_FIRMWARE_INVENTORY.md b/docs/GB10_FIRMWARE_INVENTORY.md index ac12670a..370d15fe 100644 --- a/docs/GB10_FIRMWARE_INVENTORY.md +++ b/docs/GB10_FIRMWARE_INVENTORY.md @@ -35,6 +35,12 @@ the driver on the box; fetched read-only into a scratch directory, not vendored) container exactly as the driver does, refuses every malformed shape it was given in its self-test (22 mutations plus every truncation), and proves the file on this box matches the pinned digest. It never loads anything. +- Two more hosted tools, same rule (nothing is ever sent to the chip): + `ck_gsp_cot_encode` builds and checks the exact message the driver sends to + SEC2 (section 10), and `ck_gsp_bindata_extract` reads the eight GB10B + firmware arrays out of the public driver source with our own inflater and + hash code, cross-checks every size, record and digest, and writes them as + files (section 11). `make -C native/kernel test` runs all three self-tests. - The largest remaining unknowns for a native bring-up (section 8) are the SEC2 command protocol details beyond what the driver source shows, the exact GspFwWprMeta/boot-argument layout expected by this GSP-FMC build, and @@ -93,15 +99,35 @@ The driver embeds these as C byte arrays ("bindata") with an MIT licence header `kgspGetBinArchiveGspRmFmcGfwProdSigned_GB10B` [g_kernel_gsp_nvoc.c:924-926] (debug-fused parts use the `...DebugSigned_GB10B` archive, [889-891]). -| Archive label | Original file name (NVIDIA internal) | Bytes | -|---|---|---| -| GspRmBoot_GB10B UCODE_IMAGE_PROD | kernel/inc/gspcc/bin/g_gsp_gb10b_dyn_prd_image.bin | 196,608 | -| GspRmBoot_GB10B UCODE_DESC_PROD | kernel/inc/gspcc/bin/g_gsp_gb10b_dyn_prd_desc.bin | 84 (RM_RISCV_UCODE_DESC) | -| GspRmBoot_GB10B UCODE_IMAGE_DBG / DESC_DBG | ..._dbg_image.bin / ..._dbg_desc.bin | 196,608 / 84 | -| GspRmFmcGfwProdSigned_GB10B UCODE_IMAGE | kernel/inc/gspcc/bin/g_gsp_gb10b_dyn_prd_gfw_image.bin | 195,912 | -| GspRmFmcGfwProdSigned_GB10B UCODE_HASH | g_gsp_gb10b_dyn_prd_gfw_hash.bin | 48 (SHA-384) | -| GspRmFmcGfwProdSigned_GB10B UCODE_SIG | g_gsp_gb10b_dyn_prd_gfw_sig.bin | 384 | -| GspRmFmcGfwProdSigned_GB10B UCODE_PKEY | g_gsp_gb10b_dyn_prd_gfw_pub_key.bin | 384 | +| Archive label | Original file name (NVIDIA internal) | Bytes | Stored as | sha256 of the bytes [OBSERVED] | +|---|---|---|---|---| +| GspRmBoot_GB10B UCODE_IMAGE_PROD | kernel/inc/gspcc/bin/g_gsp_gb10b_dyn_prd_image.bin | 196,608 | raw | 427a691d8453f02548d395f40ac900eb0d5b8ea864e8f14f958eef890ba400a2 | +| 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 | +| GspRmBoot_GB10B UCODE_IMAGE_DBG | kernel/inc/gspcc/bin/g_gsp_gb10b_dyn_dbg_image.bin | 196,608 | raw | 709b88a88fc7ae9bd56b010bcc0a8269d4d40b3c0454aa5b366e8d562d83a404 | +| 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) | +| GspRmFmcGfwProdSigned_GB10B UCODE_IMAGE | kernel/inc/gspcc/bin/g_gsp_gb10b_dyn_prd_gfw_image.bin | 195,912 | raw | b13ead4b9a6b8a0d268f3094cc4f4521d6be8a9a525edbc9a8f3f397c86f1f2e | +| GspRmFmcGfwProdSigned_GB10B UCODE_HASH | g_gsp_gb10b_dyn_prd_gfw_hash.bin | 48 (SHA-384) | raw | f0389f3a9ce3bb6093e80bfc924bbe2a4ece0199b080a37f64bc1fef63f7500c | +| GspRmFmcGfwProdSigned_GB10B UCODE_SIG | g_gsp_gb10b_dyn_prd_gfw_sig.bin | 384 | raw | 9db429257a18e7c5c1a3df185001c671e21bec4e94c719a574d2ce72e2e07272 | +| GspRmFmcGfwProdSigned_GB10B UCODE_PKEY | g_gsp_gb10b_dyn_prd_gfw_pub_key.bin | 384 | raw | e9bbc669c27ad8827b5bbc2b2f52fdb47718659a651088869a5f3b11d2df7816 | + +Digests measured 2026-10-12 by `ck_gsp_bindata_extract` over the two files +fetched from the 580.173.02 tag (raw.githubusercontent.com, path +`src/nvidia/generated/`); the 580.173.02 Makefile pin +(`make -C native/kernel gsp-bindata-test`) checks the two image digests and +the decoded descriptor on every run. `UCODE_HASH` equals SHA-384 of +`UCODE_IMAGE` [OBSERVED, checked by the tool]. + +Array storage format [SOURCE]: each array is a `BINDATA_STORAGE_PVT` record +(uncompressed size, compressed size, data pointer, bCompressed, +bFileOverride, bReferencedDuringLoad) and an archive table +(`BINDATA_ARCHIVE` with `entryNum` and label/storage pairs) [bin_data_pvt.h, +bin_data.h]. A compressed array is a gzip member without the 10-byte gzip +header: raw DEFLATE, then CRC-32 and ISIZE, little endian. The driver inflates +it with its own zlib-style decoder (`utilGzAllocate`/`utilGzGetData`, +bin_data.c:36-45,96); the nouveau extractor prepends exactly that header +before `gzip.decompress` [nouveau/extract-firmware-nouveau.py:107-108]. +The 28-byte descriptor is 20 bytes of fixed-Huffman DEFLATE plus the two +trailers [OBSERVED]; our decoder verifies both. Source files: `src/nvidia/generated/g_bindata_kgspGetBinArchiveGspRmBoot_GB10B.c` (2,466,261 bytes of C) and @@ -111,9 +137,27 @@ file. The README says the `nouveau/` script "is used to extract some of the firmware binary images (and related data) encoded in the source code and store them as distinct files. These files are used by the Nouveau device driver" [README.md:170-173]; that script knows gh100, gb100 and gb202 FMC images, not -gb10b [nouveau/extract-firmware-nouveau.py:655-662,775-781]. Extracting the -GB10B arrays would be our own small step over the same public source. -[INFERRED (high)] +gb10b [nouveau/extract-firmware-nouveau.py:655-662,775-781]. DONE +2026-10-12: `ck_gsp_bindata_extract` (section 11) is that step, written +against the generated-file grammar and the storage records, not against the +nouveau script. + +Descriptor decode [SOURCE rmRiscvUcode.h:36-87, 21 u32 fields; OBSERVED +values]: version 5; bootloader/riscvElf/swbrom offsets and sizes 0; +manifest at 0x0 size 0xa00; monitorData at 0xa00 size 0xa600; monitorCode at +0xb000 size 0x24d00 (ends at 0x2fd00, inside the 196,608-byte image); +bIsMonitorEnabled 1; appVersion 0; fbReservedSize 0; bSignedAsCode 0. The +driver shifts these offsets by `RISCV_BR_ADDR_ALIGNMENT` = 8 bits when it +programs them [kernel_gsp_gh100.c:47, kernel_gsp_ga102.c:44], so the tool +refuses any region that is not 256-byte aligned. + +Which archive the driver picks for GB10B [SOURCE]: the HAL dispatch for +`kgspGetGspRmBootUcodeStorage` lands on the GB100 variant +[kernel_gsp_gb100.c:115-149], which outside confidential computing calls the +GA102 variant [kernel_gsp_ga102.c:101-120]: the `GspRmBoot` archive's +`UCODE_IMAGE_PROD` and `UCODE_DESC_PROD` (the DBG pair only on a debug-fused +part). The `GspRmFmcGfwProdSigned` quartet goes into the SEC2 chain-of-trust +payload (section 10). ### 3.4 Pieces that are NOT on the host side at all @@ -247,13 +291,13 @@ code into AIENOS would require carrying the MIT notice (none was copied here). - Cut C "inventory" is done by this document; "parsers and refusal tests for firmware metadata" by `ck_gsp_fw_inspect`. The next host-only steps that do - not need the machine: (a) a small extractor over the two public - `g_bindata_*_GB10B.c` files that writes the eight arrays as files with - digests (our own tool, no Python); (b) a C struct definition and encoder for - `NVDM_PAYLOAD_COT` and the MCTP/NVDM headers with fixture tests, from - `src/nvidia/inc/kernel/gpu/fsp/kern_fsp_cot_payload.h`, - `fsp/fsp_nvdm_format.h`, `fsp/fsp_mctp_format.h` (not yet read); (c) the - `GspFwWprMeta` and GSP-FMC argument layouts from the same source tree. + not need the machine: (a) DONE 2026-10-12: `ck_gsp_bindata_extract` + (section 11) writes the eight arrays as files with digests, own DEFLATE and + SHA-384, `make -C native/kernel gsp-bindata-test`; (b) DONE 2026-10-12: the encoder, decoder + and refusal tests for `NVDM_PAYLOAD_COT`, the MCTP/NVDM headers, the EMEM + packet and `GSP_FMC_BOOT_PARAMS` are `ck_gsp_cot_encode` (section 10); + (c) remaining: an encoder for `GspFwWprMeta` (256 bytes, layout known, the + GH100 populate values not yet traced) and the libos init-argument block. - The machine-side part of cut C (first SEC2 command, FMC boot, GSP-RM init done) is an attended-window item under the P08 rules: documented cold power state, no prior Linux GPU initialization, camera, abort rule, and the @@ -261,11 +305,17 @@ code into AIENOS would require carrying the MIT notice (none was copied here). ## 8. Known unknowns -1. [UNKNOWN] The exact `NVDM_PAYLOAD_COT` field layout, `cotPayloadVersion`, - `cotPayloadSignatureSize` and `cotPayloadPublicKeySize` values for GB10B - (set in the SEC2 object constructor; not read). -2. [UNKNOWN] The `GspFwWprMeta`, GSP-FMC argument block (`pGspFmcArgumentsCached`) - and libos init-argument layouts this FMC build expects. +1. RESOLVED 2026-10-12 [SOURCE]: the `NVDM_PAYLOAD_COT` layout is 860 packed + bytes, GB10B uses version 1, signature and key sizes 384, hash 48; the + whole wire format is in section 10 and checked by `ck_gsp_cot_encode`. +2. [PARTLY RESOLVED 2026-10-12] `GSP_FMC_BOOT_PARAMS` (88 bytes, section 10) + and the `GspFwWprMeta` struct (256 bytes, `gsp/gsp_fw_wpr_meta.h`, magic + `0xdc3aae21371a60b3`, revision 1; GB10B zeroes `vgaWorkspaceSize`, + `pmuReservedSize` and `nonWprHeapSize`, kernel_gsp_gb10b.c:32-55) are + known. [UNKNOWN] the values `kgspPopulateWprMeta_GH100` computes (radix3 + ELF placement, heap sizes, WPR carveout) and the libos init-argument block + (`gsp_init_args.h` gives `GSP_ARGUMENTS_CACHED`; the libos block itself not + traced). 3. [UNKNOWN] What SEC2 requires to be already true when the first command arrives (its own firmware loaded by the SoC boot chain? clocks? power state?), and whether UEFI leaves the GPU in that state at AIENOS entry. @@ -276,11 +326,19 @@ code into AIENOS would require carrying the MIT notice (none was copied here). mapping, channel, submit) but which RPCs are mandatory is not established. 5. [UNKNOWN] Whether the confidential-computing (`_cc_`) sections or the SPDM session are ever required on this platform. Assumed not [INFERRED (high)]. -6. [UNKNOWN] The exact meaning of the `GspRmBoot_GB10B` image versus the - `GspRmFmcGfwProdSigned_GB10B` image (both ~196 KiB): the SEC2 path sends the - FMC archive, the boot-binary preparation copies the GspRmBoot image and its - RM_RISCV_UCODE_DESC; which one the GSP's boot ROM consumes on GB10B, and how - the descriptor offsets are used, was not traced end to end. +6. [RESOLVED on the host side 2026-10-12, SOURCE; consumer side INFERRED + (medium)] `GspRmFmcGfwProdSigned_GB10B` (image, hash, signature, public + key) is what SEC2 receives in the chain-of-trust payload (section 10). + `GspRmBoot_GB10B` (image plus RM_RISCV_UCODE_DESC) is what + `kgspPopulateWprMeta_GH100` describes to the FMC as the "GSP-FMC ucode" + bootloader: `sizeOfBootloader`, `sysmemAddrOfBootloader`, + `bootloaderCodeOffset`/`DataOffset`/`ManifestOffset` come from that image + and the descriptor's monitorCode/monitorData/manifest offsets + [kernel_gsp_gh100.c:295-335]; the direct boot-ROM path programs the same + three regions into `NV_PGSP_FALCON_BCR_DMAADDR_*` [kernel_gsp_gh100.c: + `_kgspBootstrapGspFmc_GH100`], which GB10B does not take (section 11). + Who reads the WprMeta bootloader fields on the SEC2 path (FMC or ACR) runs + inside NVIDIA code and is not readable. 7. [UNKNOWN] Reset and re-open behavior on GB10B after a failed FMC boot (`kgspResetHw_GB100` waits for "reset access"); needed for the resource-incarnation protection (#285) before any repeated attempt. @@ -293,9 +351,166 @@ binary), kernel_gsp_gh100.c (prepare, bootstrap), kernel_gsp_gb100.c, kernel_gsp_gb10b.c, kernel_gsp_booter.c and kernel_gsp_fwsec.c (grep only), kernel_sec2_gb10b.c, g_kernel_gsp_nvoc.c/.h, g_kernel_sec2_nvoc.c, g_kern_fsp_nvoc.c (property tables only), the two GB10B bindata files -(metadata comments only), README.md, COPYING, the firmware copyright file. Not -read: kern_fsp_cot_payload.h, the NVDM/MCTP format headers, kernel_sec2.c -(`ksec2SendMessage`), the GSP RPC layer, dev_sec_pri.h register values, ACR or -GSP internals (not available). No Context7 or web manual covers this layer; the +(metadata comments only), README.md, COPYING, the firmware copyright file; +for section 10 also kern_fsp_cot_payload.h, fsp_nvdm_format.h, +fsp_mctp_format.h, fsp_emem_channels.h, kernel_sec2.c (`ksec2SendMessage`, +`ksec2PollForCanSend`), g_kernel_sec2_nvoc.c/.h (version, sizes, SEID), +gspifpub.h, gsp_init_args.h, gsp_fw_wpr_meta.h, kernel_gsp_gh100.c +(`kgspSetupGspFmcArgs`), and published/blackwell/gb10b dev_sec_pri.h, +dev_gsp.h, dev_falcon_v4.h; for sections 3.3 and 11 also rmRiscvUcode.h, +bin_data.c, bin_data.h, bin_data_pvt.h, kernel_gsp_ga102.c, +nouveau/extract-firmware-nouveau.py (lines 82-114 only), kernel_gsp_gh100.c +(`kgspBootstrap_GH100`, `_kgspLockdownReleasedOrFmcError`, +`kgspPopulateWprMeta_GH100`, `_kgspBootstrapGspFmc_GH100`), g_kern_fsp_nvoc.c +(the `PDB_PROP_KFSP_IS_MISSING` chip list), and the full bindata record +tables of both GB10B files. Not read: the GSP RPC layer, the libos +init-argument block, ACR or GSP internals (not available). No Context7 or web manual covers this layer; the DGX Spark user guide is silent on GSP firmware loading (DOCS SILENT on native GSP bring-up). + +## 10. The SEC2 chain-of-trust message, byte for byte [SOURCE] + +Everything in this section is read from open-gpu-kernel-modules tag +580.173.02 and mirrored by `native/kernel/tools/ck_gsp_cot_encode.c` +(`make -C native/kernel gsp-cot-test`, part of `make test`). Nothing here was +sent to the device. + +Transport. NVDM (NVIDIA Data Model) over MCTP over SEC2 EMEM channel 0, +1024 bytes (`fsp/fsp_emem_channels.h:9-11`; `kernel_sec2_gb10b.c:36-41`, +`:322-333`). A packet is two header dwords then the payload +(`kernel_sec2.c:50-52`, `:305-325`): + +| dword | field | value for the boot message | source | +|---|---|---|---| +| 0 | MCTP transport header: 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 | `0xC0000000` (SOM=1, EOM=1, SEQ=0, SEID=0; the driver sets only those four) | `fsp_mctp_format.h:8-16`; `kernel_sec2.c:319-321`; SEID 0 for GB10B `g_kernel_sec2_nvoc.c:879-888`, `g_kernel_sec2_nvoc.h:907-909` | +| 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` | + +A message longer than 1016 bytes would continue in packets that carry only +the MCTP dword with SOM=0 and SEQ = (n mod 4) (`kernel_sec2.c:330-357`); the +boot message is 860 bytes, so it is always one packet, and the driver sends +only this one command on the channel (`kernel_sec2_gb10b.c:719-722`). + +Payload `NVDM_PAYLOAD_COT`, `#pragma pack(1)`, 860 bytes +(`src/nvidia/inc/kernel/gpu/fsp/kern_fsp_cot_payload.h:12-29`): + +| offset | size | field | GB10B value | source | +|---|---|---|---|---| +| 0 | 2 | version | 1 | `g_kernel_sec2_nvoc.c:478-482` | +| 2 | 2 | size | 860 (`sizeof`) | `kernel_sec2_gb10b.c:580-581` | +| 4 | 8 | gspFmcSysmemOffset | physical address of the GSP-FMC image in system memory | `:507` | +| 12 | 8 | frtsSysmemOffset | 0 (never set) | `:578` zero-fill | +| 20 | 4 | frtsSysmemSize | the GSP-FMC image size (195,912), sic | `:508` | +| 24 | 8 | frtsVidmemOffset | 0 | `:578` | +| 32 | 4 | frtsVidmemSize | 0 | `:578` | +| 36 | 48 | hash384 | `UCODE_HASH` array | `:514` | +| 84 | 384 | publicKey | `UCODE_PKEY` array | `:526-527`; size `g_kernel_sec2_nvoc.c:475-476` | +| 468 | 384 | signature | `UCODE_SIG` array | `:519-520`; size `g_kernel_sec2_nvoc.c:472-473` | +| 852 | 8 | gspBootArgsSysmemOffset | physical address of `GSP_FMC_BOOT_PARAMS` | `:532`, `:241-258` | + +The packet is therefore 868 bytes. It is written at EMEM offset 0 with the +write auto-increment bit, one dword at a time, then QUEUE_HEAD(0) = 0 and +QUEUE_TAIL(0) = 864 (padded size minus one dword) (`kernel_sec2_gb10b.c: +700-732`, `:108-152`, `:160-210`). The channel may be written only while +HEAD == TAIL (`:344-356`, polled `kernel_sec2.c:605-640`); the command counts +as handled once FALCON_MAILBOX0 no longer reads `0xc001cafe` (`:285-297`); +before the boot the driver also waits until the GSP falcon's HWCFG2 register +reads non-zero and not the `0xBADF41xx` "target locked" pattern (`:262-281`). +Register addresses for GB10B: `published/blackwell/gb10b/dev_sec_pri.h` +(MAILBOX0/1, QUEUE_HEAD/TAIL(i), EMEMC(i), EMEMD(i)), `dev_gsp.h` (NV_PGSP +base), `dev_falcon_v4.h` (HWCFG2); the tool does not use them. + +Boot arguments the payload points at: `GSP_FMC_BOOT_PARAMS` +(`src/nvidia/arch/nvalloc/common/inc/gsp/gspifpub.h`), natural C layout, 88 +bytes on the LP64 ABI the driver and this host share (the self-test checks the +offsets against the compiler); filled by `kgspSetupGspFmcArgs_GH100` +(`kernel_gsp_gh100.c:415-470`), allocated 4 KiB aligned (`:164`): + +| offset | size | field | fresh-boot value | +|---|---|---|---| +| 0 | 4 | initParams.regkeys | 0 unless CC or NVLink proxy keys | +| 8 | 4 | bootGspRmParams.target | DMA target of the descriptor (0 FB, 1 coherent sysmem, 2 non-coherent sysmem) | +| 12 | 4 | bootGspRmParams.gspRmDescSize | 256 (`sizeof GspFwWprMeta`) | +| 16 | 8 | bootGspRmParams.gspRmDescOffset | physical address of the `GspFwWprMeta` | +| 24 | 8 | bootGspRmParams.wprCarveoutOffset | not set by the driver (0) | +| 32 | 4 | bootGspRmParams.wprCarveoutSize | not set (0) | +| 36 | 1 | bootGspRmParams.bIsGspRmBoot | 1 | +| 40 | 4 | gspRmParams.target | DMA target of the libos init arguments | +| 48 | 8 | gspRmParams.bootArgsOffset | physical address of the libos init arguments | +| 56 | 24 | gspSpdmParams | only with SPDM (assumed off) | +| 80 | 8 | gspRmMemParams.flushSysmemAddrVal{Lo,Hi} | only with CC (0) | + +INFERRED, enforced by the tool but not a driver check: the image address is +4 KiB aligned (the driver maps `NV_ALIGN_UP(size, 0x1000)` bytes of +page-granular system memory, `kernel_sec2_gb10b.c:489-495`) and every +system address fits the 41-bit DMA window `/proc/driver/nvidia/gpus` reports +for this GPU (section 2; `--dma-bits` overrides). + +Evidence 2026-10-12 on the box: `CK_GSP_COT_ENCODE_SELFTEST: PASS` (80 checks: +both layouts against the compiler, golden header words, encode/decode round +trips, 46 field mutations and every header truncation refused by name), same +under ASan/UBSan. + +## 11. Extracted arrays and the GB10B boot decision [SOURCE] + +Tool: `native/kernel/tools/ck_gsp_bindata_extract.c` (hosted C, no +dependencies beyond our own `native/argus/sha256.c`; SHA-384, CRC-32 and the +raw-DEFLATE decoder, stored/fixed/dynamic blocks, are in the tool). +`make -C native/kernel gsp-bindata-extract` builds it; +`make -C native/kernel gsp-bindata-test` runs the self-test and, when the two +driver files are present under `GSP_BINDATA_DIR` (default +`~/.cache/aienos/open-gpu-kernel-modules-580.173.02`), the pin check; it is +part of `make test`. Without the files the pin line reads `NOT_RUN`, never +PASS. + +What it checks before it writes a byte: the generated-file grammar +(`FUNCTION`, `FILE NAME`, `FILE TYPE BINARY`, `COMPRESSION`, `COMPLEX_STRUCT +NO`, `DATA SIZE`, `COMPRESSED SIZE`), the array identifier +`kgspBinArchive_BINDATA_LABEL_