diff options
author | Izik Eidus <izike@qumranet.com> | 2008-03-24 17:14:53 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-04-27 05:00:39 -0400 |
commit | 37817f2982d0f559f90cecc66e150dd9d2c2df05 (patch) | |
tree | 45114b5720d7a13bdbe48cc6a75dc6de03d6fcd2 /include | |
parent | 2e4d2653497856b102c90153f970c9e344ba96c6 (diff) |
KVM: x86: hardware task switching support
This emulates the x86 hardware task switch mechanism in software, as it is
unsupported by either vmx or svm. It allows operating systems which use it,
like freedos, to run as kvm guests.
Signed-off-by: Izik Eidus <izike@qumranet.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86/kvm_host.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h index 93e809c251ef..7b28cf949d55 100644 --- a/include/asm-x86/kvm_host.h +++ b/include/asm-x86/kvm_host.h | |||
@@ -492,6 +492,8 @@ int emulator_get_dr(struct x86_emulate_ctxt *ctxt, int dr, | |||
492 | int emulator_set_dr(struct x86_emulate_ctxt *ctxt, int dr, | 492 | int emulator_set_dr(struct x86_emulate_ctxt *ctxt, int dr, |
493 | unsigned long value); | 493 | unsigned long value); |
494 | 494 | ||
495 | int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason); | ||
496 | |||
495 | void kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0); | 497 | void kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0); |
496 | void kvm_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr0); | 498 | void kvm_set_cr3(struct kvm_vcpu *vcpu, unsigned long cr0); |
497 | void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr0); | 499 | void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr0); |
@@ -657,4 +659,11 @@ static inline void kvm_inject_gp(struct kvm_vcpu *vcpu, u32 error_code) | |||
657 | #define RMODE_TSS_SIZE \ | 659 | #define RMODE_TSS_SIZE \ |
658 | (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1) | 660 | (TSS_BASE_SIZE + TSS_REDIRECTION_SIZE + TSS_IOPB_SIZE + 1) |
659 | 661 | ||
662 | enum { | ||
663 | TASK_SWITCH_CALL = 0, | ||
664 | TASK_SWITCH_IRET = 1, | ||
665 | TASK_SWITCH_JMP = 2, | ||
666 | TASK_SWITCH_GATE = 3, | ||
667 | }; | ||
668 | |||
660 | #endif | 669 | #endif |