Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2078812pxa; Mon, 24 Aug 2020 04:40:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJmfvXlVMqrNFdeP4o2LxnIgcrB+rqIibTp4iBlH+ypNvUnQx/7M3C91jx6FZmj9b5LOYM X-Received: by 2002:a17:906:9984:: with SMTP id af4mr5402482ejc.90.1598269243968; Mon, 24 Aug 2020 04:40:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598269243; cv=none; d=google.com; s=arc-20160816; b=SL7Na0a4IRyGEErBUb8Vvzf4dTr7N3791n4Mfexsd9O0Ju2zk5hyD8y7QIi/4aMI5m ccffRuBHqKAnj9pPnW2t2W8jogEH7OT1Cn3uczvGyDSYxjFkmifDm85//+DG6/fj7x6G BiIJAQqpyDppTG5fv/fpHWkSxJSmfHoDL3s9RvmUiH71PdSmM+SRpRW6hz1DVkvyMQ4z iR/DQjp99xsVavXGMKdUlhK4Pgkpuw3EM6kr2fcrvRECEHWjrwnfDxMIBGfIf/TaCPZE vsuSQydwSs5kUhpJHiKlVoUSVaQwai8NN7I4rTVn07nR0v2SXAX/gW4Wb4D4WLbhE37C g9ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=pzjKU5jnp1RJd2a0FpfszIcQQz0Dkjh8zuJQbNIELbM=; b=g4uVneezWfxLlUJGcbDZRdOmYRInCyzPbCunVdXgMn6sGSjekFSRe4Dht9tOsKfkzs Z+AKXyrpoQziIKDq46ND4ssSkr8Y7ejJvYchV55PrmWseyTUXzDk5XK4NK+aCw/bEEuJ FFWSVbPyVAqCyfqIBQWG83ExGzF7/pQ08k6tGIv9R6ZwGa1IvdFGpT2IhPofTQP5yKxh gJhylUol/d3APyH0wTSR1XubLGoynX/aJi0kjRwizthHlPPiIuzmA76MMsKzWJvAGTXA yjNyOlPre7NNIjw5ubCQqM7W+aODsVNPSjeSvUpvqOb8lOYh8EIJUEoUJ1o+XUPB5ZWK alQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MjR1xAiE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si6707452eds.138.2020.08.24.04.40.21; Mon, 24 Aug 2020 04:40:43 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MjR1xAiE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726975AbgHXLjr (ORCPT + 99 others); Mon, 24 Aug 2020 07:39:47 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:42865 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727043AbgHXLiv (ORCPT ); Mon, 24 Aug 2020 07:38:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598269120; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pzjKU5jnp1RJd2a0FpfszIcQQz0Dkjh8zuJQbNIELbM=; b=MjR1xAiEme6dkPdXrPxv7G9BRH2lSuLaISaeRsekYBfM2XE+ofjsRLCTsIUjKrDqVLerCg 6dO183afhb+OjESoYM48qNAun4EOdxO/WZLT/TSkezQvKHA9ekMc0ev1n5MvpkFaNy6Ukn t/goYA2yy9CZjPoU1aEM0s6zbBigS2Y= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-4-1KtA7Q0RNkaNe3byvgOyFw-1; Mon, 24 Aug 2020 07:38:38 -0400 X-MC-Unique: 1KtA7Q0RNkaNe3byvgOyFw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 93E35100746A; Mon, 24 Aug 2020 11:38:36 +0000 (UTC) Received: from starship (unknown [10.35.206.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F8695D9DD; Mon, 24 Aug 2020 11:38:03 +0000 (UTC) Message-ID: <53b774c8f3ae94fb5161ee6d3005ac3b04f63052.camel@redhat.com> Subject: Re: [PATCH v2 2/7] KVM: nSVM: rename nested 'vmcb' to vmcb12_gpa in few places From: Maxim Levitsky To: Jim Mattson Cc: kvm list , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Ingo Molnar , Thomas Gleixner , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Sean Christopherson , Joerg Roedel , Wanpeng Li , Borislav Petkov , Vitaly Kuznetsov , Paolo Bonzini Date: Mon, 24 Aug 2020 14:37:53 +0300 In-Reply-To: References: <20200820133339.372823-1-mlevitsk@redhat.com> <20200820133339.372823-3-mlevitsk@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.3 (3.36.3-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-08-20 at 14:00 -0700, Jim Mattson wrote: > On Thu, Aug 20, 2020 at 6:33 AM Maxim Levitsky wrote: > > No functional changes. > > > > Signed-off-by: Maxim Levitsky > > --- > > arch/x86/kvm/svm/nested.c | 10 +++++----- > > arch/x86/kvm/svm/svm.c | 13 +++++++------ > > arch/x86/kvm/svm/svm.h | 2 +- > > 3 files changed, 13 insertions(+), 12 deletions(-) > > > > diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c > > index fb68467e6049..f5b17920a2ca 100644 > > --- a/arch/x86/kvm/svm/nested.c > > +++ b/arch/x86/kvm/svm/nested.c > > @@ -431,7 +431,7 @@ int enter_svm_guest_mode(struct vcpu_svm *svm, u64 vmcb_gpa, > For consistency, should the vmcb_gpa argument be renamed to vmcb12_gpa as well? I went over all nested.c and renamed all mentions of vmcb which refer to guest's vmcb to vmcb12, and mentions of nested_vmcb to vmcb12 as well. I hope I didn't made this patch too much larger. I updated the patch subject too. > > > > @@ -579,7 +579,7 @@ int nested_svm_vmexit(struct vcpu_svm *svm) > > > > /* Exit Guest-Mode */ > > leave_guest_mode(&svm->vcpu); > > - svm->nested.vmcb = 0; > > + svm->nested.vmcb12_gpa = 0; > Perhaps in a follow-up change, this could be set to an illegal value > rather than 0? Or rather not reset this address at all, as I did later in the caching pathes which I dropped for now. > > > > @@ -1018,7 +1018,7 @@ static int svm_get_nested_state(struct kvm_vcpu *vcpu, > > > > /* First fill in the header and copy it out. */ > > if (is_guest_mode(vcpu)) { > > - kvm_state.hdr.svm.vmcb_pa = svm->nested.vmcb; > > + kvm_state.hdr.svm.vmcb_pa = svm->nested.vmcb12_gpa; > It's unfortunate that we have "_pa" on the LHS on "_gpa" on the RHS. Oh, well. I was afraid to touch this struct since it is user visible. I noticed it. > > > > diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c > > index 562a79e3e63a..d33013b9b4d7 100644 > > --- a/arch/x86/kvm/svm/svm.c > > +++ b/arch/x86/kvm/svm/svm.c > > @@ -1102,7 +1102,7 @@ static void init_vmcb(struct vcpu_svm *svm) > > } > > svm->asid_generation = 0; > > > > - svm->nested.vmcb = 0; > > + svm->nested.vmcb12_gpa = 0; > Here, too, perhaps this could be changed from 0 to an illegal value in > a follow-up change. > > Reviewed-by: Jim Mattson > Thanks for the review, Best regards, Maxim Levitsky