]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kvm/svm.c
KVM: SVM: fix random segfaults with NPT enabled
[linux-2.6-omap-h63xx.git] / arch / x86 / kvm / svm.c
index e2ee264740c7dbb6ea6717b3aa7617c393fd4831..d1106cddab0dfac2a70251f10b4ea067f2a919e0 100644 (file)
@@ -62,6 +62,7 @@ static int npt = 1;
 module_param(npt, int, S_IRUGO);
 
 static void kvm_reput_irq(struct vcpu_svm *svm);
+static void svm_flush_tlb(struct kvm_vcpu *vcpu);
 
 static inline struct vcpu_svm *to_svm(struct kvm_vcpu *vcpu)
 {
@@ -1027,6 +1028,13 @@ static int pf_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
                KVMTRACE_3D(TDP_FAULT, &svm->vcpu, error_code,
                            (u32)fault_address, (u32)(fault_address >> 32),
                            handler);
+       /*
+        * FIXME: Tis shouldn't be necessary here, but there is a flush
+        * missing in the MMU code. Until we find this bug, flush the
+        * complete TLB here on an NPF
+        */
+       if (npt_enabled)
+               svm_flush_tlb(&svm->vcpu);
 
        if (event_injection)
                kvm_mmu_unprotect_page_virt(&svm->vcpu, fault_address);