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=PL3b3KDVQxzzO+4DKkIvpvNsqyo/nWAHt5po8xMu7kkTf6eQWntwDPwNock8+tQLONEH maUFQWAKEHzFzkBZ0j1ls08fg3h/ynzcc0NK90FkIKJsFsUoUpyADTkSRo133j3+kmu0Z hJ7rOBwX2AtCGdcPrmGvlYtjARIqAsU3G3g6rbBeajXPDXa40JNtI2Jw6cEyGHnZ7W50C XcntJ1XXOxPzT/Z0ktNfqnVm4avKbaZ09hkNaFZpSK+StjKvZTbvbrOkMz3AHk/eDLw0X EdYjTZqg7XgC+zAbtqKtDpzxA1FaDyJy7xfrB8YBgRHh6xZ/vUeUZR5Av8rs5tYq+4A== 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=Dl3Jp2V1RQOM0twOsR0yJcNxNjuWHAs6P6Vg9akfAvkrsYTEioy0AyzL6cN31ZmGXhHj NH2TXKc8A37Eyo6ugaDaiEUoZ6LgWiL0M3gRCRtPOIdYI4AISMRd/JTDCcPJmbIrFIynE MTpwTJ8drUL1Ig3CV7WUYHXzpY6kcrJG3fBmpi/oAQA1Z33DP7j6Zh5rnHsNeZrt620JX lbjXe5w875MEifOuC36+KDUnLN0A+fNoJseX8MeICaIl1ENf+FwNe5si0h/G5tQ7eEwS+ c1DPCX8Pe4KDA3cqSrQciAJUP/b4cTpMDoTOf5H+/PyTszzjsIOnlq2ecBWX7s2/bBg== 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=ARGUu3jA; 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 45354606A32A for ; Tue, 1 Dec 2026 15:23:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 45354606A32A 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=ARGUu3jA Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-8b5c0d8a835so27506717b3.2 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=vger.kernel.org; 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=ARGUu3jADT+qfI1VXEXovJf0MbohAjTgqecn38n/fm3+hROoiPOH4ODK3U8S2uN0HO rr0fhW8Se/TRwY9x82Z+z3m4BCATUwLg/7PZrvfaQtH7c5zix9KFo4aiVK59wOhuHBLZ XhJ+/em38TTLt2IynVG63GUBB5tn0TCaorqyj9ngHH0RsN0pfR/zdvsBlPUbAllKgwvh bByTjsPgF9JAIOO0Ny4sFYIGv5vVlkJZKWjJomsuCdYT5+eJZx/QnIm4brsLPkqJj6lR /sGh4OZwMZvEHOV0IzwdWy0er7WADui0ugZx+onsFhvAZawLM/50UkDF05ff/bKxLP5Q qtLw== 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=AXnA3GD4C9uNMMPJoc8n1F3JahbifVAnaXJcee17YlnmItzCDMfu4udwj4uMJ7RuJo 1/oZRIeLUwhdn6Q+Ms56C8nG3MHXwyhPcjTdJ1xoYaRuKD9TpGE34ocb8uVjiQaC/wV+ ter9BeioCL7rum89o1Am1jlP+EQhnb6WV2/vLtKly7m0CShgmeLXPq/AVMl+16L62/aC U0lnc5tXPZ+1mIBMmgXosiOZ5xi++yp50vVJzs275goVx0o2qq/i9UUPgg1WQIiHyy7u 9KRnvSTUTSJI27uVipWPYKpqSdjiiaCjxXNpCh+OmRvvTkntZmoFZ2JrjnDtz12e/Wkt zoAg== X-Forwarded-Encrypted: i=1; AL+hErGIsd3/9ULRxTEbvcm9uAkesSxBZ0UWQHN18s0NEcFJib5mpgywtruJ5TcRAD0w4QZVnxK68DqR4r8=@vger.kernel.org X-Gm-Message-State: APuU4Z8rIwYzinB16YIFJaLwV2BeCoFgfOnD1dp3qwCItgQK9EZZJInt HdeKz708CfCJTefudIyOZJ+SETFUV1KSRwLWrOcLrU8y6eQroVLekKvI/3l8ce/7Pic= X-Gm-Gg: AZFdTZfw0G6jJgIPQOYIijdokxdHaE9MI42zZYZfhYfSyNXzdbHpf0ET0qUJdH1smAt 99QwIkVtNmSPWKlQAXM+oKfvUTHfSWIMQz8b71aVsbbOuASk8jk7ujizdM6a1qKchfpkhUz01kT nil8BTgar3hRS1J5iwxSxg5UHcN6vlxfT4dyVj9np+ROnICE1tu5L+ncZIxzvZyTTSy+Q9+a3oH BKSJKKbokrv7QnUq+A3Y2hLQHJjwYMYp5JVjJUhExugR5Z+v7/8HvmaLVelPfjHPcyqlixfDjv1 N39Q9hSlnPVxD4iM1ehGByiFMRGcTlctuzhVRLBh1e5PqM3uXXg8IuRseHChoZwkwEWXX6wpjoF aFTk8o+6ly69Dwh/9hme2ATLzIbmHXmdDkRbtSPjjFHr9s54LWAWfbL7fVynoT1iX2qnosANri0 yYB7QNHR/qm8oZxWwfqLZMn/D2rFX/UPDuB9LAfL40ddkqv1i8b5XB311UWpuAeMb8ouZOWzHtu MM4tpybjmhAiKQc5jRvYQGOTIpo6IZYaeIzxbzuawhDhi++Uz4Qv2wxV444lny22mpGUJZizuN6 zWr+ 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: linux-pci@vger.kernel.org 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