KVM: MMU: Fix Wrong tlb flush order
authorShaohua Li <shaohua.li@intel.com>
Wed, 20 Jun 2007 09:13:26 +0000 (17:13 +0800)
committerAvi Kivity <avi@qumranet.com>
Mon, 16 Jul 2007 09:05:48 +0000 (12:05 +0300)
Need to flush the tlb after updating a pte, not before.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
drivers/kvm/mmu.c

index ad50cfda5ac153b53bf8d37bf60742862f71a22a..49ffbd3da749b3f281ab4d7ee816d5512d917dcd 100644 (file)
@@ -441,8 +441,8 @@ static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn)
                BUG_ON(!(*spte & PT_WRITABLE_MASK));
                rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte);
                rmap_remove(vcpu, spte);
-               kvm_flush_remote_tlbs(vcpu->kvm);
                set_shadow_pte(spte, *spte & ~PT_WRITABLE_MASK);
+               kvm_flush_remote_tlbs(vcpu->kvm);
        }
 }