[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e56d38bf-bc07-ebfb-5bec-60c60d664447@redhat.com>
Date: Wed, 27 Jan 2021 18:30:47 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 01/11] KVM: x86: Get active PCID only when writing a
CR3 value
On 27/10/20 22:23, Sean Christopherson wrote:
>
> +static void svm_load_mmu_pgd(struct kvm_vcpu *vcpu, hpa_t root_hpa,
> int root_level)
> {
> struct vcpu_svm *svm = to_svm(vcpu);
> unsigned long cr3;
>
> - cr3 = __sme_set(root);
> + cr3 = __sme_set(root_hpa) | kvm_get_active_pcid(vcpu);
> if (npt_enabled) {
> svm->vmcb->control.nested_cr3 = cr3;
SVM uses the name "nested CR3" so this variable actually could represent
an NPT value that does not need the PCID.
Therefore, this change must be done in an else branch, which I've done
on applying the patch.
Paolo
Powered by blists - more mailing lists