From: David Matlack <dmatlack@google.com>
To: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Maxim Levitsky <mlevitsk@redhat.com>,
Lai Jiangshan <jiangshan.ljs@antgroup.com>
Subject: Re: [PATCH 6/6] KVM: X86/SVM: Use root_level in svm_load_mmu_pgd()
Date: Wed, 8 Jun 2022 16:54:27 +0000 [thread overview]
Message-ID: <YqDUQxnDS+qoaJhH@google.com> (raw)
In-Reply-To: <20220605063417.308311-7-jiangshanlai@gmail.com>
On Sun, Jun 05, 2022 at 02:34:17PM +0800, Lai Jiangshan wrote:
> From: Lai Jiangshan <jiangshan.ljs@antgroup.com>
>
> The caller always call it with root_level = vcpu->arch.mmu->root_role.level.
It'd be helpful to be more specific about the caller. e.g.
Use root_level in svm_load_mmu_pg() rather that looking up the root
level in vcpu->arch.mmu->root_role.level. svm_load_mmu_pgd() has only
one caller, kvm_mmu_load_pgd(), which always passes
vcpu->arch.mmu->root_role.level as root_level.
No functional change intended.
>
> Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
> ---
> arch/x86/kvm/svm/svm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index 3b49337998ec..f45d11739314 100644
> --- a/arch/x86/kvm/svm/svm.c
> +++ b/arch/x86/kvm/svm/svm.c
> @@ -3951,7 +3951,7 @@ static void svm_load_mmu_pgd(struct kvm_vcpu *vcpu, hpa_t root_hpa,
> hv_track_root_tdp(vcpu, root_hpa);
>
> cr3 = vcpu->arch.cr3;
> - } else if (vcpu->arch.mmu->root_role.level >= PT64_ROOT_4LEVEL) {
> + } else if (root_level >= PT64_ROOT_4LEVEL) {
> cr3 = __sme_set(root_hpa) | kvm_get_active_pcid(vcpu);
> } else {
> /* PCID in the guest should be impossible with a 32-bit MMU. */
> --
> 2.19.1.6.gb485710b
>
next prev parent reply other threads:[~2022-06-08 17:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-05 6:34 [PATCH 0/6] KVM: Trivial cleanups Lai Jiangshan
2022-06-05 6:34 ` [PATCH 1/6] KVM: X86/MMU: Remove unused macros from paging_tmpl.h Lai Jiangshan
2022-06-05 6:34 ` [PATCH 2/6] KVM: X86/MMU: Remove unused PT32_DIR_BASE_ADDR_MASK from mmu.c Lai Jiangshan
2022-06-05 6:34 ` [PATCH 3/6] KVM: X86/MMU: Update comments in paging_tmpl.h for the kinds of guest PTEs Lai Jiangshan
2022-06-05 6:34 ` [PATCH 4/6] KVM: Rename ack_flush() to ack_kick() Lai Jiangshan
2022-06-05 6:34 ` [PATCH 5/6] KVM: X86/MMU: Remove useless mmu_topup_memory_caches() in kvm_mmu_pte_write() Lai Jiangshan
2022-06-05 6:34 ` [PATCH 6/6] KVM: X86/SVM: Use root_level in svm_load_mmu_pgd() Lai Jiangshan
2022-06-08 16:54 ` David Matlack [this message]
2022-06-08 16:59 ` [PATCH 0/6] KVM: Trivial cleanups David Matlack
2022-06-14 17:15 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YqDUQxnDS+qoaJhH@google.com \
--to=dmatlack@google.com \
--cc=jiangshan.ljs@antgroup.com \
--cc=jiangshanlai@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mlevitsk@redhat.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=vkuznets@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox