Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8530406rwl; Sat, 31 Dec 2022 07:19:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXtr8f4jExkQGkLxJZh5Wq7XTjbwJ22HMwqJyav1K1avZZRJ5sWDs7sxogkxszlf5nQZ1QKD X-Received: by 2002:a05:6a21:9990:b0:a6:f26b:558 with SMTP id ve16-20020a056a21999000b000a6f26b0558mr56671455pzb.16.1672499942729; Sat, 31 Dec 2022 07:19:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672499942; cv=none; d=google.com; s=arc-20160816; b=PGmwkzEsc6Ctdz1u1Gjbk4vvpSOIBAodL82Bfyftpz27lU37t5rKmkobVZYedsH0Cg GRh4zETbwO+rdvKO5NWzphfn8MnciZnLfqQgPOOzQXqX1Z53szZzdI6XKd2W0zQ7cIue lrUFWNvhm+E+LXbpf1H7Wwnx0Y9Du7DbaYYX2DzgReRvOnpb7F9kRZJDTkoPCQ1iClXZ u8+fRDBsbzmVgbQWKVT731pMQgTSDci1Bks9VRDKEj+tcvod/uJc2pfmPJDWCwrYCx0o HFa/G/RwN0kDwtKnyBzVU57Ii9z8KRTV/ztqxhBu0K47yqdMcXorYfLiLwS4su9qyA1z 6X0g== 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=U6wBI4J1hl6vg+OhVLDsZDGkCmTqz9MNCxaJXngVatA=; b=GKNZ2gMPrmgRsoSqIAAn3pqmlJOXFWsd7afA0zaegzLLhZPslnF9OSRxsVFg+HFMQ3 SS5LYtjZX5OqNynvb8dZEB0eT4rCapiJAApGmijxUIMzpNzJTLcfQEPPA2NboJkWxcmf HUR23GD0ZlryVmUvcSxsjch4Ee/FU6r9pI1wyeAMeDy2eYvDEp+rvjRuLDdSkXWfBbLg AiT18XVV9ul6MVDsptcTP6NJL8DEEqr1q45JdAHp2bvlpJSYyf7gF6CyNgDhMDv1sBUq HVZFOoXgeIWaJBUYXaVGj1/+QJ0vjpPEHlDLrcd7sopGqx6zbrg2Rmb5k6Q5p5iAcWpq vflg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MSqK18kq; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t64-20020a638143000000b004980040167fsi20800450pgd.642.2022.12.31.07.18.48; Sat, 31 Dec 2022 07:19:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MSqK18kq; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230190AbiLaPRG (ORCPT + 99 others); Sat, 31 Dec 2022 10:17:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235676AbiLaPQx (ORCPT ); Sat, 31 Dec 2022 10:16:53 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAB195589; Sat, 31 Dec 2022 07:16:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AA775B80189; Sat, 31 Dec 2022 15:16:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0190C433EF; Sat, 31 Dec 2022 15:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672499808; bh=E5b0+Tex/od7yWpcV4nYzqZ1OMql0EqcYI9TkDd+6UU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MSqK18kqooBPs0gssQK+KGvL8ppzWQrcmlIRDw0J/x8gYG5zyYMHMmw5BQYmcBWfA 1RyeGCz4cwim395EYMRaSgqL8Y4a4bJPRO101rH9ojdrTKeLT0drBEX9/aGJFAaPfG mWL5h2IbMNUzK0m/urKGC6o29WOl82x31dd5QBFkeYNoV0DrJxnHQo9JXXJ5SOsYb+ h80eq/BXfRnnOcLjtJJsk8f2Dbi6ia0G9j8hv7Z9eBQ1QNPOPOG3ztSUsYfODODaau EMwKhhnmD7WvxIKcjJWWTwrtxdnpWTbvIHSoHu6OQuER6RKfkwZyYTRc9Ida/jxpWe WX+rIU11NRcJQ== Date: Sat, 31 Dec 2022 15:16:45 +0000 From: Jarkko Sakkinen To: Michael Roth Cc: kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-mm@kvack.org, linux-crypto@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, jroedel@suse.de, thomas.lendacky@amd.com, hpa@zytor.com, ardb@kernel.org, pbonzini@redhat.com, seanjc@google.com, vkuznets@redhat.com, wanpengli@tencent.com, jmattson@google.com, luto@kernel.org, dave.hansen@linux.intel.com, slp@redhat.com, pgonda@google.com, peterz@infradead.org, srinivas.pandruvada@linux.intel.com, rientjes@google.com, dovmurik@linux.ibm.com, tobin@ibm.com, bp@alien8.de, vbabka@suse.cz, kirill@shutemov.name, ak@linux.intel.com, tony.luck@intel.com, marcorr@google.com, sathyanarayanan.kuppuswamy@linux.intel.com, alpergun@google.com, dgilbert@redhat.com, ashish.kalra@amd.com, harald@profian.com, Brijesh Singh , Pavan Kumar Paluri Subject: Re: [PATCH RFC v7 37/64] KVM: SVM: Add KVM_SNP_INIT command Message-ID: References: <20221214194056.161492-1-michael.roth@amd.com> <20221214194056.161492-38-michael.roth@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On Sat, Dec 31, 2022 at 02:47:29PM +0000, Jarkko Sakkinen wrote: > A couple of fixups. > > On Sat, Dec 31, 2022 at 02:27:57PM +0000, Jarkko Sakkinen wrote: > > diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c > > index 6c4fdcaed72b..462c9aaa2e7e 100644 > > --- a/drivers/crypto/ccp/sev-dev.c > > +++ b/drivers/crypto/ccp/sev-dev.c > > @@ -1381,6 +1381,12 @@ static int __sev_snp_init_locked(int *error) > > if (sev->snp_initialized) > > return 0; > > > > + if (!sev_version_greater_or_equal(SNP_MIN_API_MAJOR, SNP_MIN_API_MINOR)) { > > + dev_dbg(sev->dev, "SEV-SNP support requires firmware version >= %d:%d\n", > > + SNP_MIN_API_MAJOR, SNP_MIN_API_MINOR); > > + return -ENODEV; > > return 0; > > It is not a failure case anyway. > > > + } > > + > > /* > > * The SNP_INIT requires the MSR_VM_HSAVE_PA must be set to 0h > > * across all cores. > > @@ -2313,25 +2319,19 @@ void sev_pci_init(void) > > } > > } > > > > + rc = sev_snp_init(&error, true); > > + if (rc != -ENODEV) > > > if (rc) > > Because other wise there would need to be nasty "if (rc && rc != ENODEV)" > so that this does not happen: > > [ 9.321588] ccp 0000:49:00.1: SEV-SNP: failed to INIT error 0x0 > > BR, Jarkko This patch (not dependent on the series) is kind of related to my feedback. Since platform init can span from quite many locations it would be useful to get errors reported from all locations: https://www.lkml.org/lkml/2022/12/31/175 Would be IMHO good to have this in the baseline when testing SNP init functionality. BR, Jarkko