android_kernel_google_msm/arch/x86
Suresh Siddha b10e02daa7 x86, kvm: fix kvm's usage of kernel_fpu_begin/end()
commit b1a74bf821 upstream.

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>
Signed-off-by: Zefan Li <lizefan@huawei.com>
[xr: Backported to 3.4: Adjust context]
Signed-off-by: Rui Xiang <rui.xiang@huawei.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-09-18 09:20:46 +08:00
..
boot x86, build: Pass in additional -mno-mmx, -mno-sse options 2014-06-07 16:02:08 -07:00
configs
crypto crypto: aesni - fix memory usage in GCM decryption 2015-06-19 11:40:28 +08:00
ia32
include/asm x86, kvm: fix kvm's usage of kernel_fpu_begin/end() 2015-09-18 09:20:46 +08:00
kernel x86, kvm: fix kvm's usage of kernel_fpu_begin/end() 2015-09-18 09:20:46 +08:00
kvm x86, kvm: fix kvm's usage of kernel_fpu_begin/end() 2015-09-18 09:20:46 +08:00
lguest x86, mm: Patch out arch_flush_lazy_mmu_mode() when running on bare metal 2013-04-16 21:27:27 -07:00
lib x86-64: Fix the failure case in copy_user_handle_tail() 2013-03-28 12:12:26 -07:00
math-emu
mm x86, mm/ASLR: Fix stack randomization on 64-bit systems 2015-04-14 17:33:58 +08:00
net x86: bpf_jit: fix compilation of large bpf programs 2015-09-18 09:20:42 +08:00
oprofile
pci xen/pci: We don't do multiple MSI's. 2013-03-14 11:29:41 -07:00
platform x86/efi: Fix dummy variable buffer allocation 2014-06-07 16:02:10 -07:00
power perf,x86: fix kernel crash with PEBS/BTS after suspend/resume 2013-03-20 13:04:59 -07:00
syscalls x86, x32: Use compat shims for io_{setup,submit} 2014-06-30 20:01:33 -07:00
tools
um x86, um: actually mark system call tables readonly 2015-04-14 17:33:49 +08:00
vdso x86/vdso: Fix the build on GCC5 2015-06-19 11:40:25 +08:00
video
xen xen/smp/spinlock: Fix leakage of the spinlock interrupt line for every CPU online/offline 2014-03-11 16:10:06 -07:00
.gitignore
Kbuild
Kconfig config: Enable NEED_DMA_MAP_STATE by default when SWIOTLB is selected 2015-06-19 11:40:34 +08:00
Kconfig.cpu
Kconfig.debug
Makefile
Makefile.um
Makefile_32.cpu