All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>
Cc: Dave Jiang <dave.jiang@intel.com>,
	"Reshetova, Elena" <elena.reshetova@intel.com>,
	Xu Yilun <yilun.xu@linux.intel.com>,
	"linux-coco@lists.linux.dev" <linux-coco@lists.linux.dev>,
	Jiri Pirko <jiri@resnulli.us>,
	"Tian, Kevin" <kevin.tian@intel.com>,
	Alexey Kardashevskiy <aik@amd.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Suzuki K Poulose <suzuki.poulose@arm.com>,
	Steven Price <steven.price@arm.com>,
	Kiryl Shutsemau <kas@kernel.org>,
	"Edgecombe, Rick P" <rick.p.edgecombe@intel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Ashish Kalra <ashish.kalra@amd.com>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	John Allen <john.allen@amd.com>, Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	"patches@lists.linux.dev" <patches@lists.linux.dev>,
	Alistair <alistair23@gmail.com>
Subject: Re: [RFC PATCH v1 10/11] virt: coco: arm-cca-host: Publish slot zero and establish streams after acceptance
Date: Fri, 13 Nov 2026 10:52:49 -0400	[thread overview]
Message-ID: <20261113145249.GA3706007@nvidia.com> (raw)
In-Reply-To: <yq5abj7tm7q4.fsf@kernel.org>

On Fri, Nov 13, 2026 at 02:24:59PM +0530, Aneesh Kumar K.V wrote:
> Jason Gunthorpe <jgg@nvidia.com> writes:
> 
> > On Thu, Nov 12, 2026 at 03:07:43PM +0530, Aneesh Kumar K.V wrote:
> >> > Like a whole bunch of TSM FW API just to do this:
> 
>  [ ... 38 lines skipped ... ] 
> 
> >
> > Capturing the transcript makes everything 100% perfectly consistent
> > for everyone. Userspace sees *the transcript* as defined by SPDM not
> > some mangled, truncated or processed version that the TSM decides to
> > provide.
> >
> > Userspace gets to see KEY_EXCHANGE which means the verifier can prove
> > the certificate binding, this is the ONLY way to let the verifier do
> > this proof if it wants.
> >
> 
> To clarify, is this only needed if the verifier wants to perform an
> independent verification? The RMM already verifies KEY_EXCHANGE_RSP, and
> we trust the RMM.

Yeah, I'm not so sure how useful it is, but if you ever want this,
then the uABI has to be structured like this. I don't see any reason
to forbid it, people have asked for it before, and it is easier uABI
to maintain long term than the alternatives.

> > Further with capture we have a nice primitive to pause and do slot
> > selection before going to KEY_EXCHANGE. If we know the kernel has
> > capture then the ideal FW design for 1.3 multikey is much simpler and
> > clearer (more like ARM).
> >
> > Also, ARM decided to do capture already, but directed by the TSM.  I
> > think it is the right and best idea, they just made the implementation
> > too narrowly specific. eg it doesn't split up VCA, it doesn't capture
> > 100% of everything to get KEY_EXCHANGE, etc. Trivial to fix while
> > upgrading to support 1.3
> 
> So, not everyone needs DOE snooping? Architectures without a
> firmware-directed capture mechanism can use DOE snooping to collect the
> required data on the host. Would the flow for SPDM 1.2 look like the
> following?

IMHO ARM has it nearly right, and if you can do TSM directed capture
then you don't need kernel snooping. Kernel snooping has the drawback
that the kernel has to understand every message the TSM sends and
every option it negotiates. This is a troublesome coupling, so it
would be good to avoid it.

But breaking up a VCA blob has the same troublesome coupling as
snooping, so we need the TSM directed capture to work in a transcript
form, see blow.

Your diagram is basically what ARM does already, I don't see an issue
with ARM's implementation as-is for 1.2 support.

> |                                 | KEY_EXCHANGE_RSP                 |
> |                                 |<---------------------------------|
> |                                 | Verify response signature        |
> |                                 |                                  |
> | NEW: cache complete             |                                  |
> | KEY_EXCHANGE request and        |                                  |
> | KEY_EXCHANGE_RSP, with signature|                                  |

This is not the change I would suggest.

ARM has everything fine, the RmiDevCommExit tells the OS how to build
up the transcript.

The only issue is how the cache_object_id was layed out.

It should be a range of objects, one per transcript message. eg use
0x80 -> 0xff as
 0x80 - request #0
 0x81 - reply #0
 0x82 - request #1
 0x83 - reply #1
  ...

Then include every single message that is part of the signature. OS
reconstructs VCA from this. Trivial to include KEY_EXCHANGE in 1.2,
GET_DIGESTS in 1.3 and then whatever else 1.x brings down the
road. You have enough IDs to capture 64 transcript messages.

That ARM can capture encrypted messages this way is cool too, if that
becomes useful it can append to the transcript encrypted items as
well!

I imagine an ECN with a OS negotiated opt-in "Improved flow for 1.3"
that changes things like this, and below as a package.

> | NEW: request slot discovery     |                                  |
> |-------------------------------->| GET_DIGESTS / DIGESTS [secure]   |
> | Relay ciphertext                |<-------------------------------->|
> | Receive RMM-exported slot info  |                                  |
> |<--------------------------------|                                  |

Intel did this, IDK if we need to for RMM, at least not like this..

We really want the certificates to be loaded at the start before doing
key_exchange. That is when they are most useful.

So when we fix this for 1.3 the opt in should trigger a transcript'd
GET_DIGEST in plain text and certificate collection from all the slots
in plain text.

1.3 will sign GET_DIGESTS during KEY_EXCHANGE
1.2 RMM could issue CHALLENGE if the device supports it right before
    KEY_EXCHANGE and transcript it
1.2 RMM could issue GET_DIGESTS inside the session and fail if != to
    the plaintext

These approaches keep a consistent flow where we get the certificates
before doing KEY_EXCHANGE so we can set the slot.

The final 1.3 opt in change is to not use the slot passed to
RMI_PDEV_CREATE(), but instead change RMI_PDEV_SET_PUBKEY() to input
the slot, pubkey and certificate hash. Have a pause in the flow prior
to RMI_PDEV_SET_PUBKEY where userspace will read the certificates and
input the slot.

I view all of this as a new opt-in feature the OS can select to enable
all these new rules together. When the RMM supports it then we get a
more complete transcript, early slot selection, multikey, and early
visibility to all certificate chains.

In terms of change to RMM it is very minor.

> If GET_DIGESTS and GET_CERTIFICATE(selected slot) are issued after the
> secure session is established, DOE snooping cannot capture their
> plaintext responses. I am therefore still unclear how the DOE snooping
> design handles this data.

As above, the TSM needs to issue these in plaintext because we need
the information to do slot selection before doing KEY_EXCHANGE. This
is essential for 1.3 multikey..

> In the end, the host has the certificate chain for slot 0, which was
> used to establish the secure SPDM session, and the certificate chain for
> the selected slot, which was fetched over that trusted session. The RMM
> also returns the chain digests. The host can compare the leaf keys for
> slot 0 and the selected slot, 

This only works for 1.2 where all leaf keys have the same PUBKEY. In
1.3 that's not true anymore, so this logic falls apart. You need to
sign the GET_DIGESTS and present all the slot opts to userspace so it
selects a strong key as the signing key for KEY_EXCHANGE.

It is why I don't see value in fixing 1.2 like this, it only works for
1.2 and we need to fix it again for 1.3. It is better to make 1.2 look
like the 1.3 flow.

> BTW, this proposal does require RMM changes. I have also omitted SPDM
> 1.3 multi-key support from this diagram because it will be easier to
> follow once the SPDM 1.2 flow is clear.

IMHO, leave everything alone as is today. We can make it work well
enough as is.

Make a ECN for a 1.3 opt in broadly like the above that fits better
into how I sketched the kernel uAPI. Do this once we all agree to the
new uAPI. The kernel will always try to use this new mode if RMM
supports it and userspace gets a better 1.3 experiance.

There would a similar opt in change on the RHI side to transfer the
new object list.

Jason

  reply	other threads:[~2026-11-13 14:52 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-28 15:26 [RFC PATCH v1 00/11] PCI/TSM: Add CTLV attestation Aneesh Kumar K.V (Arm)
2026-10-28 15:26 ` [RFC PATCH v1 01/11] attestation: Restrict inherited operations per instance Aneesh Kumar K.V (Arm)
2026-10-30 13:29   ` Jiri Pirko
2026-10-28 15:26 ` [RFC PATCH v1 02/11] attestation: Filter evidence objects " Aneesh Kumar K.V (Arm)
2026-10-30 13:44   ` Jiri Pirko
2026-10-31  6:24     ` Aneesh Kumar K.V
2026-11-02 19:14       ` Jiri Pirko
2026-10-28 15:26 ` [RFC PATCH v1 03/11] attestation: Enter secure operation when evidence is accepted Aneesh Kumar K.V (Arm)
2026-10-30 13:51   ` Jiri Pirko
2026-10-30 15:36     ` Jason Gunthorpe
2026-10-31  4:09     ` Aneesh Kumar K.V
2026-11-02 11:28       ` Jiri Pirko
2026-10-28 15:26 ` [RFC PATCH v1 04/11] attestation: Bind object selection to accepted evidence snapshots Aneesh Kumar K.V (Arm)
2026-10-28 15:26 ` [RFC PATCH v1 05/11] attestation: Make the evidence-get challenge attribute optional Aneesh Kumar K.V (Arm)
2026-10-28 15:26 ` [RFC PATCH v1 06/11] PCI/TSM: Describe the PCI attestation control family Aneesh Kumar K.V (Arm)
2026-10-30 14:01   ` Jiri Pirko
2026-10-30 15:43     ` Jason Gunthorpe
2026-11-02 12:45       ` Jiri Pirko
2026-11-03 15:45         ` Jason Gunthorpe
2026-11-04  9:21           ` Jiri Pirko
2026-11-04 14:00             ` Jason Gunthorpe
2026-10-31  4:05     ` Aneesh Kumar K.V
2026-11-02 11:50       ` Jiri Pirko
2026-11-03 15:35       ` Jason Gunthorpe
2026-10-31  4:22     ` Aneesh Kumar K.V
2026-11-02 11:30       ` Jiri Pirko
2026-11-03 15:39       ` Jason Gunthorpe
2026-10-28 15:26 ` [RFC PATCH v1 07/11] attestation: Add attestation helpers for PCI/TSM integration Aneesh Kumar K.V (Arm)
2026-10-28 15:26 ` [RFC PATCH v1 08/11] PCI/TSM: Bind CTLV attestation to connected and locked contexts Aneesh Kumar K.V (Arm)
2026-10-28 22:56   ` Dave Jiang
2026-10-29  5:30     ` Aneesh Kumar K.V
2026-10-29 12:41       ` Jason Gunthorpe
2026-10-30 14:04   ` Jiri Pirko
2026-10-30 14:08   ` Jiri Pirko
2026-10-30 15:39     ` Jason Gunthorpe
2026-11-02 12:11       ` Jiri Pirko
2026-11-03 15:41         ` Jason Gunthorpe
2026-10-28 15:26 ` [RFC PATCH v1 09/11] crypto/ccp: Defer SEV-TIO link setup until evidence acceptance Aneesh Kumar K.V (Arm)
2026-11-06  7:47   ` Alexey Kardashevskiy
2026-11-06 13:14     ` Aneesh Kumar K.V
2026-11-06 14:21       ` Jason Gunthorpe
2026-11-09 10:03       ` Alexey Kardashevskiy
2026-11-12  6:23         ` Aneesh Kumar K.V
2026-10-28 15:26 ` [RFC PATCH v1 10/11] virt: coco: arm-cca-host: Publish slot zero and establish streams after acceptance Aneesh Kumar K.V (Arm)
2026-10-29 16:56   ` Dave Jiang
2026-10-29 17:10     ` Jason Gunthorpe
2026-10-30  9:58       ` Reshetova, Elena
2026-10-30 13:15         ` Jason Gunthorpe
2026-10-31  3:47           ` Aneesh Kumar K.V
2026-11-02 10:11             ` Reshetova, Elena
2026-11-02 17:26               ` Jason Gunthorpe
2026-11-03 12:01                 ` Reshetova, Elena
2026-11-03 15:16                   ` Jason Gunthorpe
2026-11-04  8:03                     ` Xu Yilun
2026-11-04  9:49                       ` Reshetova, Elena
2026-11-04 13:41                         ` Jason Gunthorpe
2026-11-04 16:54                           ` Dave Jiang
2026-11-06 15:53                             ` Dave Jiang
2026-11-06 19:30                               ` Jason Gunthorpe
2026-11-06 22:39                                 ` Dave Jiang
2026-11-08 18:33                                   ` Jason Gunthorpe
2026-11-09 10:55                                     ` Reshetova, Elena
2026-11-09 13:47                                       ` Jason Gunthorpe
2026-11-09 17:37                                     ` Dave Jiang
2026-11-09 18:53                                       ` Jason Gunthorpe
2026-11-09 20:54                                         ` Dave Jiang
2026-11-09 23:40                                           ` Jason Gunthorpe
2026-11-10 13:15                                             ` Reshetova, Elena
2026-11-10 14:20                                               ` Jason Gunthorpe
2026-11-11 13:09                                                 ` Reshetova, Elena
2026-11-11 14:13                                                   ` Jason Gunthorpe
2026-11-12  1:48                                                     ` Alexey Kardashevskiy
2026-11-12 12:31                                                       ` Jason Gunthorpe
2026-11-10  1:40                                         ` Alistair
2026-11-10 15:07                                           ` Jason Gunthorpe
2026-11-10  5:32                                         ` Alexey Kardashevskiy
2026-11-10 12:52                                           ` Jason Gunthorpe
2026-11-11  9:03                                             ` Alexey Kardashevskiy
2026-11-12  9:37                                 ` Aneesh Kumar K.V
2026-11-12 14:52                                   ` Jason Gunthorpe
2026-11-12 15:47                                     ` Dave Jiang
2026-11-12 16:37                                       ` Jason Gunthorpe
2026-11-13  8:54                                     ` Aneesh Kumar K.V
2026-11-13 14:52                                       ` Jason Gunthorpe [this message]
2026-11-10 20:07                               ` Jason Gunthorpe
2026-11-04  9:03                     ` Reshetova, Elena
2026-11-04 13:48                       ` Jason Gunthorpe
2026-11-06  8:24                     ` Aneesh Kumar K.V
2026-11-06 12:49                       ` Reshetova, Elena
2026-11-06 15:53                         ` Aneesh Kumar K.V
2026-11-06 18:54                           ` Jason Gunthorpe
2026-11-03 16:31                 ` Aneesh Kumar K.V
2026-11-03 17:56                   ` Jason Gunthorpe
2026-11-02 10:05           ` Reshetova, Elena
2026-11-02 10:22           ` Reshetova, Elena
2026-11-02 17:37             ` Jason Gunthorpe
2026-10-28 15:26 ` [RFC PATCH v1 11/11] virt: coco: arm-cca-guest: Refresh selected evidence against trusted digests Aneesh Kumar K.V (Arm)
2026-10-30 12:34 ` [RFC PATCH v1 00/11] PCI/TSM: Add CTLV attestation Xu Yilun
2026-10-30 15:32   ` Jason Gunthorpe

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=20261113145249.GA3706007@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=aik@amd.com \
    --cc=alistair23@gmail.com \
    --cc=aneesh.kumar@kernel.org \
    --cc=ashish.kalra@amd.com \
    --cc=bhelgaas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dave.jiang@intel.com \
    --cc=elena.reshetova@intel.com \
    --cc=jic23@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=john.allen@amd.com \
    --cc=kas@kernel.org \
    --cc=kevin.tian@intel.com \
    --cc=linux-coco@lists.linux.dev \
    --cc=mark.rutland@arm.com \
    --cc=patches@lists.linux.dev \
    --cc=rick.p.edgecombe@intel.com \
    --cc=steven.price@arm.com \
    --cc=suzuki.poulose@arm.com \
    --cc=thomas.lendacky@amd.com \
    --cc=will@kernel.org \
    --cc=yilun.xu@linux.intel.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.