summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/fpu/internal.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2021-10-15 03:16:21 +0200
committerBorislav Petkov <bp@suse.de>2021-10-20 15:27:27 +0200
commitd06241f52cfe4a0580856ef2cfac90dc7f752cae (patch)
tree06be585119a29661bf4761507e1f1bab46cd98a3 /arch/x86/kernel/fpu/internal.h
parent63e81807c1f94e91b9d71c536112a40cd74bab85 (diff)
x86/fpu: Clean up CPU feature tests
Further disintegration of internal.h: Move the CPU feature tests to a core header and remove the unused one. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Borislav Petkov <bp@suse.de> Link: https://lkml.kernel.org/r/20211015011539.401510559@linutronix.de
Diffstat (limited to 'arch/x86/kernel/fpu/internal.h')
-rw-r--r--arch/x86/kernel/fpu/internal.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/x86/kernel/fpu/internal.h b/arch/x86/kernel/fpu/internal.h
index 036f84c236dd..a8aac21ba364 100644
--- a/arch/x86/kernel/fpu/internal.h
+++ b/arch/x86/kernel/fpu/internal.h
@@ -2,6 +2,17 @@
#ifndef __X86_KERNEL_FPU_INTERNAL_H
#define __X86_KERNEL_FPU_INTERNAL_H
+/* CPU feature check wrappers */
+static __always_inline __pure bool use_xsave(void)
+{
+ return cpu_feature_enabled(X86_FEATURE_XSAVE);
+}
+
+static __always_inline __pure bool use_fxsr(void)
+{
+ return cpu_feature_enabled(X86_FEATURE_FXSR);
+}
+
/* Init functions */
extern void fpu__init_prepare_fx_sw_frame(void);