From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796138592; b=XWXYwqCUDDoI4gQewZBnzAm2MkM5xYtW+GgxNpOerEsgF/YwOOBhpxKvm01ueLzrgSQC 9PWF3YaoAaHSHvQLb9vSdauM5tUORL6wCDCeidINP/BqQP/bpKponk8hCq6s68hxJ2hi9 G12a2AYZEH0L7fwMH06ko8G4y+1GDcU+81KCqdEe/3JGE95y41aV/7vaNaKgxBA95nkyb htyuLKFOrEKXSCVbbzcRTJEO2y3MkRX8+9uRe/Vd7HiZIs1u4ixazuVXsOeTxh8wuqbjP 0WuKmb/+lV+/YAUr3rFeS/zcp6T+Zca5LEPYrufZtbDtDE5zQxgnGQqIU83ReUeg4gw== 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=yhhseo0/Ufzj6l/njv9/hOGpzQVUQ2gSqByTNquVbLWu3cqcEUuWo2NVb5ZTyaYVEky5 sKMnn8sLMno3bfF1GJ+uxODlWuXM1rL+GtIv8wyBt+PAqKPowNHTXTP2K6oNkvwemShai 84Occ5HJ2ACEFvsVR8vtKVpUhITaGoT9G+S1QHAdL++2ciEyYT+QoxdpQt2mDk0J8qjIc I9SNN8kgtFmdO+YOuD0rPmuzplnA6ZVu5uVxGhsAvF+wha4mJ18O8iyTJkuSB8otCgQ7h 6nfDOYfMv/IgcBmiXSZYR5HjMA9Bf5jzUp5OwwQGhNcqUytLSq+WYwy/+JbircXbC4A== 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.172 Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (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 42492606A327 for ; Tue, 1 Dec 2026 15:23:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 42492606A327 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-f172.google.com with SMTP id 00721157ae682-8b4e04eda5aso88293087b3.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=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=bvII+KSJj52Yz2XaOOU7I8vCaGcgLmlIpHuOHh3cuefP2jiF+wJCBsgOr5tcPw8MSF 8j1Uwq/TgGJhF7zTJoYMtau9r4yUODexMgnyKRv0n9az+Ik4R4aJ7gxfo4f82bZh7QG4 df3FisZJXZnq9GqZKHmZda4gi8pyg7E2Z7wr03v5Ew4DYTaJJ/7X50qbGeWYGYYY9cYE 5xEZ7QnJ3NXPFxIg4nn0kQ/3wI5GS4cVudjHhCLM6ZSGk6QWmZOLKxn6udJoM+uL0VmE bhtpPIt9qZwTWmdVd6rgmp8Kb5W55dfAS5ewfsW/RI0OOFRU/jNlEmJ9LTtym7DqnpkE fT5g== X-Forwarded-Encrypted: i=1; AL+hErEPXE6F9JFrAivkc7R1TNUBcSh1VMiIdRIt5IYmuScKBvt+0iIsGI5YB5Icg7O0Drlsz1U=@vger.kernel.org X-Gm-Message-State: APuU4Z8HXlhNH++rLVSgzIqVrRKz8K23mWHwiIcfOPTAtzpPm76xbtut zb13JhCSGmFpVBtLGcQiMH/AD2xQP2J/XXn6DlqDFpId5rWauQ5gcoyZTQATNJlEA0U= X-Gm-Gg: AZFdTZdPI3ZBUGSZydSAqZ0MSnMNlFxnXm0ecD7N09r8lns7INX+vE+SaX4TDFfxwyb cc2N1R0iSlGUc6QdGEJjq+vax0/2czj9rqo60VjI+Rg0EQWaEIkvpJcTKwewlD3NrRmc7o+OcfL iJIyCKr1t90tXADpovsbob1NQVAuxQ7IKUyzJAQW2ymBAxU5eyzs4oyLdX/+jj3XK1wMmVjMqe+ 8y5YuzLUwas+ttuGC7spEkHpT49Vz/JrJHX5AtQ1VuHgnlR/mZhKs/EsuABu7/tLKn9afzBd5zI +v+T4z7HtrANmEVe4muBMwTwvU5cd05Mhn/OBGz3QWFSrSwpnZeTnF8VJfZqcjorHgIuJMfJFVd t22ezw2aolTQW2ESTw7/FWiXTPqUUhJnkSAzuRkuL+OE3Nha3G2daYg6lwVqZnlR2Fz9Q1z6B91 1VSEjw4z2hCgavlThnXl33ArDQxttmF1N7nXqJnndYS5chgZnQ0m2Lbr2DbkCe6kO3nuSOqHgDF XsRXP0IwQUw4Dp/I0cgds/lCngjeqS1oYbmHk3KxQXFH3xnwzZmq/WO0f5dPTCledCXZhtSlo2m mVGK 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: kvm@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