From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [176.9.242.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F442DDC2 for ; Tue, 3 Oct 2023 19:41:14 +0000 (UTC) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 820FB100D9414; Tue, 3 Oct 2023 21:30:58 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 2DF8042A4F9; Tue, 3 Oct 2023 21:30:58 +0200 (CEST) Date: Tue, 3 Oct 2023 21:30:58 +0200 From: Lukas Wunner To: Jonathan Cameron Cc: Bjorn Helgaas , David Howells , David Woodhouse , Herbert Xu , "David S. Miller" , Alex Williamson , linux-pci@vger.kernel.org, linux-cxl@vger.kernel.org, linux-coco@lists.linux.dev, keyrings@vger.kernel.org, linux-crypto@vger.kernel.org, kvm@vger.kernel.org, linuxarm@huawei.com, David Box , Dan Williams , Dave Jiang , "Li, Ming" , Zhi Wang , Alistair Francis , Wilfred Mallawa , Alexey Kardashevskiy , Tom Lendacky , Sean Christopherson , Alexander Graf Subject: Re: [PATCH 12/12] PCI/CMA: Grant guests exclusive control of authentication Message-ID: <20231003193058.GA16417@wunner.de> References: <467bff0c4bab93067b1e353e5b8a92f1de353a3f.1695921657.git.lukas@wunner.de> <20231003164048.0000148c@Huawei.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231003164048.0000148c@Huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) On Tue, Oct 03, 2023 at 04:40:48PM +0100, Jonathan Cameron wrote: > On Thu, 28 Sep 2023 19:32:42 +0200 Lukas Wunner wrote: > > At any given time, only a single entity in a physical system may have > > an SPDM connection to a device. That's because the GET_VERSION request > > (which begins an authentication sequence) resets "the connection and all > > context associated with that connection" (SPDM 1.3.0 margin no 158). > > > > Thus, when a device is passed through to a guest and the guest has > > authenticated it, a subsequent authentication by the host would reset > > the device's CMA-SPDM session behind the guest's back. > > > > Prevent by letting the guest claim exclusive CMA ownership of the device > > during passthrough. Refuse CMA reauthentication on the host as long. > > After passthrough has concluded, reauthenticate the device on the host. > > Is there anything stopping a PF presenting multiple CMA capable DOE > instances? I'd expect them to have their own contexts if they do.. The spec does not seem to *explicitly* forbid a PF having multiple CMA-capable DOE instances, but PCIe r6.1 sec 6.31.3 says: "The instance of DOE used for CMA-SPDM must support ..." Note the singular ("The instance"). It seems to suggest that the spec authors assumed there's only a single DOE instance for CMA-SPDM. Could you (as an English native speaker) comment on the clarity of the two sentences "Prevent ... as long." above, as Ilpo objected to them? The antecedent of "Prevent" is the undesirable behaviour in the preceding sentence (host resets guest's SPDM connection). The antecedent of "as long" is "during passthrough" in the preceding sentence. Is that clear and understandable for an English native speaker or should I rephrase? Thanks, Lukas