diff options
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index b1eb202ee76a..851aa7c3b890 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -1493,8 +1493,12 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx) | |||
1493 | #ifdef CONFIG_X86_64 | 1493 | #ifdef CONFIG_X86_64 |
1494 | wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base); | 1494 | wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base); |
1495 | #endif | 1495 | #endif |
1496 | if (user_has_fpu()) | 1496 | /* |
1497 | clts(); | 1497 | * If the FPU is not active (through the host task or |
1498 | * the guest vcpu), then restore the cr0.TS bit. | ||
1499 | */ | ||
1500 | if (!user_has_fpu() && !vmx->vcpu.guest_fpu_loaded) | ||
1501 | stts(); | ||
1498 | load_gdt(&__get_cpu_var(host_gdt)); | 1502 | load_gdt(&__get_cpu_var(host_gdt)); |
1499 | } | 1503 | } |
1500 | 1504 | ||
@@ -3743,7 +3747,7 @@ static void vmx_set_constant_host_state(void) | |||
3743 | unsigned long tmpl; | 3747 | unsigned long tmpl; |
3744 | struct desc_ptr dt; | 3748 | struct desc_ptr dt; |
3745 | 3749 | ||
3746 | vmcs_writel(HOST_CR0, read_cr0() | X86_CR0_TS); /* 22.2.3 */ | 3750 | vmcs_writel(HOST_CR0, read_cr0() & ~X86_CR0_TS); /* 22.2.3 */ |
3747 | vmcs_writel(HOST_CR4, read_cr4()); /* 22.2.3, 22.2.5 */ | 3751 | vmcs_writel(HOST_CR4, read_cr4()); /* 22.2.3, 22.2.5 */ |
3748 | vmcs_writel(HOST_CR3, read_cr3()); /* 22.2.3 FIXME: shadow tables */ | 3752 | vmcs_writel(HOST_CR3, read_cr3()); /* 22.2.3 FIXME: shadow tables */ |
3749 | 3753 | ||
@@ -4543,7 +4547,7 @@ static int handle_cr(struct kvm_vcpu *vcpu) | |||
4543 | vcpu->run->exit_reason = KVM_EXIT_SET_TPR; | 4547 | vcpu->run->exit_reason = KVM_EXIT_SET_TPR; |
4544 | return 0; | 4548 | return 0; |
4545 | } | 4549 | } |
4546 | }; | 4550 | } |
4547 | break; | 4551 | break; |
4548 | case 2: /* clts */ | 4552 | case 2: /* clts */ |
4549 | handle_clts(vcpu); | 4553 | handle_clts(vcpu); |