Skip to content

Commit fe9304d

Browse files
vittyvkbonzini
authored andcommitted
KVM: x86: drop superfluous mmu_check_root() from fast_pgd_switch()
The mmu_check_root() check in fast_pgd_switch() seems to be superfluous: when GPA is outside of the visible range cached_root_available() will fail for non-direct roots (as we can't have a matching one on the list) and we don't seem to care for direct ones. Also, raising #TF immediately when a non-existent GFN is written to CR3 doesn't seem to mach architectural behavior. Drop the check. Signed-off-by: Vitaly Kuznetsov <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent d82aaef commit fe9304d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4243,8 +4243,7 @@ static bool fast_pgd_switch(struct kvm_vcpu *vcpu, gpa_t new_pgd,
42434243
*/
42444244
if (mmu->shadow_root_level >= PT64_ROOT_4LEVEL &&
42454245
mmu->root_level >= PT64_ROOT_4LEVEL)
4246-
return !mmu_check_root(vcpu, new_pgd >> PAGE_SHIFT) &&
4247-
cached_root_available(vcpu, new_pgd, new_role);
4246+
return cached_root_available(vcpu, new_pgd, new_role);
42484247

42494248
return false;
42504249
}

0 commit comments

Comments
 (0)