From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.171 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796138592; b=kterIXRIgtaQQIDLjG7lf2FNWmvBiInJf5VXD4kfjR9zAOpxs+XrqK5hdi683eaib/1E jXdwhl6Nx/Wy3VlKuDnpZ8xMi+3ZkrSr+4Chxk/O3DeQaCLAz2bHeA9Cf67joeJgESJRv Fwm8zx2rIkfJg20YpFNmlXdy4inYeabIky8bBdFqKHLPN4Fc7M4BJdQccuJuQDO5TRg9q lOELAaZzth8mh0zkIaezJiS7mqCP56B872yYsBsLBPKCOEFHBsKFYPs3EE8wLZkfqYSY5 vBrI76XL2xIqsITY6z4w/RjoB6559N1yQq14Hjl3LhOoh2XQGrHv/fDldAGxFPoK4Cw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796138592; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; bh=TuZScCmTYrjL+BgsXFZTPgvynXQjpYdPL1jZahepOok=; b=pfYcxEhPPW25iI4KfKdrg4Q16aHPLYnGKvgayFpOEX1FaoBB+tcVuVd8CQ5DldQM1UzD myjX+P2QduKu2jz4rJ/INVu3zufVXIJkV1eCiEroWTeLZSt6VuTkhPWqo/blQjH5O+TzW CWZUuWy3BTKXC3IgNgUBP4Fzgk+hLL7nIqcHR83fRKyUavuIWR9zMoCmqPLi/EykQdIN6 p0SrVkb9/OEmEMgIxv4Oc2XUHu2fxrosROaWJPCXciQXmDD1LXRJOVXV9jXtBW90seCg+ YTgQT8k8oU9QhCm2MNZIofqY4BdCWSQtBPe2vZHuO+lS6rp3e154jsSYN6n/Zhi03yQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=bVA0b2aN; arc=none smtp.remote-ip=209.85.128.171 Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4529B606A329 for ; Tue, 1 Dec 2026 15:23:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 4529B606A329 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=bVA0b2aN Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-8b4e04eda5aso88293067b3.1 for ; Tue, 01 Dec 2026 07:23:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1796138591; x=1796743391; darn=lists.linux.dev; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=TuZScCmTYrjL+BgsXFZTPgvynXQjpYdPL1jZahepOok=; b=bVA0b2aNqABCbLzfTiBgQC4/OpKeAlDF8UD7n4qQ/uJiT/v+sgAjpCQpwYnXeLrRkU XEv4RZJ8IZ5HcmndZGdz/nxN0HNjoUrXzg8k3arylG7G6KXYCHG/sKtFqTlqgpdnZdQJ GHXg4ouFpagLNY/Ya0GbmRSwH9G0ZFqE/tRzNYVdL75QhSETYRuZ+zhZrNysREf+33pa cr+5PttzMNH5CpsLyOAx9nVy/EEfcO2ZKjPNwr0kz/Hfq78ZbUTRRmX3exUZJ18V5s9N 0+TZ5HOdAAqjjZslNX5Ymbewuw4FyUhYR6WFrDch/wxxViyASJMpEHhloSOyKBK+v96d P5bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796138591; x=1796743391; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=TuZScCmTYrjL+BgsXFZTPgvynXQjpYdPL1jZahepOok=; b=HXIzVC1lMG/9vu0JpHY9WRBbzxoRv7zJKqnQZO9v14k7WrWv4JcyKzRjiEGFDeGurg bMJjMndhK0tRMEypogocVy+pGOSEWks6Dex5xebprFyK+3Dg3tFYSuPwNoM9/qUarKrs O4/xth5ce4rTn3oJSKJM2/ZMCb3byttgapv1yU2AaSPXDM345jyov3z/2kxw5rgtpvGf 0EgBIosxayKWfRRStHsaNZ8PwWnGJ1Y2VmPWq8c3nP1UER0afAYS+zS04rEnOM4C5Yzs ycML/gwYnWLVzKxw0/UzXtXZf79/0fH53//HeQ+t1DPXwMLNojc+f235vf8K0x9PqzVk 2KFg== X-Forwarded-Encrypted: i=1; AL+hErHWM74p7QwVf+LKA8yTPBiFG2m7o9So6HwW3stuSGnvOW/1T6b8kVB8QaadeRHZo/d7MftTRZ03Xh6KKQ==@lists.linux.dev X-Gm-Message-State: APuU4Z8b8GE/d7T6X91zOj75pI3nwCCkFBV1CQVTYQtOM/i1PKPuNtFN TkIvVCJ1DdGozFVm6h67bRurkrxXVVZ68NT/xTice8ylWlQP2sCt/Tft6vNVl82Vr/o= X-Gm-Gg: AZFdTZcHgMemklibyMuI845/jGAZnwXwm6L8BCMbNjvOV5HljSc4E6PYpHliTjPIFfM aDrqMWYpcmiBzZiyDy4USGxnk1JY3qGsp49XC50SDvlju/LKgvK7MXsiHEq0VcJfoKJ/JC7L/dH NemuToODtcbOwydUFRO+yEYt1Y2k36IfOfRAnkawVXkEs6PVoV6/d+Vf9tWw+30MkbQfM6Sx2cH Z/MyPfuIsyWZXU/meSV6Y/Pok5R+iBVsMr12Tpa+mWnB0yMCsY/6s9AaYr514gc4FSoE6FusceV xZnovLbhFG3pbOZyZD6IUnAAteWgHpdl2vBlOUrl39o1zbOzs1m4RhnUm7bKlCCxJNl+TRy2VSh 9yFTYUTKIPgCXmUIVW336YDcfnZ5jXydPevt2kNVZp1HeLcPRD034RLrDlZQ7WNnOiQCXbc4naF 3JWnfOGWW4e1q3q5HKivW8geQ0FqZUDhV5jro9HUkME/vQ+HPtvtVIaL7Y8mkgnxr6Kxg2bHd7r APJ9aycp54XwPRjup/vbxjPvsVZdmRkwGiIoeG/A0NeUtWaBXmAQY4UYJ1oVZvLW0rcnIBN2xgo E2b2 X-Received: by 2002:a05:690c:6806:b0:8b0:e479:6872 with SMTP id 00721157ae682-8b52043a564mr174176157b3.17.1796138590977; Tue, 01 Dec 2026 07:23:10 -0800 (PST) Received: from ziepe.ca ([142.177.118.84]) by smtp.gmail.com with ESMTPSA id af79cd13be357-94a09477acfsm1614788485a.32.2026.12.01.07.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 07:23:10 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1xYPhF-000000012V0-2Tbm; Tue, 01 Dec 2026 11:23:09 -0400 Date: Tue, 1 Dec 2026 11:23:09 -0400 From: Jason Gunthorpe To: "Aneesh Kumar K.V" Cc: Jiri Pirko , linux-coco@lists.linux.dev, Dan Williams , Leon Romanovsky , Bjorn Helgaas , Jonathan Cameron , Xu Yilun , Alexey Kardashevskiy , Greg Kroah-Hartman , "Rafael J . Wysocki" , Steven Price , Suzuki K Poulose , Lukas Wunner , Ashish Kalra , Tom Lendacky , Herbert Xu , driver-core@lists.linux.dev, linux-pci@vger.kernel.org, kvm@vger.kernel.org, patches@lists.linux.dev Subject: Re: [PATCH v1 08/10] PCI/TSM: Add sysfs lock and unlock for guest-assigned devices Message-ID: <20261201152309.GH1856591@ziepe.ca> References: <20261123083337.2731019-1-aneesh.kumar@kernel.org> <20261123083337.2731019-9-aneesh.kumar@kernel.org> <20261123152738.GF179082@ziepe.ca> <20261125143021.GE246011@ziepe.ca> X-Mailing-List: driver-core@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Nov 30, 2026 at 12:03:11PM +0530, Aneesh Kumar K.V wrote: > > +Jiri > > Aneesh Kumar K.V writes: > > > Jason Gunthorpe writes: > > > >> On Wed, Nov 25, 2026 at 02:33:26PM +0530, Aneesh Kumar K.V wrote: > >>> Jason Gunthorpe writes: > >>> > > > > [ ... 96 lines skipped ... ] > > > >>> https://git.gitlab.arm.com/linux-arm/linux-cca/-/blob/cca/topics/7.4/cca-da-integration-v2/Documentation/userspace-api/attestation-spdm.rst?ref_type=heads > >> > >> I don't think the scheme will be 'spdm-get' using a bunch of 'cached' > >> object IDs. It should be much more specific. > >> > >> The transcript should be its own top level API, with its own sequence > >> numbered list of discrete blobs. > >> > > > > Could you clarify what you mean by a sequence-numbered list of discrete > > blobs? > > > > The transcript format could accommodate additional SPDM requests and > > responses as firmware starts exporting them. Each transcript-get would > > return all messages captured so far, in capture order. Jiri's was going to add some kind of label to evidence_get, sort of like register_index for MRs: # One per object evidence-get can produce. objects[16]: # The device's handle for the object in requests. id: uint(..15) # What the object is. class: evidence-class # The layouts a standard defines that the object may have. At # least one of formats and vendor-formats is present. formats[4]?: evidence-format # class specific information evidence_index: uint(..u32-max) Then he suggested we'd have: id = N class = spdm-transcript evidence_index = sequence # // even is request, odd is reply With CTLV itself providing the framing, via distinct object id's so that userspace can recover the message boundaries. > > For current RMM firmware, the available VCA messages are: > > > > M0 = GET_VERSION > > M1 = VERSION > > M2 = GET_CAPABILITIES > > M3 = CAPABILITIES > > M4 = NEGOTIATE_ALGORITHMS > > M5 = ALGORITHMS > > > > Each Mn contains the original SPDM header and message payload. RMM > > provides these through successive communication calls, identifying the > > offset and length of each request or response buffer. > > We would need additional metadata, such as the length of each message, > > whether it is a request or response, and, for future extensions, whether > > it was transmitted within a secure session. Linux could add this > > metadata as a header: > > > > RMM cache notifications: > > [M0], [M1], [M2], [M3], [M4], [M5] > > > > Host transcript-get output: > > [H0][M0][H1][M1][H2][M2]...[H5][M5] I think we are fine to just have CTLV handle the framing. Kernel stores the naked Mx with internal information about its size and feeds it out as evidence blobs. It is simple and extends nicely when we get to FW with a more complete capture system. For now everyone has some way to get VCA. It is mandatory to generate the signature. We just need a generic helper to break up the VCA into the six messages. RMM can build its VCA "cache" object, pass it to the helper, then throw it out. Future specs with direct capture can just record each message directly into some core helpers that are managing the transcript storage. > > Since this representation preserves capture order and message > > boundaries, I am wondering why we would need sequence-number in > > transcript-get ? Or do you want explicit sequence numbers so that > > userspace can request individual records or only messages appended since > > an earlier read? Or by sequence number do you mean the SPDM session ID > > to be included? I was planning to use CTLV for the framing and the only way to create an ordered list of 6 evidence blobs in CTLV is to have a sequence number. Userspace can request them by (id, sequence) > > For the guest, we would preserve the existing raw VCA representation > > over RHI. The VMM would remove the Linux headers before returning it: VMM uses the CTLV to get the transcript and fishes out the VCA objects it requires then concatenates them. Guest uses the same helper to go from VCA to transcript. Future RHI actually transfers the abstract transcript with some kind of RHI defined framing. I suggested using more cached object ids for this. > > There is also a question about subsequent evidence collection. Should > > transcript-get include the GET_MEASUREMENTS exchanges initiated by > > evidence-get? No. It is only the handshake transcript. > > Finally, what should evidence-get return on the host? Current CCA host > > firmware provides the certificate chain and VCA during authentication, > > but offers no additional fresh evidence collection. Jiri wants to extend the evidence API to be more generic with things like the evidence_index and a better way to list the evidence, which would run everything through evidence get In that model SPDM should have evidence-get objects like: spdm-transcript index = handshake sequence. One object per mesage spdm-certificates index = slot. One object per slot spdm-measurement slot as an input. One object spdm-tdisp-interface-report One Object In the kernel we would probably have some kind of 'evidence depot' helper to hold the immutable evidence for the API.. So disregard my prior remarks on transcript/evidence/etc-get > > My patches implemented evidence-get as returning a bundle containing all > > available verification inputs, including the certificate chain and > > transcript, together with freshly collected evidence where > > supported. A giant bundle doesn't seem that great, we have CTLV it should provide the framing to break it down. > > The patch set returned the device generation and a receipt with the > > bundle: > > > > # evidence-get, 1 fragment, generation 0 > > evidence-get details > > evidence-details.device-generation 2 > > evidence-details.receipt hex:27be43bc8c299eca3205e59c3f36ffdc54e2b3e5563320daaabe423ab11bbf09 > > evidence-get results > > evidence-get results.vendor-format spdm-bundle > > evidence-get results.length 872 > > > > Userspace supplied both values to evidence-accept. The generation > > identified the attempt (spdm-start of the session), while the receipt > > identified the delivered evidence set. A later evidence-get would > > invalidate the previous receipt. This allows the kernel to check which > > delivered evidence set userspace is accepting. I don't think we need receipt, what is this useful for? Who cares if someone else did a second evidence get before we did accept? What we care about is someone else didn't go and change the device after we measured it. That's a PCI issue not anything we can solve here. I also don't think we need 'device-generation' the session cookie should be returned by start and passed to accept, that is enough. > > Could we retain that flow on the host even when nothing can be > > refreshed? What does this mean? Collecting signed/mutable evidence is *always* fresh. Other evidence is immutable and captured once during connection startup There is no storage of mutable evidence in the kernel, it flows through to userspace and kernel discards it. This is also why things should be broken down to be fine grained so we have a clear distinction of when a new collection is happening vs just querying immutable data on an object by object basis. Jason