diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2008-09-23 12:18:31 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-10-15 08:25:17 -0400 |
commit | a378b4e64c0fef2d9e53214db167878b7673a7a3 (patch) | |
tree | 60189a6d18a5ca5b948c8bd78d5311aba696f988 /arch/x86/kvm/mmu.c | |
parent | 1e73f9dd885957bf0c7bb5e63b350d5aeb06b726 (diff) |
KVM: MMU: move local TLB flush to mmu_set_spte
Since the sync page path can collapse flushes.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 9ad4cc553893..23752ef0839c 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -1189,10 +1189,8 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte, | |||
1189 | __func__, gfn); | 1189 | __func__, gfn); |
1190 | ret = 1; | 1190 | ret = 1; |
1191 | pte_access &= ~ACC_WRITE_MASK; | 1191 | pte_access &= ~ACC_WRITE_MASK; |
1192 | if (is_writeble_pte(spte)) { | 1192 | if (is_writeble_pte(spte)) |
1193 | spte &= ~PT_WRITABLE_MASK; | 1193 | spte &= ~PT_WRITABLE_MASK; |
1194 | kvm_x86_ops->tlb_flush(vcpu); | ||
1195 | } | ||
1196 | } | 1194 | } |
1197 | } | 1195 | } |
1198 | 1196 | ||
@@ -1241,9 +1239,11 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte, | |||
1241 | } | 1239 | } |
1242 | } | 1240 | } |
1243 | if (set_spte(vcpu, shadow_pte, pte_access, user_fault, write_fault, | 1241 | if (set_spte(vcpu, shadow_pte, pte_access, user_fault, write_fault, |
1244 | dirty, largepage, gfn, pfn, speculative)) | 1242 | dirty, largepage, gfn, pfn, speculative)) { |
1245 | if (write_fault) | 1243 | if (write_fault) |
1246 | *ptwrite = 1; | 1244 | *ptwrite = 1; |
1245 | kvm_x86_ops->tlb_flush(vcpu); | ||
1246 | } | ||
1247 | 1247 | ||
1248 | pgprintk("%s: setting spte %llx\n", __func__, *shadow_pte); | 1248 | pgprintk("%s: setting spte %llx\n", __func__, *shadow_pte); |
1249 | pgprintk("instantiating %s PTE (%s) at %ld (%llx) addr %p\n", | 1249 | pgprintk("instantiating %s PTE (%s) at %ld (%llx) addr %p\n", |