diff options
-rw-r--r-- | drivers/kvm/mmu.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index 7761089ef3bc..2fc252813927 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -383,6 +383,7 @@ static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn) | |||
383 | BUG_ON(!(*spte & PT_WRITABLE_MASK)); | 383 | BUG_ON(!(*spte & PT_WRITABLE_MASK)); |
384 | rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte); | 384 | rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte); |
385 | rmap_remove(vcpu, spte); | 385 | rmap_remove(vcpu, spte); |
386 | kvm_arch_ops->tlb_flush(vcpu); | ||
386 | *spte &= ~(u64)PT_WRITABLE_MASK; | 387 | *spte &= ~(u64)PT_WRITABLE_MASK; |
387 | } | 388 | } |
388 | } | 389 | } |
@@ -594,6 +595,7 @@ static void kvm_mmu_page_unlink_children(struct kvm_vcpu *vcpu, | |||
594 | rmap_remove(vcpu, &pt[i]); | 595 | rmap_remove(vcpu, &pt[i]); |
595 | pt[i] = 0; | 596 | pt[i] = 0; |
596 | } | 597 | } |
598 | kvm_arch_ops->tlb_flush(vcpu); | ||
597 | return; | 599 | return; |
598 | } | 600 | } |
599 | 601 | ||
@@ -927,7 +929,10 @@ static inline void set_pte_common(struct kvm_vcpu *vcpu, | |||
927 | pgprintk("%s: found shadow page for %lx, marking ro\n", | 929 | pgprintk("%s: found shadow page for %lx, marking ro\n", |
928 | __FUNCTION__, gfn); | 930 | __FUNCTION__, gfn); |
929 | access_bits &= ~PT_WRITABLE_MASK; | 931 | access_bits &= ~PT_WRITABLE_MASK; |
930 | *shadow_pte &= ~PT_WRITABLE_MASK; | 932 | if (is_writeble_pte(*shadow_pte)) { |
933 | *shadow_pte &= ~PT_WRITABLE_MASK; | ||
934 | kvm_arch_ops->tlb_flush(vcpu); | ||
935 | } | ||
931 | } | 936 | } |
932 | } | 937 | } |
933 | 938 | ||