Message ID | 20221110132848.330793-5-robert.hu@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Linear Address Masking (LAM) KVM Enabling | expand |
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index 04e4b38fe73a..7ee6c84934b9 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -4451,8 +4451,12 @@ void kvm_mmu_new_pgd(struct kvm_vcpu *vcpu, gpa_t new_pgd) struct kvm_mmu *mmu = vcpu->arch.mmu; union kvm_mmu_page_role new_role = mmu->root_role; + /* + * If no root is found in cache, current active root.hpa will be (set) + * INVALID_PAGE, a new root will be set up during vcpu_enter_guest() + * --> kvm_mmu_reload(). + */ if (!fast_pgd_switch(vcpu->kvm, mmu, new_pgd, new_role)) { - /* kvm_mmu_ensure_valid_pgd will set up a new root. */ return; }
kvm_mmu_ensure_valid_pgd() is stale. Update the comments according to latest code. No function changes. P.S. Sean firstly noticed this in https://lore.kernel.org/kvm/Yg%2FguAXFLJBmDflh@google.com/. Signed-off-by: Robert Hoo <robert.hu@linux.intel.com> --- arch/x86/kvm/mmu/mmu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)