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/include | |
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/include')
-rw-r--r-- | arch/x86/include/asm/kvm_emulate.h | 3 | ||||
-rw-r--r-- | arch/x86/include/asm/kvm_host.h | 3 | ||||
-rw-r--r-- | arch/x86/include/asm/svm.h | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index a1319c82050e..0b2729bf2070 100644 --- a/arch/x86/include/asm/kvm_emulate.h +++ b/arch/x86/include/asm/kvm_emulate.h | |||
@@ -230,6 +230,7 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt, | |||
230 | struct x86_emulate_ops *ops); | 230 | struct x86_emulate_ops *ops); |
231 | int emulator_task_switch(struct x86_emulate_ctxt *ctxt, | 231 | int emulator_task_switch(struct x86_emulate_ctxt *ctxt, |
232 | struct x86_emulate_ops *ops, | 232 | struct x86_emulate_ops *ops, |
233 | u16 tss_selector, int reason); | 233 | u16 tss_selector, int reason, |
234 | bool has_error_code, u32 error_code); | ||
234 | 235 | ||
235 | #endif /* _ASM_X86_KVM_X86_EMULATE_H */ | 236 | #endif /* _ASM_X86_KVM_X86_EMULATE_H */ |
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 5d5e0a9afcf2..3602728d54de 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -595,7 +595,8 @@ int emulator_set_dr(struct x86_emulate_ctxt *ctxt, int dr, | |||
595 | void kvm_get_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg); | 595 | void kvm_get_segment(struct kvm_vcpu *vcpu, struct kvm_segment *var, int seg); |
596 | int kvm_load_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector, int seg); | 596 | int kvm_load_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector, int seg); |
597 | 597 | ||
598 | int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason); | 598 | int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason, |
599 | bool has_error_code, u32 error_code); | ||
599 | 600 | ||
600 | void kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0); | 601 | void kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0); |
601 | void kvm_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3); | 602 | void kvm_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3); |
diff --git a/arch/x86/include/asm/svm.h b/arch/x86/include/asm/svm.h index 1d91d05f9368..0e831059ac5a 100644 --- a/arch/x86/include/asm/svm.h +++ b/arch/x86/include/asm/svm.h | |||
@@ -244,6 +244,7 @@ struct __attribute__ ((__packed__)) vmcb { | |||
244 | 244 | ||
245 | #define SVM_EXITINFOSHIFT_TS_REASON_IRET 36 | 245 | #define SVM_EXITINFOSHIFT_TS_REASON_IRET 36 |
246 | #define SVM_EXITINFOSHIFT_TS_REASON_JMP 38 | 246 | #define SVM_EXITINFOSHIFT_TS_REASON_JMP 38 |
247 | #define SVM_EXITINFOSHIFT_TS_HAS_ERROR_CODE 44 | ||
247 | 248 | ||
248 | #define SVM_EXIT_READ_CR0 0x000 | 249 | #define SVM_EXIT_READ_CR0 0x000 |
249 | #define SVM_EXIT_READ_CR3 0x003 | 250 | #define SVM_EXIT_READ_CR3 0x003 |