KVM: x86: raise invalid TSS exceptions during a task switch
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 18 Aug 2014 11:17:00 +0000 (13:17 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 19 Aug 2014 13:12:28 +0000 (15:12 +0200)
Conditions that would usually trigger a general protection fault should
instead raise #TS.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/emulate.c

index 03954f7900f522a496d8249174ec63cc760aa140..ef297919a6913956e7c2052bc6be8766122102aa 100644 (file)
@@ -1468,7 +1468,7 @@ static int __load_segment_descriptor(struct x86_emulate_ctxt *ctxt,
                return ret;
 
        err_code = selector & 0xfffc;
-       err_vec = GP_VECTOR;
+       err_vec = in_task_switch ? TS_VECTOR : GP_VECTOR;
 
        /* can't load system descriptor into segment selector */
        if (seg <= VCPU_SREG_GS && !seg_desc.s)