summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaolo Bonzini2014-08-18 13:17:00 +0200
committerPaolo Bonzini2014-08-19 15:12:28 +0200
commit15fc075269e42230605343554c5c8001eb819228 (patch)
treefdad2e6ab9475a23bfb2611a0b44901dd715614a
parentKVM: x86: drop fpu_activate hook (diff)
downloadkernel-qcow2-linux-15fc075269e42230605343554c5c8001eb819228.tar.gz
kernel-qcow2-linux-15fc075269e42230605343554c5c8001eb819228.tar.xz
kernel-qcow2-linux-15fc075269e42230605343554c5c8001eb819228.zip
KVM: x86: raise invalid TSS exceptions during a task switch
Conditions that would usually trigger a general protection fault should instead raise #TS. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/emulate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 03954f7900f5..ef297919a691 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -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)