]> git.proxmox.com Git - mirror_ubuntu-eoan-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 16 Mar 2020 11:27:27 +0000 (12:27 +0100)
commit2e223d262489d4a126031520e662b7fe8bbf2c83
treedf855ff498bfaad72f4c7b7b263e0cc0e3e26d5a
parent72d7d3ed552d2917b7edaed7259569f48e90ba72
KVM: x86: Handle TIF_NEED_FPU_LOAD in kvm_{load,put}_guest_fpu()

BugLink: https://bugs.launchpad.net/bugs/1867051
commit c9aef3b85f425d1f6635382ec210ee5a7ef55d7d upstream.

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: 5f409e20b7945 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
arch/x86/kvm/x86.c