From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
This header contains the transport encoding for an SPDM message that
uses the SPDM over Storage transport as defined by the DMTF DSP0286.
Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
---
include/system/spdm-socket.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/system/spdm-socket.h b/include/system/spdm-socket.h
index 29aa04fd52..80cd7021c1 100644
--- a/include/system/spdm-socket.h
+++ b/include/system/spdm-socket.h
@@ -88,6 +88,18 @@ bool spdm_socket_send(const int socket, uint32_t socket_cmd,
*/
void spdm_socket_close(const int socket, uint32_t transport_type);
+/*
+ * Defines the transport encoding for SPDM, this information shall be passed
+ * down to the SPDM server, when conforming to the SPDM over Storage standard
+ * as defined by DSP0286.
+ */
+typedef struct {
+ uint8_t security_protocol; /* Must be 0xE8 for SPDM Commands */
+ uint16_t security_protocol_specific; /* Bit[7:2] SPDM Operation
+ Bit[0:1] Connection ID */
+ uint32_t length; /* Length of the SPDM Message*/
+} QEMU_PACKED StorageSpdmTransportHeader;
+
#define SPDM_SOCKET_COMMAND_NORMAL 0x0001
#define SPDM_SOCKET_STORAGE_CMD_IF_SEND 0x0002
#define SPDM_SOCKET_STORAGE_CMD_IF_RECV 0x0003
--
2.51.0
On Fri, 12 Sep 2025 12:11:49 +1000
Wilfred Mallawa <wilfred.opensource@gmail.com> wrote:
> From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
>
> This header contains the transport encoding for an SPDM message that
> uses the SPDM over Storage transport as defined by the DMTF DSP0286.
>
> Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
FWIW I checked the field definitions that I could find, and this looks fine.
If it's possible to give more focused reference (section etc) that might
be worth doing. For example I wasn't entirely sure where the size of
the security_protocol field is defined. This matches with what libspdm has
though.
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> ---
> include/system/spdm-socket.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/include/system/spdm-socket.h b/include/system/spdm-socket.h
> index 29aa04fd52..80cd7021c1 100644
> --- a/include/system/spdm-socket.h
> +++ b/include/system/spdm-socket.h
> @@ -88,6 +88,18 @@ bool spdm_socket_send(const int socket, uint32_t socket_cmd,
> */
> void spdm_socket_close(const int socket, uint32_t transport_type);
>
> +/*
> + * Defines the transport encoding for SPDM, this information shall be passed
> + * down to the SPDM server, when conforming to the SPDM over Storage standard
> + * as defined by DSP0286.
> + */
> +typedef struct {
> + uint8_t security_protocol; /* Must be 0xE8 for SPDM Commands */
> + uint16_t security_protocol_specific; /* Bit[7:2] SPDM Operation
> + Bit[0:1] Connection ID */
> + uint32_t length; /* Length of the SPDM Message*/
> +} QEMU_PACKED StorageSpdmTransportHeader;
> +
> #define SPDM_SOCKET_COMMAND_NORMAL 0x0001
> #define SPDM_SOCKET_STORAGE_CMD_IF_SEND 0x0002
> #define SPDM_SOCKET_STORAGE_CMD_IF_RECV 0x0003
On Wed, 2025-10-01 at 09:56 +0100, Jonathan Cameron wrote:
> On Fri, 12 Sep 2025 12:11:49 +1000
> Wilfred Mallawa <wilfred.opensource@gmail.com> wrote:
>
> > From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
> >
> > This header contains the transport encoding for an SPDM message
> > that
> > uses the SPDM over Storage transport as defined by the DMTF
> > DSP0286.
> >
> > Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
>
> FWIW I checked the field definitions that I could find, and this
> looks fine.
> If it's possible to give more focused reference (section etc) that
> might
> be worth doing. For example I wasn't entirely sure where the size of
> the security_protocol field is defined. This matches with what
> libspdm has
> though.
In regards to the security_protocol field, this is specified in the
SCSI Primary Commands - 5 (SPC-5). Note that even the NVMe spec also
refers to the SPC-5 for this definition. In which it is defined to be a
byte in length. I will add references to this for V8.
Thanks,
Wilfred
> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
>
>
> > ---
> > include/system/spdm-socket.h | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/include/system/spdm-socket.h b/include/system/spdm-
> > socket.h
> > index 29aa04fd52..80cd7021c1 100644
> > --- a/include/system/spdm-socket.h
> > +++ b/include/system/spdm-socket.h
> > @@ -88,6 +88,18 @@ bool spdm_socket_send(const int socket, uint32_t
> > socket_cmd,
> > */
> > void spdm_socket_close(const int socket, uint32_t transport_type);
> >
> > +/*
> > + * Defines the transport encoding for SPDM, this information shall
> > be passed
> > + * down to the SPDM server, when conforming to the SPDM over
> > Storage standard
> > + * as defined by DSP0286.
> > + */
> > +typedef struct {
> > + uint8_t security_protocol; /* Must be 0xE8 for
> > SPDM Commands */
> > + uint16_t security_protocol_specific; /* Bit[7:2] SPDM
> > Operation
> > + Bit[0:1] Connection
> > ID */
> > + uint32_t length; /* Length of the SPDM
> > Message*/
> > +} QEMU_PACKED StorageSpdmTransportHeader;
> > +
> > #define SPDM_SOCKET_COMMAND_NORMAL 0x0001
> > #define SPDM_SOCKET_STORAGE_CMD_IF_SEND 0x0002
> > #define SPDM_SOCKET_STORAGE_CMD_IF_RECV 0x0003
On Sep 12 12:11, Wilfred Mallawa wrote:
> From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
>
> This header contains the transport encoding for an SPDM message that
> uses the SPDM over Storage transport as defined by the DMTF DSP0286.
>
> Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
> ---
> include/system/spdm-socket.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/include/system/spdm-socket.h b/include/system/spdm-socket.h
> index 29aa04fd52..80cd7021c1 100644
> --- a/include/system/spdm-socket.h
> +++ b/include/system/spdm-socket.h
> @@ -88,6 +88,18 @@ bool spdm_socket_send(const int socket, uint32_t socket_cmd,
> */
> void spdm_socket_close(const int socket, uint32_t transport_type);
>
> +/*
> + * Defines the transport encoding for SPDM, this information shall be passed
> + * down to the SPDM server, when conforming to the SPDM over Storage standard
> + * as defined by DSP0286.
> + */
> +typedef struct {
> + uint8_t security_protocol; /* Must be 0xE8 for SPDM Commands */
> + uint16_t security_protocol_specific; /* Bit[7:2] SPDM Operation
> + Bit[0:1] Connection ID */
> + uint32_t length; /* Length of the SPDM Message*/
> +} QEMU_PACKED StorageSpdmTransportHeader;
> +
> #define SPDM_SOCKET_COMMAND_NORMAL 0x0001
> #define SPDM_SOCKET_STORAGE_CMD_IF_SEND 0x0002
> #define SPDM_SOCKET_STORAGE_CMD_IF_RECV 0x0003
> --
> 2.51.0
>
The above struct is specific to the communication protocol with the
specific SPDM server, correct? It's not defined by DSP0286 as far as I
can tell?
On Wed, 2025-10-01 at 10:46 +0200, Klaus Jensen wrote:
> On Sep 12 12:11, Wilfred Mallawa wrote:
> > From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
> >
> > This header contains the transport encoding for an SPDM message
> > that
> > uses the SPDM over Storage transport as defined by the DMTF
> > DSP0286.
> >
> > Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
> > ---
> > include/system/spdm-socket.h | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/include/system/spdm-socket.h b/include/system/spdm-
> > socket.h
> > index 29aa04fd52..80cd7021c1 100644
> > --- a/include/system/spdm-socket.h
> > +++ b/include/system/spdm-socket.h
> > @@ -88,6 +88,18 @@ bool spdm_socket_send(const int socket, uint32_t
> > socket_cmd,
> > */
> > void spdm_socket_close(const int socket, uint32_t transport_type);
> >
> > +/*
> > + * Defines the transport encoding for SPDM, this information shall
> > be passed
> > + * down to the SPDM server, when conforming to the SPDM over
> > Storage standard
> > + * as defined by DSP0286.
> > + */
> > +typedef struct {
> > + uint8_t security_protocol; /* Must be 0xE8 for
> > SPDM Commands */
> > + uint16_t security_protocol_specific; /* Bit[7:2] SPDM
> > Operation
> > + Bit[0:1] Connection
> > ID */
> > + uint32_t length; /* Length of the SPDM
> > Message*/
> > +} QEMU_PACKED StorageSpdmTransportHeader;
> > +
> > #define SPDM_SOCKET_COMMAND_NORMAL 0x0001
> > #define SPDM_SOCKET_STORAGE_CMD_IF_SEND 0x0002
> > #define SPDM_SOCKET_STORAGE_CMD_IF_RECV 0x0003
> > --
> > 2.51.0
> >
>
> The above struct is specific to the communication protocol with the
> specific SPDM server, correct? It's not defined by DSP0286 as far as
> I
> can tell?
Yeah that's correct. For example, spdm-utils will use this [1]. Which
is the only server to support SPDM Storage as far as I am aware.
[1] https://github.com/westerndigitalcorporation/spdm-utils/pull/139
© 2016 - 2026 Red Hat, Inc.