]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Handle TIF_NEED_FPU_LOAD in kvm_{load,put}_guest_fpu()
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 17 Jan 2020 19:30:49 +0000 (11:30 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 27 Jan 2020 18:59:46 +0000 (19:59 +0100)
commit52369bd0186f29221f3d6ef6a9ba3bb375ad1f6d
tree0c9d69660d52db94d2f1bd95b41de007ee454e6b
parentd70a4b05ee80d05cf8ffdda2a1d1ca7fe7e7f30f
KVM: x86: Handle TIF_NEED_FPU_LOAD in kvm_{load,put}_guest_fpu()

Handle TIF_NEED_FPU_LOAD similar to how fpu__copy() handles the flag
when duplicating FPU state to a new task struct.  TIF_NEED_FPU_LOAD can
be set any time control is transferred out of KVM, be it voluntarily,
e.g. if I/O is triggered during a KVM call to get_user_pages, or
involuntarily, e.g. if softirq runs after an IRQ occurs.  Therefore,
KVM must account for TIF_NEED_FPU_LOAD whenever it is (potentially)
accessing CPU FPU state.

Fixes: 24ce6b4ea4ff2 ("x86/fpu: Defer FPU state load until return to userspace")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c