Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp391408rdg; Thu, 12 Oct 2023 08:32:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3bMMHt/eyzXNddN8pRI4HstkMp6FKt3/zU3GDNuCPF15T8fEFhiQo5FAuYILAjPweN6T9 X-Received: by 2002:a17:902:ce8d:b0:1b9:e913:b585 with SMTP id f13-20020a170902ce8d00b001b9e913b585mr20306250plg.13.1697124757993; Thu, 12 Oct 2023 08:32:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697124757; cv=none; d=google.com; s=arc-20160816; b=KkhkffC5xDc2cNinEa/ZEzJ7Kq8bQBmNSmZU29sk4iXi/M19OK6jVkWnhM/Dxy7IFd VwPai+D0TvlLOW/7bMpUQleAnzmdb2azh5SCrA8J/ZqIuyVZ3Z5o5VY1kAD48qaJnojx yGgrK0Dka44QZ09AG2sY9g0OCty0cE/D1SiFoGNr+wrOS2bDdriOqmGNoEDeyFo0fRSg HnUZwPhTu8G+7QNQEmY8Dy1NY52Dw3dkv8cNm/Yh8+LWl/kGJfqK/W+km4sNwO+DmeVI uMWPe+JnUk5O0ssX+9apKvXuBOr70fhLMamteZ18itGyNMg+kTMO4pApLOx4Oz/Baoyy c5sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=2dmuNv2Sf4hy9fXf1kIlPAJ7TY+kiKCQDybJO4NZPJg=; fh=NcyBZ+JcfeWXFwl0vZdYMMzIqUBaWdjzSWLVimxF3+s=; b=C5OhE1MWK9zT0hZhSzjEwrz3HRIkeKtp32uNVAAA+xymqf8wMMHYQkLUcqoeQMg0Iy SroRXRdnMAEfel3Sv5ssiZ26eXJHbd1aZE+4mWsiDXA20egaBQgEmmGd3UC8elksdpj0 bqhma4ar7FYTYtIOQuvI/X89wcPIcynTVrUYxCncdTnQszkAPZ0Wg2YFbw2YjDxKwTWM YrhpKRn49IqsOlpSyFI3dk5DFqYpEoh4OrfoeNsWx1uzEB/MwdTXSHbHfyZtbRhBXHyc IxDYbi+pMZXH+v2ewWZ28Um9QDPQ5oNEH5nYbG03VYFfKkZRdyjwbRcZxjgdIGjKAcXM gpyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id bj3-20020a170902850300b001bbabd5b14esi2305661plb.608.2023.10.12.08.32.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 08:32:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3A62F822909F; Thu, 12 Oct 2023 08:32:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347295AbjJLPc3 (ORCPT + 99 others); Thu, 12 Oct 2023 11:32:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347298AbjJLPc2 (ORCPT ); Thu, 12 Oct 2023 11:32:28 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7769ED3; Thu, 12 Oct 2023 08:32:25 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4S5tqt2GDkz6K5yD; Thu, 12 Oct 2023 23:30:18 +0800 (CST) Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 12 Oct 2023 16:32:22 +0100 Date: Thu, 12 Oct 2023 16:32:21 +0100 From: Jonathan Cameron To: Samuel Ortiz CC: Lukas Wunner , Alexey Kardashevskiy , "Dan Williams" , Bjorn Helgaas , David Howells , David Woodhouse , Herbert Xu , "David S. Miller" , Alex Williamson , , , , , , , , David Box , Dave Jiang , "Li, Ming" , Zhi Wang , "Alistair Francis" , Wilfred Mallawa , Tom Lendacky , "Sean Christopherson" , Alexander Graf Subject: Re: [PATCH 00/12] PCI device authentication Message-ID: <20231012163221.000064af@Huawei.com> In-Reply-To: References: <652030759e42d_ae7e72946@dwillia2-xfh.jf.intel.com.notmuch> <20231007100433.GA7596@wunner.de> <20231009123335.00006d3d@Huawei.com> <20231009134950.GA7097@wunner.de> <20231012091542.GA22596@wunner.de> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml500004.china.huawei.com (7.191.163.9) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 12 Oct 2023 08:32:35 -0700 (PDT) On Thu, 12 Oct 2023 15:13:31 +0200 Samuel Ortiz wrote: > On Thu, Oct 12, 2023 at 11:15:42AM +0200, Lukas Wunner wrote: > > On Tue, Oct 10, 2023 at 03:07:41PM +1100, Alexey Kardashevskiy wrote: > > > But the way SPDM is done now is that if the user (as myself) wants to let > > > the firmware run SPDM - the only choice is disabling CONFIG_CMA completely > > > as CMA is not a (un)loadable module or built-in (with some "blacklist" > > > parameters), and does not provide a sysfs knob to control its tentacles. > > > Kinda harsh. > > > > On AMD SEV-TIO, does the PSP perform SPDM exchanges with a device > > *before* it is passed through to a guest? If so, why does it do that? > > SPDM exchanges would be done with the DSM, i.e. through the PF, which is > typically *not* passed through to guests. VFs are. > > The RISC-V CoVE-IO [1] spec follows similar flows as SEV-TIO (and to > some extend TDX-Connect) and expects the host to explicitly request the > TSM to establish an SPDM connection with the DSM (PF) before passing one > VF through a TSM managed guest. VFs would be vfio bound, not the PF, so > I think patch #12 does not solve our problem here. > > > Dan and I discussed this off-list and Dan is arguing for lazy attestation, > > i.e. the TSM should only have the need to perform SPDM exchanges with > > the device when it is passed through. > > > > So the host enumerates the DOE protocols and authenticates the device. > > When the device is passed through, patch 12/12 ensures that the host > > keeps its hands off of the device, thus affording the TSM exclusive > > SPDM control. > > Just to re-iterate: The TSM does not talk SPDM with the passed > through device(s), but with the corresponding PF. If the host kernel > owns the SPDM connection when the TSM initiates the SPDM connection with > the DSM (For IDE key setup), the connection establishment will fail. > Both CoVE-IO and SEV-TIO (Alexey, please correct me if I'm wrong) > expect the host to explicitly ask the TSM to establish that SPDM > connection. That request should somehow come from KVM, which then would > have to destroy the existing CMA/SPDM connection in order to give the > TSM a chance to successfully establish the SPDM link. Agreed - I don't see a problem with throwing away the initial connection. In these cases you are passing that role on to another entity - the job of this patch set is done. I'm not clear yet if we need an explicit lock out similar to the VFIO one for PF pass through or if everything will happen in a 'safe' order anyway. I suspect a lockout on the ability to re attest is necessary if the PF driver is loaded. Perhaps just dropping the +#if IS_ENABLED(CONFIG_VFIO_PCI_CORE) and letting other PF drivers or another bit of core kernel code (I'm not sure where the proxy resides for the models being discussed) claim ownership is enough? Jonathan > > Cheers, > Samuel. > > [1] https://github.com/riscv-non-isa/riscv-ap-tee-io/blob/main/specification/07-theory_operations.adoc > > >