aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-03-30 09:03:29 -0400
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:38 -0400
commit64a7ec066813443440bfc9f60a9e76a47cfa6b2b (patch)
treed6d3461ba7667ac2801350d5b3b518e84b5df0f6 /arch/x86/kvm/x86.c
parentb237ac37a149e8b56436fabf093532483bff13b0 (diff)
KVM: Fix unneeded instruction skipping during task switching.
There is no need to skip instruction if the reason for a task switch is a task gate in IDT and access to it is caused by an external even. The problem is currently solved only for VMX since there is no reliable way to skip an instruction in SVM. We should emulate it instead. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index adcf73871a9d..bb04f11bf70f 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3935,7 +3935,10 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason)
3935 kvm_x86_ops->set_rflags(vcpu, eflags & ~X86_EFLAGS_NT); 3935 kvm_x86_ops->set_rflags(vcpu, eflags & ~X86_EFLAGS_NT);
3936 } 3936 }
3937 3937
3938 kvm_x86_ops->skip_emulated_instruction(vcpu); 3938 /* set back link to prev task only if NT bit is set in eflags
3939 note that old_tss_sel is not used afetr this point */
3940 if (reason != TASK_SWITCH_CALL && reason != TASK_SWITCH_GATE)
3941 old_tss_sel = 0xffff;
3939 3942
3940 /* set back link to prev task only if NT bit is set in eflags 3943 /* set back link to prev task only if NT bit is set in eflags
3941 note that old_tss_sel is not used afetr this point */ 3944 note that old_tss_sel is not used afetr this point */