Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp534950pxb; Thu, 9 Sep 2021 06:37:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLmwltG4Xc6NVShO6Dx8pibyZrc8fOF2jAzltrE+C7NonXrbk5LwdmMSCbbB9I7BboPeVg X-Received: by 2002:a05:6402:524e:: with SMTP id t14mr3210968edd.39.1631194656919; Thu, 09 Sep 2021 06:37:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631194656; cv=none; d=google.com; s=arc-20160816; b=O+8oazHqWNjR/3uF2iw3pXCvQm5mtNUC1mjj6o5YpgdBcm05vbKkqerCgvja2fq3bT Aqds0zxIHjcC4uYtSioUmCnGl6i2eMACw2thR8w5XdQFz3x+o9op+FBLK+pHM5mUagAl b+0m8WhEAfbDF5dAZ+FU7Rzmxe+bS3Nopk2pDIyN5yI7NMpOigeQ81ZGwAZz/iHrt65T mKFN4KOdxsGFELNL3aFDj9Az66HUSuCIExiY0XAkhFFnJJiucfVTP8KsGRpUyW4IKBF3 D1LjZMtlX69IGO+Y+5N/6iYGoptG3tcNZHQy2XwkI6Kfl/neKX9N7a4HLhhT4qZQkljc HpvA== 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; bh=LAn302Em7jEbjqG8puCt6hXav/OgBgKMIsp9NgBaq2s=; b=WrnW4woBpBDE4cnaDzK7hf6rg4TXGMpawCeYlXksU9smvg+rCZBT911cWPHAezccHy vdWVYlNlAJe5tANoo1igyYQMUycvi1Ys9dhk4i+Bg89N5ckm/CzHe3mn5A0wwIP7rH/8 tTHmXygIk7aDCZdV8k1WuWVe1FRSNKuZcZHT1S/SAyOz0mpluTru4dmXOtWX6npkQBqC pKZcM6VHYqw/L+7lMd6sE4wnD9uh2apH9MVqZ4Bud28gTZwjqMCBaxa6Rmo8M49d6vcV rPFWMZa3cqGSZccgZMH6ATq+TTGLskQixuWk8L+Mvyt2kBi5ler3/0T/BEspXOuZ2euN hw4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u19si2404478edo.600.2021.09.09.06.37.10; Thu, 09 Sep 2021 06:37:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245712AbhIINdb (ORCPT + 99 others); Thu, 9 Sep 2021 09:33:31 -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