linux-stable/arch/x86/kernel/fpu
Thomas Gleixner 8a1dc55a3f x86/cpu: Sanitize X86_FEATURE_OSPKE
X86_FEATURE_OSPKE is enabled first on the boot CPU and the feature flag is
set. Secondary CPUs have to enable CR4.PKE as well and set their per CPU
feature flag. That's ineffective because all call sites have checks for
boot_cpu_data.

Make it smarter and force the feature flag when PKU is enabled on the boot
cpu which allows then to use cpu_feature_enabled(X86_FEATURE_OSPKE) all
over the place. That either compiles the code out when PKEY support is
disabled in Kconfig or uses a static_cpu_has() for the feature check which
makes a significant difference in hotpaths, e.g. context switch.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210623121455.305113644@linutronix.de
2021-06-23 18:59:44 +02:00
..
bugs.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
core.c x86/cpu: Sanitize X86_FEATURE_OSPKE 2021-06-23 18:59:44 +02:00
init.c x86/fpu: Get rid of fpu__get_supported_xfeatures_mask() 2021-06-23 17:49:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
regset.c x86/fpu: Rename and sanitize fpu__save/copy() 2021-06-23 18:55:56 +02:00
signal.c x86/fpu: Rename xstate copy functions which are related to UABI 2021-06-23 18:23:14 +02:00
xstate.c x86/cpu: Sanitize X86_FEATURE_OSPKE 2021-06-23 18:59:44 +02:00