]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Further fixes for lazy FPU loading
authorNadav Har'El <nyh@il.ibm.com>
Wed, 25 May 2011 20:15:08 +0000 (23:15 +0300)
committerAvi Kivity <avi@redhat.com>
Tue, 12 Jul 2011 08:45:18 +0000 (11:45 +0300)
commit85a04f988e372e493385aa5960887ad528cd9b3e
treee6c5514da59a7095385c6e7a961d3651a8a6fdb4
parent3af74aa38f9cd276f825c14d1557ae95033344de
KVM: nVMX: Further fixes for lazy FPU loading

KVM's "Lazy FPU loading" means that sometimes L0 needs to set CR0.TS, even
if a guest didn't set it. Moreover, L0 must also trap CR0.TS changes and
NM exceptions, even if we have a guest hypervisor (L1) who didn't want these
traps. And of course, conversely: If L1 wanted to trap these events, we
must let it, even if L0 is not interested in them.

This patch fixes some existing KVM code (in update_exception_bitmap(),
vmx_fpu_activate(), vmx_fpu_deactivate()) to do the correct merging of L0's
and L1's needs. Note that handle_cr() was already fixed in the above patch,
and that new code in introduced in previous patches already handles CR0
correctly (see prepare_vmcs02(), prepare_vmcs12(), and nested_vmx_vmexit()).

Signed-off-by: Nadav Har'El <nyh@il.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/x86/kvm/vmx.c