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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B275C433EF for ; Thu, 9 Sep 2021 13:32:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D714D6136F for ; Thu, 9 Sep 2021 13:32:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353799AbhIINdc (ORCPT ); Thu, 9 Sep 2021 09:33:32 -0400 Received: from 8bytes.org ([81.169.241.247]:53378 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358084AbhIINYm (ORCPT ); Thu, 9 Sep 2021 09:24:42 -0400 Received: by theia.8bytes.org (Postfix, from userid 1000) id A57C960F; Thu, 9 Sep 2021 15:23:26 +0200 (CEST) Date: Thu, 9 Sep 2021 15:22:51 +0200 From: Joerg Roedel To: Sean Christopherson Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Brijesh Singh , Tom Lendacky , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, Joerg Roedel Subject: Re: [PATCH v2 1/4] KVM: SVM: Get rid of *ghcb_msr_bits() functions Message-ID: References: <20210722115245.16084-1-joro@8bytes.org> <20210722115245.16084-2-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sean, On Wed, Sep 01, 2021 at 09:31:52PM +0000, Sean Christopherson wrote: > On Wed, Sep 01, 2021, Sean Christopherson wrote: > > control->ghcb_gpa = MAKE_GHCB_MSR_RESP(cpuid_reg, cpuid_value); Made that change, but kept the set_ghcb_msr_cpuid_resp() and renamed it to ghcb_msr_cpuid_resp(). It now returns the MSR value for the CPUID response. I like the keep the more complicated response setters as functions and not macros for readability. > case GHCB_MSR_SEV_INFO_REQ: > control->ghcb_gpa = GHCB_MSR_SEV_INFO(GHCB_VERSION_MAX, > GHCB_VERSION_MIN, > sev_enc_bit)); > break; > > and drop set_ghcb_msr() altogether. Makes sense, I replaced the set_ghcb_msr() calls with the above. > Side topic, what about renaming control->ghcb_gpa => control->ghcb_msr so that > the code for the MSR protocol is a bit more self-documenting? The APM defines > the field as "Guest physical address of GHCB", so it's not exactly prescribing a > specific name. No strong opinion here, I let this up to the AMD engineers to decide. If we change the name I can add a separate patch for this. Regards, Joerg