From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89233C38145 for ; Thu, 8 Sep 2022 15:11:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 08A576B0072; Thu, 8 Sep 2022 11:11:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 039F08D0003; Thu, 8 Sep 2022 11:11:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E1CB28D0001; Thu, 8 Sep 2022 11:11:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id CF64C6B0072 for ; Thu, 8 Sep 2022 11:11:36 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 808BE160BF9 for ; Thu, 8 Sep 2022 15:11:36 +0000 (UTC) X-FDA: 79889257392.06.2BC2374 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by imf07.hostedemail.com (Postfix) with ESMTP id 23AC44006F for ; Thu, 8 Sep 2022 15:11:35 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id e5so407215pfl.2 for ; Thu, 08 Sep 2022 08:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=aTBij0MKfHujyUmk5AcvjcEPDYsuhsMOVk1UDlCpwHM=; b=M8sDj3UF6N8I7JnxOD5qpHcBpkICJr+jJbnZkTKusip2DzAxWgiNLQ6mj7h8OEkpD6 7fubBL7T9kK7c3AohI7ypbXz811/OZvC5CTxzgbqPwOybqN9tFi6uw95Zcd5vSciyPK4 S+W7qD3SR4im8zMU0XHmJV/sA6tAILo//CEVix9HLeB9cKQUbxOKii2rsTpxve1LMRmx 5FFykgBQ2jC1ECefm4B0Xb/aBy+8hjxOghGPi8x3hmyqP5wIoPkS8aXgm2XC5x1Dnxt4 BPW0xb5jRAoqOXGUXO/9jXwGdfBAV11vjdL1x2Ewj6q4oFlLSU6ZWuyxR/86W9GK6GRG dpvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=aTBij0MKfHujyUmk5AcvjcEPDYsuhsMOVk1UDlCpwHM=; b=L8z2HV3c3frgfzjQpzR5k8HTencsGR7JXBRw9ekSlPogXqfZtdCPgE4kFxxBTfKYhB 7gx3rsaAX4KVapy862JCyhmAXFCKjQK97VA9T1D3WXoXF9EL3Zo+rB5dHUCx4qynRrCE o0qB6ZN8jYH2gM7XJvIWgRI030RMWNYo+jWm+hUWVZL3zoIVucoUhIR+pAYKlVPrlSkG IFa/dksyoKM6pQopN5w4m1UyR+6nzzE/cLQZbuEAAUv0Eehlig4MOIjbXazwJ3ZdFeBk GjXzLIKbxRfawONJbzKL/KItJDWKiLG1yZoyWUCptKWYUZZ0Z5G7Jm9TLGKseIwTC6Yr xaKw== X-Gm-Message-State: ACgBeo1aLA0fE+pRHQ9pl5SRqsih5mFNEIR5n4zksA/3zxzL5B3K57pL o7qKXQ8ueUyl7NdKRWLyhqArnA== X-Google-Smtp-Source: AA6agR52H9GqkwF66V9j3sYZCEhIamP67gNhXAIhkPKoFl7VQPznDhLiYGxoAwhmixzGU+O0GNIEfA== X-Received: by 2002:a05:6a00:2395:b0:536:8296:51d5 with SMTP id f21-20020a056a00239500b00536829651d5mr9625772pfc.84.1662649894875; Thu, 08 Sep 2022 08:11:34 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id jc3-20020a17090325c300b00174abcb02d6sm10263695plb.235.2022.09.08.08.11.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Sep 2022 08:11:34 -0700 (PDT) Date: Thu, 8 Sep 2022 15:11:30 +0000 From: Sean Christopherson To: Harald Hoyer Cc: ashish.kalra@amd.com, ak@linux.intel.com, alpergun@google.com, ardb@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, dgilbert@redhat.com, dovmurik@linux.ibm.com, hpa@zytor.com, jarkko@kernel.org, jmattson@google.com, jroedel@suse.de, kirill@shutemov.name, kvm@vger.kernel.org, linux-coco@lists.linux.dev, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, luto@kernel.org, marcorr@google.com, michael.roth@amd.com, mingo@redhat.com, pbonzini@redhat.com, peterz@infradead.org, pgonda@google.com, rientjes@google.com, sathyanarayanan.kuppuswamy@linux.intel.com, slp@redhat.com, srinivas.pandruvada@linux.intel.com, tglx@linutronix.de, thomas.lendacky@amd.com, tobin@ibm.com, tony.luck@intel.com, vbabka@suse.cz, vkuznets@redhat.com, x86@kernel.org Subject: Re: [[PATCH for v6]] KVM: SEV: fix snp_launch_finish Message-ID: References: <6a513cf79bf71c479dbd72165faf1d804d77b3af.1655761627.git.ashish.kalra@amd.com> <20220908145557.1912158-1-harald@profian.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220908145557.1912158-1-harald@profian.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662649896; a=rsa-sha256; cv=none; b=ccBhrBQxeQiJ2V+Mu+YyCmLP+jdcd4CBqy8OY1eTPwFupLQVcoHv1zyg3VDKGrz/2lfR0K WCG7hw34m4TPThX7nizQvRvySS2CC01YQDRu/xS5Lmitivv/3WYn1AEkguiVN2ym36D0ho GNvrpQw9m+PQ69+GDCJCOT9AZL3EU1M= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=M8sDj3UF; spf=pass (imf07.hostedemail.com: domain of seanjc@google.com designates 209.85.210.176 as permitted sender) smtp.mailfrom=seanjc@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662649896; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aTBij0MKfHujyUmk5AcvjcEPDYsuhsMOVk1UDlCpwHM=; b=og2ns6v6eo0uin2YTvRWj0HkI2PLMN2dZ86apeKtn2uLpJ3W5RWoj7Z5c5jvdzO0M+zM2+ ia/hkfuDr7Wlept1p674Cg+24v9cRXpBG7o+4NPSiUew5YFSI5gjif3+8QLMedZCgxrBtR us2c3lR8yg4JW57q0q3NvbuTT7wmwYM= X-Stat-Signature: feyamo4utj9tpe89pi3xx3teu6epb64d X-Rspamd-Queue-Id: 23AC44006F X-Rspamd-Server: rspam11 X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=M8sDj3UF; spf=pass (imf07.hostedemail.com: domain of seanjc@google.com designates 209.85.210.176 as permitted sender) smtp.mailfrom=seanjc@google.com; dmarc=pass (policy=reject) header.from=google.com X-HE-Tag: 1662649895-383865 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Sep 08, 2022, Harald Hoyer wrote: > The `params.auth_key_en` indicator does _not_ specify, whether an > ID_AUTH struct should be sent or not, but, wheter the ID_AUTH struct > contains an author key or not. The firmware always expects an ID_AUTH block. > > Link: https://lore.kernel.org/all/cover.1655761627.git.ashish.kalra@amd.com/ Please provide feedback by directly responding to whatever patch/email is buggy. Or if that's too complicated for some reason (unlikely in this case), provide the fixup patch to the author *off-list*. > Signed-off-by: Harald Hoyer > --- > arch/x86/kvm/svm/sev.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c > index 85357dc4d231..5cf4be6a33ba 100644 > --- a/arch/x86/kvm/svm/sev.c > +++ b/arch/x86/kvm/svm/sev.c > @@ -2242,17 +2242,18 @@ static int snp_launch_finish(struct kvm *kvm, struct kvm_sev_cmd *argp) > > data->id_block_en = 1; > data->id_block_paddr = __sme_pa(id_block); > - } > > - if (params.auth_key_en) { > id_auth = psp_copy_user_blob(params.id_auth_uaddr, KVM_SEV_SNP_ID_AUTH_SIZE); > if (IS_ERR(id_auth)) { > ret = PTR_ERR(id_auth); > goto e_free_id_block; > } > > - data->auth_key_en = 1; > data->id_auth_paddr = __sme_pa(id_auth); > + > + if (params.auth_key_en) { While I'm here though... Single line if-statements don't need curly braces. > + data->auth_key_en = 1; > + } > } > > data->gctx_paddr = __psp_pa(sev->snp_context); > -- > 2.37.1 >