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

Commit a3aa51cf authored by Avi Kivity's avatar Avi Kivity
Browse files

KVM: MMU: Add drop_large_spte() helper



To clarify spte fetching code, move large spte handling into a helper.

Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent 121eee97
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -1492,6 +1492,14 @@ static void link_shadow_page(u64 *sptep, struct kvm_mmu_page *sp)
	__set_spte(sptep, spte);
	__set_spte(sptep, spte);
}
}


static void drop_large_spte(struct kvm_vcpu *vcpu, u64 *sptep)
{
	if (is_large_pte(*sptep)) {
		drop_spte(vcpu->kvm, sptep, shadow_trap_nonpresent_pte);
		kvm_flush_remote_tlbs(vcpu->kvm);
	}
}

static void kvm_mmu_page_unlink_children(struct kvm *kvm,
static void kvm_mmu_page_unlink_children(struct kvm *kvm,
					 struct kvm_mmu_page *sp)
					 struct kvm_mmu_page *sp)
{
{
+1 −4
Original line number Original line Diff line number Diff line
@@ -360,10 +360,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
			kvm_flush_remote_tlbs(vcpu->kvm);
			kvm_flush_remote_tlbs(vcpu->kvm);
		}
		}


		if (is_large_pte(*sptep)) {
		drop_large_spte(vcpu, sptep);
			drop_spte(vcpu->kvm, sptep, shadow_trap_nonpresent_pte);
			kvm_flush_remote_tlbs(vcpu->kvm);
		}


		if (level <= gw->level) {
		if (level <= gw->level) {
			direct = 1;
			direct = 1;