aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 9b560325b127..cbca46acfac3 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2249,6 +2249,20 @@ static int handle_apic_access(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2249 return 1; 2249 return 1;
2250} 2250}
2251 2251
2252static int handle_task_switch(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2253{
2254 unsigned long exit_qualification;
2255 u16 tss_selector;
2256 int reason;
2257
2258 exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
2259
2260 reason = (u32)exit_qualification >> 30;
2261 tss_selector = exit_qualification;
2262
2263 return kvm_task_switch(vcpu, tss_selector, reason);
2264}
2265
2252/* 2266/*
2253 * The exit handlers return 1 if the exit was handled fully and guest execution 2267 * The exit handlers return 1 if the exit was handled fully and guest execution
2254 * may resume. Otherwise they set the kvm_run parameter to indicate what needs 2268 * may resume. Otherwise they set the kvm_run parameter to indicate what needs
@@ -2271,6 +2285,7 @@ static int (*kvm_vmx_exit_handlers[])(struct kvm_vcpu *vcpu,
2271 [EXIT_REASON_TPR_BELOW_THRESHOLD] = handle_tpr_below_threshold, 2285 [EXIT_REASON_TPR_BELOW_THRESHOLD] = handle_tpr_below_threshold,
2272 [EXIT_REASON_APIC_ACCESS] = handle_apic_access, 2286 [EXIT_REASON_APIC_ACCESS] = handle_apic_access,
2273 [EXIT_REASON_WBINVD] = handle_wbinvd, 2287 [EXIT_REASON_WBINVD] = handle_wbinvd,
2288 [EXIT_REASON_TASK_SWITCH] = handle_task_switch,
2274}; 2289};
2275 2290
2276static const int kvm_vmx_max_exit_handlers = 2291static const int kvm_vmx_max_exit_handlers =