aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthoine Bourgeois <bourgeois@bertin.fr>2013-11-13 05:45:37 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2013-11-13 12:46:54 -0500
commite504c9098ed6acd9e1079c5e10e4910724ad429f (patch)
tree57f2107cf25e8fb660042616fdd9022a52359855
parentede582224231e64e41af0f89117a302580a2da2e (diff)
kvm, vmx: Fix lazy FPU on nested guest
If a nested guest does a NM fault but its CR0 doesn't contain the TS flag (because it was already cleared by the guest with L1 aid) then we have to activate FPU ourselves in L0 and then continue to L2. If TS flag is set then we fallback on the previous behavior, forward the fault to L1 if it asked for. Signed-off-by: Anthoine Bourgeois <bourgeois@bertin.fr> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/vmx.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index e293a62a11d6..b2fe1c252f35 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -6643,6 +6643,9 @@ static bool nested_vmx_exit_handled(struct kvm_vcpu *vcpu)
6643 return 0; 6643 return 0;
6644 else if (is_page_fault(intr_info)) 6644 else if (is_page_fault(intr_info))
6645 return enable_ept; 6645 return enable_ept;
6646 else if (is_no_device(intr_info) &&
6647 !(nested_read_cr0(vmcs12) & X86_CR0_TS))
6648 return 0;
6646 return vmcs12->exception_bitmap & 6649 return vmcs12->exception_bitmap &
6647 (1u << (intr_info & INTR_INFO_VECTOR_MASK)); 6650 (1u << (intr_info & INTR_INFO_VECTOR_MASK));
6648 case EXIT_REASON_EXTERNAL_INTERRUPT: 6651 case EXIT_REASON_EXTERNAL_INTERRUPT: