android_kernel_motorola_sm6225/arch/x86/kvm
Suresh Siddha b1a74bf821 x86, kvm: fix kvm's usage of kernel_fpu_begin/end()
Preemption is disabled between kernel_fpu_begin/end() and as such
it is not a good idea to use these routines in kvm_load/put_guest_fpu()
which can be very far apart.

kvm_load/put_guest_fpu() routines are already called with
preemption disabled and KVM already uses the preempt notifier to save
the guest fpu state using kvm_put_guest_fpu().

So introduce __kernel_fpu_begin/end() routines which don't touch
preemption and use them instead of kernel_fpu_begin/end()
for KVM's use model of saving/restoring guest FPU state.

Also with this change (and with eagerFPU model), fix the host cr0.TS vm-exit
state in the case of VMX. For eagerFPU case, host cr0.TS is always clear.
So no need to worry about it. For the traditional lazyFPU restore case,
change the cr0.TS bit for the host state during vm-exit to be always clear
and cr0.TS bit is set in the __vmx_load_host_state() when the FPU
(guest FPU or the host task's FPU) state is not active. This ensures
that the host/guest FPU state is properly saved, restored
during context-switch and with interrupts (using irq_fpu_usable()) not
stomping on the active FPU state.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Link: http://lkml.kernel.org/r/1348164109.26695.338.camel@sbsiddha-desk.sc.intel.com
Cc: Avi Kivity <avi@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2012-09-21 16:59:04 -07:00
..
cpuid.c KVM: VMX: Implement PCID/INVPCID for guests with EPT 2012-07-12 13:07:34 +03:00
cpuid.h KVM: VMX: Implement PCID/INVPCID for guests with EPT 2012-07-12 13:07:34 +03:00
emulate.c KVM: x86 emulator: use stack size attribute to mask rsp in stack ops 2012-08-22 18:54:26 -03:00
i8254.c KVM: x86: Run PIT work in own kthread 2012-04-27 19:40:29 -03:00
i8254.h KVM: x86: Run PIT work in own kthread 2012-04-27 19:40:29 -03:00
i8259.c KVM: PIC: call ack notifiers for irqs that are dropped form irr 2012-07-26 12:19:06 +03:00
irq.c KVM: fix typo in copyright notice 2010-10-24 10:53:14 +02:00
irq.h KVM: Intelligent device lookup on I/O bus 2011-09-25 19:17:59 +03:00
Kconfig KVM: Introduce direct MSI message injection for in-kernel irqchips 2012-04-24 15:59:47 +03:00
kvm_cache_regs.h KVM: MMU: Do not unconditionally read PDPTE from guest memory 2011-09-25 19:18:01 +03:00
kvm_timer.h KVM: emulate lapic tsc deadline timer for guest 2011-10-05 15:34:56 +02:00
lapic.c KVM: host side for eoi optimization 2012-06-25 12:40:55 +03:00
lapic.h KVM: host side for eoi optimization 2012-06-25 12:40:55 +03:00
Makefile KVM: Expose a version 2 architectural PMU to a guests 2011-12-27 11:24:29 +02:00
mmu.c KVM: MMU: Fix mmu_shrink() so that it can free mmu pages as intended 2012-08-22 15:27:13 +03:00
mmu.h KVM: MMU: mmio page fault support 2011-07-24 11:50:40 +03:00
mmu_audit.c KVM: MMU: Improve iteration through sptes from rmap 2012-04-08 16:08:27 +03:00
mmutrace.h KVM: MMU: fix kvm_mmu_pagetable_walk tracepoint 2012-07-11 16:51:22 +03:00
paging_tmpl.h KVM: MMU: fix kvm_mmu_pagetable_walk tracepoint 2012-07-11 16:51:22 +03:00
pmu.c perf/x86: Rename Intel specific macros 2012-07-05 21:19:39 +02:00
svm.c KVM: VMX: Implement PCID/INVPCID for guests with EPT 2012-07-12 13:07:34 +03:00
timer.c KVM: x86: Simplify kvm timer handler 2011-12-27 11:17:05 +02:00
trace.h KVM updates for the 3.6 merge window 2012-07-24 12:01:20 -07:00
tss.h
vmx.c x86, kvm: fix kvm's usage of kernel_fpu_begin/end() 2012-09-21 16:59:04 -07:00
x86.c x86, kvm: fix kvm's usage of kernel_fpu_begin/end() 2012-09-21 16:59:04 -07:00
x86.h KVM: x86: add paging gcc optimization 2012-04-08 14:03:13 +03:00