All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] NVMe: Add SPDM over the storage transport support
@ 2025-08-28  7:25 Wilfred Mallawa
  2025-08-28  7:25 ` [PATCH v2 1/5] spdm-socket: add seperate send/recv functions Wilfred Mallawa
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Wilfred Mallawa @ 2025-08-28  7:25 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Keith Busch, Klaus Jensen, Jesper Devantier, Stefan Hajnoczi,
	Fam Zheng, Philippe Mathieu-Daudé, Kevin Wolf, Hanna Reitz,
	Michael S . Tsirkin, Marcel Apfelbaum, qemu-devel, qemu-block,
	Jonathan Cameron, Wilfred Mallawa

From: Wilfred Mallawa <wilfred.mallawa@wdc.com>

This series extends the existing SPDM support in QEMU to support the DSP0286
SPDM Storage Transport [1] for NVMe. SPDM Storage Transport uses the NVMe
Admin Security Send/Receive commands, as such, support for these commands have
also been added.

With the addition of a new `spdm-trans` CLI argument for NVMe controllers,
users can specify `spdm_trans=nvme` or `spdm_trans=doe`. This allows for the
selection of the SPDM transport. The `doe` option is the current default,
`nvme` would select SPDM Storage Transport for the controller, where SPDM
communication happens over the NVMe Admin Security Send/Receive commands.

Support for DSP0286 already exists in `libspdm` [2] and support for the QEMU
SPDM server is being upstreamed for `spdm-utils` [3]. This series was tested by
using `spdm-utils` as the qemu SPDM server with SPDM Storage Transport support
built with `libspdm` v3.8.0, and `spdm-utils` also as the SPDM requester.

Changes V1 -> V2:
	- spdm_socket_rsp() now uses the new spdm_socket_send/receive()
	  functions. spdm_socket_command_valid() is added to parse the
	  command value incase some bytes were received (result = true) but
	  with an invalid command.

	- Added inline comments to describe fields of
	  StorageSpdmTransportHeader. Checkpatch generates warnings, but lots of
	  existing code does this. The QEMU_PACKED attribute now follows the
	  StorageSpdmTransportHeader struct definition.

	- Use extract32() instead of manual shifting/masking in
	  nvme_sec_prot_spdm_send/recv().

	- Use g_autofree for send/recv buffer allocation
	  in nvme_sec_prot_spdm_send/recv().
	
	- Added explicit fallthrough comment for checking `secp` in
	  nvme_security_receive()
	
	- Added enum support for SPDM transport type, such that a user defined
	  transport type string, can be mapped to the respective enum for
	  internal use.

Wilfred Mallawa (5):
  spdm-socket: add seperate send/recv functions
  spdm: add spdm storage transport virtual header
  hw/nvme: add NVMe Admin Security SPDM support
  spdm: define SPDM transport enum types
  hw/nvme: connect SPDM over NVMe Security Send/Recv

 backends/spdm-socket.c       |  79 ++++++++++--
 docs/specs/spdm.rst          |  10 +-
 hw/nvme/ctrl.c               | 242 +++++++++++++++++++++++++++++++++--
 hw/nvme/nvme.h               |   5 +
 include/block/nvme.h         |  15 +++
 include/hw/pci/pci_device.h  |   2 +
 include/system/spdm-socket.h |  66 +++++++++-
 7 files changed, 391 insertions(+), 28 deletions(-)

-- 
2.51.0



^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH v2 0/5] NVMe: Add SPDM over the storage transport support
@ 2025-09-01  3:47 Wilfred Mallawa
  0 siblings, 0 replies; 9+ messages in thread
From: Wilfred Mallawa @ 2025-09-01  3:47 UTC (permalink / raw)
  To: Alistair Francis
  Cc: Keith Busch, Klaus Jensen, Jesper Devantier, Stefan Hajnoczi,
	Fam Zheng, Philippe Mathieu-Daudé, Kevin Wolf, Hanna Reitz,
	Michael S . Tsirkin, Marcel Apfelbaum, qemu-devel, qemu-block,
	Jonathan Cameron, Wilfred Mallawa

From: Wilfred Mallawa <wilfred.mallawa@wdc.com>

This series extends the existing SPDM support in QEMU to support the DSP0286
SPDM Storage Transport [1] for NVMe. SPDM Storage Transport uses the NVMe
Admin Security Send/Receive commands, as such, support for these commands have
also been added.

With the addition of a new `spdm-trans` CLI argument for NVMe controllers,
users can specify `spdm_trans=nvme` or `spdm_trans=doe`. This allows for the
selection of the SPDM transport. The `doe` option is the current default,
`nvme` would select SPDM Storage Transport for the controller, where SPDM
communication happens over the NVMe Admin Security Send/Receive commands.

Support for DSP0286 already exists in `libspdm` [2] and support for the QEMU
SPDM server is being upstreamed for `spdm-utils` [3]. This series was tested by
using `spdm-utils` as the qemu SPDM server with SPDM Storage Transport support
built with `libspdm` v3.8.0, and `spdm-utils` also as the SPDM requester.

Changes V1 -> V2:
	- spdm_socket_rsp() now uses the new spdm_socket_send/receive()
	  functions. spdm_socket_command_valid() is added to parse the
	  command value incase some bytes were received (result = true) but
	  with an invalid command.

	- Added inline comments to describe fields of
	  StorageSpdmTransportHeader. Checkpatch generates warnings, but lots of
	  existing code does this. The QEMU_PACKED attribute now follows the
	  StorageSpdmTransportHeader struct definition.

	- Use extract32() instead of manual shifting/masking in
	  nvme_sec_prot_spdm_send/recv().

	- Use g_autofree for send/recv buffer allocation
	  in nvme_sec_prot_spdm_send/recv().
	
	- Added explicit fallthrough comment for checking `secp` in
	  nvme_security_receive()
	
	- Added enum support for SPDM transport type, such that a user defined
	  transport type string, can be mapped to the respective enum for
	  internal use.

Changes V2 -> V3:
	- Fixed up the incorrect use of `NVME_NO_COMPLETE` to more appropriate
	  NVMe error codes in Patch [3/5]. Note that DSP0286 does not define
	  error codes for transport level failures.
	
	- Removed NULL check for g_malloc0(). Should abort instead.

Wilfred Mallawa (5):
  spdm-socket: add seperate send/recv functions
  spdm: add spdm storage transport virtual header
  hw/nvme: add NVMe Admin Security SPDM support
  spdm: define SPDM transport enum types
  hw/nvme: connect SPDM over NVMe Security Send/Recv

 backends/spdm-socket.c       |  79 ++++++++++--
 docs/specs/spdm.rst          |  10 +-
 hw/nvme/ctrl.c               | 233 +++++++++++++++++++++++++++++++++--
 hw/nvme/nvme.h               |   5 +
 include/block/nvme.h         |  15 +++
 include/hw/pci/pci_device.h  |   2 +
 include/system/spdm-socket.h |  66 +++++++++-
 7 files changed, 382 insertions(+), 28 deletions(-)

-- 
2.51.0



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-09-01  3:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-28  7:25 [PATCH v2 0/5] NVMe: Add SPDM over the storage transport support Wilfred Mallawa
2025-08-28  7:25 ` [PATCH v2 1/5] spdm-socket: add seperate send/recv functions Wilfred Mallawa
2025-08-28  7:25 ` [PATCH v2 2/5] spdm: add spdm storage transport virtual header Wilfred Mallawa
2025-08-28  7:25 ` [PATCH v2 3/5] hw/nvme: add NVMe Admin Security SPDM support Wilfred Mallawa
2025-08-30  4:17   ` Keith Busch
2025-09-01  3:11     ` Wilfred Mallawa
2025-08-28  7:25 ` [PATCH v2 4/5] spdm: define SPDM transport enum types Wilfred Mallawa
2025-08-28  7:25 ` [PATCH v2 5/5] hw/nvme: connect SPDM over NVMe Security Send/Recv Wilfred Mallawa
  -- strict thread matches above, loose matches on Subject: below --
2025-09-01  3:47 [PATCH v2 0/5] NVMe: Add SPDM over the storage transport support Wilfred Mallawa

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.