Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp300553rdg; Thu, 12 Oct 2023 06:13:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHXnJDl3a22nnt8N6D5YkBqRoeGLH0HJ2SNxZa8eHfPEt/3g4j5d4unbs6qSo5RLMhOlCSm X-Received: by 2002:a05:6a00:230c:b0:68a:6305:a4cc with SMTP id h12-20020a056a00230c00b0068a6305a4ccmr28441993pfh.5.1697116421891; Thu, 12 Oct 2023 06:13:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697116421; cv=none; d=google.com; s=arc-20160816; b=GN+g7L/3BGPe5jblBUI9COUw2g+v+Qgtz96sgL/QR3aQ722o3cuw/vYlwCKY1zuNf4 B9+Kg5HQw875MM/V4qhPuuHRH9YpWcl1/l6AkJqU8RFohztOxCJ0YBv/JhPKCdE4q7LI 34s0N1B1jGe3/sMSmFsPMN2aaDEXFd7+2VQl9lVm/6tGzoh+ezK85+coBGJXBVkiujre fLjBAs8xfgFQr7bObDMGebnpHsUs2huntvFdc58KGvxT1bqGWPrq0f8bnMm1NfG2nPTp cfbvFZ4uDMqX7k6IhOtVuG7inR6Y3kF91tLAlxWFi9dr02a90UFJtiPZ1QRL4rRwyYZA U/TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IvfsuqeXvTAiiT0A6Kg2dLp8waVJkGZPJh+mIn+Z3lc=; fh=vixJBgtUXk4t9u6gnd9eujHNItHH2KqXMpO1xDbPkGA=; b=FIL4e823NG4c2ML8jS8cfdbBa/ACTjPD/22cEODaCTniqOFZcZfkfL8tiqzLkO56v6 D3J2D3oa4J8t2HVrcDFvDJeXt/AJFUGLpkhb3gq0TiqKEJWltOofvbiJftUi0YNXaq/Z 9REgmkHbfanpUAMsdTSmjRvqj0vvSJNhu2SowjZsGFOlXdq2ab/aUtdDTPZklsePA88R iofHOMTfXCfozB1DiJN542fOdZmC09TEG2f8Q7L19zqF5WtvH5XKfqpjEQlEngpewEww +IMykX2J+r2mEAKkIOO8/QAe0U4JG78Yd4JBRZFfmtg963jYwJedchNlODBHRbPKSqo3 2XpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=asheKMbh; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id fj15-20020a056a003a0f00b00690c951d2cesi14693057pfb.191.2023.10.12.06.13.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 06:13:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=asheKMbh; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9FEF6822CE2F; Thu, 12 Oct 2023 06:13:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344014AbjJLNNi (ORCPT + 99 others); Thu, 12 Oct 2023 09:13:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343748AbjJLNNh (ORCPT ); Thu, 12 Oct 2023 09:13:37 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 270CC91 for ; Thu, 12 Oct 2023 06:13:36 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-405361bba99so9442555e9.2 for ; Thu, 12 Oct 2023 06:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1697116414; x=1697721214; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=IvfsuqeXvTAiiT0A6Kg2dLp8waVJkGZPJh+mIn+Z3lc=; b=asheKMbhbemLGughzEIK2P1pRezyMpbJ+eXyNW7ikkxvQl/0OOMsDeizR69PbNPKoD gA+pFBIUZqts/JPS+Bws5bzT9t68yxmfL63rSagkjjRCZoMEA2uj1HRBrXqiU4uNTNHE k02PUV5/zUrXuscDmzgYTKJmjl1BcTUn0NYKifoCEWg+LfhkfrVSsITk32iXpGHROFVR fZRq+t1KWjkfRssUBOu0ZWlBOqZ7H7OVCAgvSKP9H8+k/SWoiptYMnuoAvE1ENe5Il7f TxWXCbu738HD7oeLjreqERgr7eyw/nEwHaLBR//Ru6vA4N5KTDrkAUfom4og2uVqVUNm 26uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697116414; x=1697721214; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=IvfsuqeXvTAiiT0A6Kg2dLp8waVJkGZPJh+mIn+Z3lc=; b=HETCSmNbZKwLS/xZk6i7p4RyVfksTV8sakHAHDB84o2TkpTDl1CNfssSnf3j7S4VmF ZUVtP9pIXIQTBivUlM2mk+r2Mp7fKyES0/ejpQHMnue7CQiPmcw5ewS7iM7Mb84r4OiR Qc71FiTK1F6HRdLrXzeiKrrwZQWWhOZXfxW+PU9q+8pyMfBqN47FTaOA6QV7ybiDeaz9 xonfVvbvjq5qSB7kq0SEEQIDXy7paPRi6sGyWJK85hIvdQvXBZrxMColvCvOzNPkdYtv oS5v3Gxgt1onKTHJieFel6WZAM0BE9T1wA4hVKPBeUWcblFzqfDWsRnW17wwaVMnCab/ 0PqQ== X-Gm-Message-State: AOJu0YzYqq+JHLF6FEIdrPLxV8jIC3oH54TI6rWKr5HO/7nJ+C0OBvJq ppsSrmhLzlgmZA7vr3HRKYoJiTJcMDcoIToPiWpOcA== X-Received: by 2002:a05:600c:255:b0:405:3d83:2b76 with SMTP id 21-20020a05600c025500b004053d832b76mr20973611wmj.13.1697116414527; Thu, 12 Oct 2023 06:13:34 -0700 (PDT) Received: from vermeer ([2a01:cb1d:81a9:dd00:b570:b34c:ffd4:c805]) by smtp.gmail.com with ESMTPSA id l17-20020a1ced11000000b0040588d85b3asm21637965wmh.15.2023.10.12.06.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 06:13:34 -0700 (PDT) Date: Thu, 12 Oct 2023 15:13:31 +0200 From: Samuel Ortiz To: Lukas Wunner Cc: Alexey Kardashevskiy , Jonathan Cameron , Dan Williams , 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 , 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: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231012091542.GA22596@wunner.de> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Thu, 12 Oct 2023 06:13:40 -0700 (PDT) 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. Cheers, Samuel. [1] https://github.com/riscv-non-isa/riscv-ap-tee-io/blob/main/specification/07-theory_operations.adoc >