diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2010-04-14 09:50:57 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 05:17:44 -0400 |
commit | 0760d44868f351ba30fc9a08cf1830e46aa72466 (patch) | |
tree | 55e8a204260c2a301c8da281b52bfef15f21bc1c /arch/x86/kvm/emulate.c | |
parent | 8f6abd06f521112a0a3bc906df273fa3ce0a9387 (diff) |
KVM: x86: Terminate early if task_switch_16/32 failed
Stop the switch immediately if task_switch_16/32 returned an error. Only
if that step succeeded, the switch should actually take place and update
any register states.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 083b269a83ea..aace5659bbe0 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2402,6 +2402,8 @@ static int emulator_do_task_switch(struct x86_emulate_ctxt *ctxt, | |||
2402 | else | 2402 | else |
2403 | ret = task_switch_16(ctxt, ops, tss_selector, old_tss_sel, | 2403 | ret = task_switch_16(ctxt, ops, tss_selector, old_tss_sel, |
2404 | old_tss_base, &next_tss_desc); | 2404 | old_tss_base, &next_tss_desc); |
2405 | if (ret != X86EMUL_CONTINUE) | ||
2406 | return ret; | ||
2405 | 2407 | ||
2406 | if (reason == TASK_SWITCH_CALL || reason == TASK_SWITCH_GATE) | 2408 | if (reason == TASK_SWITCH_CALL || reason == TASK_SWITCH_GATE) |
2407 | ctxt->eflags = ctxt->eflags | X86_EFLAGS_NT; | 2409 | ctxt->eflags = ctxt->eflags | X86_EFLAGS_NT; |