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

Commit a378b4e6 authored by Marcelo Tosatti's avatar Marcelo Tosatti Committed by Avi Kivity
Browse files

KVM: MMU: move local TLB flush to mmu_set_spte



Since the sync page path can collapse flushes.

Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 1e73f9dd
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1189,10 +1189,8 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
				 __func__, gfn);
			ret = 1;
			pte_access &= ~ACC_WRITE_MASK;
			if (is_writeble_pte(spte)) {
			if (is_writeble_pte(spte))
				spte &= ~PT_WRITABLE_MASK;
				kvm_x86_ops->tlb_flush(vcpu);
			}
		}
	}

@@ -1241,9 +1239,11 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
		}
	}
	if (set_spte(vcpu, shadow_pte, pte_access, user_fault, write_fault,
		      dirty, largepage, gfn, pfn, speculative))
		      dirty, largepage, gfn, pfn, speculative)) {
		if (write_fault)
			*ptwrite = 1;
		kvm_x86_ops->tlb_flush(vcpu);
	}

	pgprintk("%s: setting spte %llx\n", __func__, *shadow_pte);
	pgprintk("instantiating %s PTE (%s) at %ld (%llx) addr %p\n",