[PATCH v4 21/33] gpu: nova-core: Hopper/Blackwell: add FSP message structures

John Hubbard
2026-02-10T02:46:37Z

Add the data structures for FSP Chain of Trust communication. These
include the FMC signature container (hash, public key, signature) and
the NVDM payload structures for sending COT messages and receiving
responses.

Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
drivers/gpu/nova-core/fsp.rs | 76 ++++++++++++++++++++++++++++++++++++
1 file changed, 76 insertions(+)

diff --git a/drivers/gpu/nova-core/fsp.rs b/drivers/gpu/nova-core/fsp.rs
index 5476259d224c..7775f1b673c0 100644
--- a/drivers/gpu/nova-core/fsp.rs
+++ b/drivers/gpu/nova-core/fsp.rs
@@ -124,6 +124,82 @@ unsafe impl AsBytes for GspFmcBootParams {}
// SAFETY: All bit patterns are valid for the primitive fields.
unsafe impl FromBytes for GspFmcBootParams {}

+/// Size constraints for FSP security signatures.
+const FSP_HASH_SIZE: usize = 48; // SHA-384 hash
+const FSP_PKEY_SIZE: usize = 97; // Public key size for GB202 (not 384!)
+const FSP_SIG_SIZE: usize = 96; // Signature size for GB202 (not 384!)
+
+/// Structure to hold FMC signatures.
+#[derive(Debug, Clone, Copy)]
+pub(crate) struct FmcSignatures {
+ hash384: [u8; FSP_HASH_SIZE], // SHA-384 hash (48 bytes)
+ public_key: [u8; 384], // RSA public key (384 bytes)
+ signature: [u8; 384], // RSA signature (384 bytes)
+}
+
+impl Default for FmcSignatures {
+ fn default() -> Self {
+ Self {
+ hash384: [0u8; FSP_HASH_SIZE],
+ public_key: [0u8; 384],
+ signature: [0u8; 384],
+ }
+ }
+}
+
+/// FSP Command Response payload structure.
+/// NVDM_PAYLOAD_COMMAND_RESPONSE structure.
+#[repr(C, packed)]
+#[derive(Clone, Copy)]
+struct NvdmPayloadCommandResponse {
+ task_id: u32,
+ command_nvdm_type: u32,
+ error_code: u32,
+}
+
+/// NVDM (NVIDIA Device Management) COT (Chain of Trust) payload structure.
+/// This is the main message payload sent to FSP for Chain of Trust.
+#[repr(C, packed)]
+#[derive(Clone, Copy)]
+struct NvdmPayloadCot {
+ version: u16, // offset 0x0, size 2
+ size: u16, // offset 0x2, size 2
+ gsp_fmc_sysmem_offset: u64, // offset 0x4, size 8
+ frts_sysmem_offset: u64, // offset 0xC, size 8
+ frts_sysmem_size: u32, // offset 0x14, size 4
+ frts_vidmem_offset: u64, // offset 0x18, size 8
+ frts_vidmem_size: u32, // offset 0x20, size 4
+ // Authentication related fields
+ hash384: [u8; FSP_HASH_SIZE], // offset 0x24, size 48 (0x30)
+ public_key: [u8; FSP_PKEY_SIZE], // offset 0x54, size 384 (0x180)
+ signature: [u8; FSP_SIG_SIZE], // offset 0x1D4, size 384 (0x180)
+ gsp_boot_args_sysmem_offset: u64, // offset 0x354, size 8
+}
+
+/// Complete FSP message structure with MCTP and NVDM headers.
+#[repr(C, packed)]
+#[derive(Clone, Copy)]
+struct FspMessage {
+ mctp_header: u32,
+ nvdm_header: u32,
+ cot: NvdmPayloadCot,
+}
+
+// SAFETY: FspMessage is a packed C struct with only integral fields.
+unsafe impl AsBytes for FspMessage {}
+
+/// Complete FSP response structure with MCTP and NVDM headers.
+#[repr(C, packed)]
+#[derive(Clone, Copy)]
+struct FspResponse {
+ mctp_header: u32,
+ nvdm_header: u32,
+ response: NvdmPayloadCommandResponse,
+}
+
+// SAFETY: FspResponse is a packed C struct with only integral fields.
+unsafe impl FromBytes for FspResponse {}
+
/// FSP interface for Hopper/Blackwell GPUs.
pub(crate) struct Fsp;

--
2.53.0