KVM: SVM: Fix CPL export via SS.DPL
authorJan Kiszka <jan.kiszka@siemens.com>
Sun, 29 Jun 2014 15:12:43 +0000 (17:12 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 30 Jun 2014 14:45:28 +0000 (16:45 +0200)
We import the CPL via SS.DPL since ae9fedc793. However, we fail to
export it this way so far. This caused spurious guest crashes, e.g. of
Linux when accessing the vmport from guest user space which triggered
register saving/restoring to/from host user space.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm.c

index ec8366c5cfeaa2004a637465d9fc65787cc97618..b5e994ad0135973acb1a449ce3b5442a2aa9b43b 100644 (file)
@@ -1462,6 +1462,7 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
                 */
                if (var->unusable)
                        var->db = 0;
+               var->dpl = to_svm(vcpu)->vmcb->save.cpl;
                break;
        }
 }