]> git.baikalelectronics.ru Git - kernel.git/commit
x86/fpu: Replace KVMs home brewed FPU copy from user
authorThomas Gleixner <tglx@linutronix.de>
Fri, 15 Oct 2021 01:16:13 +0000 (03:16 +0200)
committerBorislav Petkov <bp@suse.de>
Wed, 20 Oct 2021 13:27:27 +0000 (15:27 +0200)
commit7a72b6880c2e98e1427771cdd43f7e467b88a47e
tree75e04b4e5cc558fa5ca7de6ce69ea31d05c4c0a9
parent1086bf49dca6006e483dc4a6c9a660016574a107
x86/fpu: Replace KVMs home brewed FPU copy from user

Copying a user space buffer to the memory buffer is already available in
the FPU core. The copy mechanism in KVM lacks sanity checks and needs to
use cpuid() to lookup the offset of each component, while the FPU core has
this information cached.

Make the FPU core variant accessible for KVM and replace the home brewed
mechanism.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: kvm@vger.kernel.org
Link: https://lkml.kernel.org/r/20211015011539.134065207@linutronix.de
arch/x86/include/asm/fpu/api.h
arch/x86/kernel/fpu/core.c
arch/x86/kernel/fpu/xstate.c
arch/x86/kvm/x86.c