diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2010-04-14 09:51:09 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 05:17:46 -0400 |
commit | e269fb2189fb86d79d64c0ca74c6c1a549ad4aa3 (patch) | |
tree | 627c658efaec155d1f295d1fc7b8abded9d4f861 /arch/x86/kvm/x86.c | |
parent | 0760d44868f351ba30fc9a08cf1830e46aa72466 (diff) |
KVM: x86: Push potential exception error code on task switches
When a fault triggers a task switch, the error code, if existent, has to
be pushed on the new task's stack. Implement the missing bits.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 40991527f54a..58a295c6bf62 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -4778,7 +4778,8 @@ int kvm_arch_vcpu_ioctl_set_mpstate(struct kvm_vcpu *vcpu, | |||
4778 | return 0; | 4778 | return 0; |
4779 | } | 4779 | } |
4780 | 4780 | ||
4781 | int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason) | 4781 | int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason, |
4782 | bool has_error_code, u32 error_code) | ||
4782 | { | 4783 | { |
4783 | int cs_db, cs_l, ret; | 4784 | int cs_db, cs_l, ret; |
4784 | cache_all_regs(vcpu); | 4785 | cache_all_regs(vcpu); |
@@ -4796,7 +4797,8 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason) | |||
4796 | ? X86EMUL_MODE_PROT32 : X86EMUL_MODE_PROT16; | 4797 | ? X86EMUL_MODE_PROT32 : X86EMUL_MODE_PROT16; |
4797 | 4798 | ||
4798 | ret = emulator_task_switch(&vcpu->arch.emulate_ctxt, &emulate_ops, | 4799 | ret = emulator_task_switch(&vcpu->arch.emulate_ctxt, &emulate_ops, |
4799 | tss_selector, reason); | 4800 | tss_selector, reason, has_error_code, |
4801 | error_code); | ||
4800 | 4802 | ||
4801 | if (ret == X86EMUL_CONTINUE) | 4803 | if (ret == X86EMUL_CONTINUE) |
4802 | kvm_x86_ops->set_rflags(vcpu, vcpu->arch.emulate_ctxt.eflags); | 4804 | kvm_x86_ops->set_rflags(vcpu, vcpu->arch.emulate_ctxt.eflags); |