It is necessary to flush all TLB's when a large spte entry is
overwritten with a normal page directory pointer.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
        if (is_shadow_present_pte(*sptep) && !is_large_pte(*sptep))
                return 0;
 
-       if (is_large_pte(*sptep))
+       if (is_large_pte(*sptep)) {
+               set_shadow_pte(sptep, shadow_trap_nonpresent_pte);
+               kvm_flush_remote_tlbs(vcpu->kvm);
                rmap_remove(vcpu->kvm, sptep);
+       }
 
        if (level == PT_DIRECTORY_LEVEL && gw->level == PT_DIRECTORY_LEVEL) {
                metaphysical = 1;