From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.174 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796138592; b=mwHzP5YBpwUVqmVkJmIWAmaJ9yhagb40wHynUrcZcS1k2yldczIHTOzUD9vWq9yJr3dN vhvcqWXKQgB1K53IpzKGvxQZhr8bv6rF0x4FQ1OEH5fT8ew1YE13phv2nTXTPZgQOiRU3 K7WlQ54En2ufIHpdmuwnRAh2TIEuexfsOcmewB0+nzrM4YTwijvP0T0MM9osTQr+PRR9+ x9DQYczl7zSN1c33io/Alb6mXaU7hvhcfNvnMDI8tzgE+QQjoCret3GoZxitLhj9/Q7DH KNjWNYnqyjlTx0/m9LsbRoYN0VWZ1Ojf2UQVH5/7yVn8ui2/UccOWM9bQTXAzpY2TkQ== 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=U+eR3ajkzeYzs8MHpJDmviV57MsVK0XXs9JVnN1aR7VdKdZIJ4myMu5bUz6lbBRe9rj1 Y9/qZCHHNNhzbY+kucaRSRusZp+pbvAGhFq8+rwiSYagle4RHdQIG3CtxEJSl1M1aLFe0 E7VlgS+HA3YDvI9oq/dHO5Zq06rEcGqigwUQaUgdv8PxzXztS54csynDWHbsq505FCdEf f8usXWVbL3AFAcedAKqNVRIzaCLzRGtkz7pksR+BLQgW7xvzHzJB4UZVhStmqPdf6CCTW MrjlQ8xArmgYlJiMoFPEsjoBAmwqOSHsyr7dQcgDySSFAQSBgnGCW775PbQY/dl8oJw== 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.174 Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) (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 3F784606A322 for ; Tue, 1 Dec 2026 15:23:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3F784606A322 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-f174.google.com with SMTP id 00721157ae682-8b4e04eda5aso88293117b3.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=EW8sJAPr1qeEiRYPNysJQO9bt3sajdIZ/VNAMcEsSq2rq4KP250uhklZuxx7/k2f50 pKTb908PhlLp4Vq8jny2/2LQ1vQrLAkzePOhR9MWKJGNo9rZP+raMExw2qwUcsqTLtgE 6NiCByMntbpyQkpmp7AvdXdeWAMaLzsnxD1136fPJM21kwSq3p4wvuo1Qmae80tnKm8v jT4+LQkiGNJpBkDwlQq6iXKxiyupfye2EIgmJQloCAgLm0PW0D3ADG2gLjBdkIHLGtRp FMF2NbUHXrHyP53OAoJlNowLLG74v3w6K7fRGi5P6G4FkzY8DqMaWCp7qbcclUDblHLW Dx3Q== X-Forwarded-Encrypted: i=1; AL+hErH1ZVNYUB3LwNnjfuuLE2bzbDqkdCM6bRQ+vEB+EhOTqv1fc+BRxD4jdhDYzRW2hZ9icwohvz7Y73GY@lists.linux.dev X-Gm-Message-State: APuU4Z/pMm/zKGSnjGCIGm4z/XQfF2JkNfnrRoYlkygmAidQD9IDK1VK RDaO3odABwWqtYRIVWYFnZb3NlVMAbw5xKuvGFNtudf982/IHJfneR7WdesRGHXGtBI= X-Gm-Gg: AZFdTZc543zmrW54FwfMJb+B/MDaB5iUcjsphfFGKrGM5+g0opFH/cIU2JnUhzJbdHl w2s5X6LX2UF4ylC6fGPZ5w68HY1Db++R+RhqTMYbwYNkiLjVgr8nSLM35d49l9R5SiFfTaTCio8 MsZqT6LHJwyCJsviODgv40pQisBIUdLOXbRkmNELqboFYQL7MfPlGsTx/oyTjAoC9vtmkIFIDM1 aNh+efBOBZ7Sk51ThiYRIu8D8qRaaDEngKXddI0P1l2LL4MK2QWgCEWGYWi0TyzeITjQQQSZbk7 yRR5V8c6c+3UTb6kUK4MFIq53Sl+t1edbAd8tazpGKOjwKJiJTfmfxCH0HKB9p6VvwGm/gKbzn5 XV6YxUrHQsHIHMO7opUrxqw87VGXHOFKt/qLz1nX6tBrdeeQh/pJ8Mn+S0RX01mYlV0Ce2Plz2M M908mTRksxjLJd0D55JQeeJ7o5ZFpXXGbvYNG7ixgS1CuGfB//vB3lGAQLrBz6ish2eZP7BIuFF +m6xXfFuSf+feNkkEHlzAucOTJh0EboRK86jGBd+e/NDoSwmHt1YPSnQ0/ZUzkaAMiK8UA2PZhC ILzc 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-coco@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