Skip to content

Commit

Permalink
KVM: x86/mmu: fix an incorrect comment in kvm_mmu_new_pgd()
Browse files Browse the repository at this point in the history
There is no function named kvm_mmu_ensure_valid_pgd().

Fix the comment and remove the pair of braces to conform to Linux kernel
coding style.

Signed-off-by: Wei Liu <wei.liu@kernel.org>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20221128214709.224710-1-wei.liu@kernel.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
  • Loading branch information
liuw authored and sean-jc committed Jan 19, 2023
1 parent 5ee0c37 commit 03e5fdf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions arch/x86/kvm/mmu/mmu.c
Expand Up @@ -4556,10 +4556,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 (!fast_pgd_switch(vcpu->kvm, mmu, new_pgd, new_role)) {
/* kvm_mmu_ensure_valid_pgd will set up a new root. */
/*
* Return immediately if no usable root was found, kvm_mmu_reload()
* will establish a valid root prior to the next VM-Enter.
*/
if (!fast_pgd_switch(vcpu->kvm, mmu, new_pgd, new_role))
return;
}

/*
* It's possible that the cached previous root page is obsolete because
Expand Down

0 comments on commit 03e5fdf

Please sign in to comment.