Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60f24784 authored by Avi Kivity's avatar Avi Kivity
Browse files

KVM: Optimize kvm_mmu_unprotect_page_virt() for tdp



We know no pages are protected, so we can short-circuit the whole thing
(including fairly nasty guest memory accesses).

Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 5dadbfd6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2694,6 +2694,9 @@ int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva)
	gpa_t gpa;
	int r;

	if (tdp_enabled)
		return 0;

	gpa = vcpu->arch.mmu.gva_to_gpa(vcpu, gva);

	spin_lock(&vcpu->kvm->mmu_lock);