From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Wilfred Mallawa <wilfred.opensource@gmail.com>
Cc: "Alistair Francis" <alistair.francis@wdc.com>,
"Keith Busch" <kbusch@kernel.org>,
"Klaus Jensen" <its@irrelevant.dk>,
"Jesper Devantier" <foss@defmacro.it>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Fam Zheng" <fam@euphon.net>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Kevin Wolf" <kwolf@redhat.com>,
"Hanna Reitz" <hreitz@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
"Wilfred Mallawa" <wilfred.mallawa@wdc.com>
Subject: Re: [PATCH 4/4] hw/nvme: connect SPDM over NVMe Security Send/Recv
Date: Tue, 26 Aug 2025 12:21:27 +0100 [thread overview]
Message-ID: <20250826122127.000061fc@huawei.com> (raw)
In-Reply-To: <20250826054630.222052-5-wilfred.opensource@gmail.com>
On Tue, 26 Aug 2025 15:46:30 +1000
Wilfred Mallawa <wilfred.opensource@gmail.com> wrote:
> From: Wilfred Mallawa <wilfred.mallawa@wdc.com>
>
> This patch extends the existing support we have for NVMe with only DoE
> to also add support to SPDM over the NVMe Security Send/Recv commands.
>
> With the new definition of the `spdm-trans` argument, users can specify
> `spdm_trans=nvme` or `spdm_trans=doe`. This allows us to select the SPDM
> transport respectively. SPDM over the NVMe Security Send/Recv commands
> are defined in the DMTF DSP0286.
>
> Signed-off-by: Wilfred Mallawa <wilfred.mallawa@wdc.com>
A few comments inline.
Jonathan
> diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> index 442144642d..61feb9b35a 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -8849,6 +8849,23 @@ static DOEProtocol doe_spdm_prot[] = {
> { }
> };
>
> +static inline uint32_t nvme_get_spdm_trans_type(PCIDevice *pci_dev)
> +{
> + if (!pci_dev) {
> + return false;
It's a uin32_t, false doesn't make sense as a return value.
> + }
> +
> + if (!strcmp(pci_dev->spdm_trans, "nvme")) {
> + return SPDM_SOCKET_TRANSPORT_TYPE_NVME;
> + }
> +
> + if (!strcmp(pci_dev->spdm_trans, "doe")) {
> + return SPDM_SOCKET_TRANSPORT_TYPE_PCI_DOE;
> + }
> +
> + return 0;
> +}
> +
> @@ -9297,6 +9332,7 @@ static const Property nvme_props[] = {
> false),
> DEFINE_PROP_UINT16("mqes", NvmeCtrl, params.mqes, 0x7ff),
> DEFINE_PROP_UINT16("spdm_port", PCIDevice, spdm_port, 0),
> + DEFINE_PROP_STRING("spdm_trans", PCIDevice, spdm_trans),
There is enum support, (look for qdev_propinfo_get_enum() usage)
but seems not that much used and there are examples of strings
used for things that are enums underneath.
> DEFINE_PROP_BOOL("ctratt.mem", NvmeCtrl, params.ctratt.mem, false),
prev parent reply other threads:[~2025-08-26 11:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-26 5:46 [PATCH 0/4] NVMe: Add SPDM over the storage transport support Wilfred Mallawa
2025-08-26 5:46 ` [PATCH 1/4] spdm-socket: add seperate send/recv functions Wilfred Mallawa
2025-08-26 9:34 ` Jonathan Cameron via
2025-08-26 5:46 ` [PATCH 2/4] spdm: add spdm storage transport virtual header Wilfred Mallawa
2025-08-26 9:38 ` Jonathan Cameron via
2025-08-26 5:46 ` [PATCH 3/4] hw/nvme: add NVMe Admin Security SPDM support Wilfred Mallawa
2025-08-26 11:13 ` Jonathan Cameron via
2025-08-26 5:46 ` [PATCH 4/4] hw/nvme: connect SPDM over NVMe Security Send/Recv Wilfred Mallawa
2025-08-26 11:21 ` Jonathan Cameron via [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250826122127.000061fc@huawei.com \
--to=qemu-devel@nongnu.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=alistair.francis@wdc.com \
--cc=fam@euphon.net \
--cc=foss@defmacro.it \
--cc=hreitz@redhat.com \
--cc=its@irrelevant.dk \
--cc=kbusch@kernel.org \
--cc=kwolf@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=stefanha@redhat.com \
--cc=wilfred.mallawa@wdc.com \
--cc=wilfred.opensource@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.