Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp752310rwn; Thu, 8 Sep 2022 08:18:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR50hqHE8WFAgtYEP2NL+iTBeALwlEIlUEayd/GHD3ZhTFngbb7ujnpPRXTX4dliAwaCKFgu X-Received: by 2002:a17:902:a58c:b0:174:3c97:d9a1 with SMTP id az12-20020a170902a58c00b001743c97d9a1mr9564214plb.22.1662650323105; Thu, 08 Sep 2022 08:18:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662650323; cv=none; d=google.com; s=arc-20160816; b=0PA2NUVQFX27c2D/UpiF42PGLC2fkmzzBRmpUtzLIHE2INZnuFENRZzSQI4BQ+UjPy KyOPqce7LdbwWvZO9hanjNh5KOuPmONyYmB8rXCR2pjcP26zT+7tQKN1uFuXHJyGUkfr vKZKOGagNTnG9YX9W3TYEog7BMvYmGXDBJ1cnEewiGY6SNYjYoZPI7CSsd+gdhZTqn4U hUFap260WUJpdyrUDDUTBJ2rl+z/Bp0hYXb8yV5RE/UJYUJPYDxwBG3k2+wW1gW2QAY0 6O0ijSqNu1Y0ysPFQUtbIkHGX93WBis3kH0tgC1n2O7cZzu8q1Ruaa73+3bCWFUoyFTQ PI5Q== 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=aTBij0MKfHujyUmk5AcvjcEPDYsuhsMOVk1UDlCpwHM=; b=bSEWnmZk66aBLD1yAdIyHp8pkRg9a4hA4zlc9ZYIVn2Jpa5oUpvsBkF1lJdvXKAteE admQpYEym+9Ku6xR5HOL+vU8DNT9UV/VX0Ix2S6XzvdjISco7laP/JoCgnzo4aA7NwnS u1v24WE+WSMrgjUHHgpd+hGvNMAzgFeHRvd3d997cKwZ39kGhJ2OgmgwbhUXdPiM8Osa G1XnrXMIri5eLCdPnqYvDPwStIVXqrcBSaxdQAGyNlpeyadY9v6DmXC5PZucIcNDSots cEKu76MDkxe1eOzCLTbj+FhH5x/CxaBykkxykICW6VhqDnboB4P5JLFTJXoY1HMQWYLO iM8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=M8sDj3UF; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t4-20020a62ea04000000b0052e6e3e0a05si19182590pfh.322.2022.09.08.08.18.19; Thu, 08 Sep 2022 08:18:43 -0700 (PDT) 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=@google.com header.s=20210112 header.b=M8sDj3UF; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232867AbiIHPLl (ORCPT + 99 others); Thu, 8 Sep 2022 11:11:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232869AbiIHPLi (ORCPT ); Thu, 8 Sep 2022 11:11:38 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8346A13B11A for ; Thu, 8 Sep 2022 08:11:35 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id s206so17060623pgs.3 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=A2iiLxDROl+D6jzUvlfXBLXrMMBaN7UfeCNzu1r6dkpN+3eJ+rPS+5wtq/U9ZxVE8j HVxz9/RagO0jjKjR4o5Eikr37DWMqV3R2a186s8cmr3O/qo+MtTx8sBCdLRaVAeQ28ZQ bzyJaWYERcDgOC9yBryP0RCdV0W7uuft6iAruRuTDWa/ndKw+r1jW7oUaCtYGHkJim0g LbfV4FWm1hiqQkkFvN8ekH7SwpMGeWa57VdxR0jt9A4TprnW9HvBHyyB7u6IpNOIMb0l B30KWxDVakmDCFUsu2eIhRNAoijj4gufx63SYIC6SuWMbPRmDDiHiNuEYDHRnyYyJ0K6 zPWA== X-Gm-Message-State: ACgBeo3sruYSfih+9L6Di9UWLSAGAXAwjP89rwPI8tgPS+5dzJ0ElOlX 4tmBW6FjV6YsPQ1wG9cgQ4R1Cw== 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> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 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 >