]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
x86/fpu/xstate: Move remaining xfeature helpers to core
authorThomas Gleixner <tglx@linutronix.de>
Thu, 14 Oct 2021 23:09:40 +0000 (01:09 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 5 May 2022 07:14:16 +0000 (09:14 +0200)
BugLink: https://bugs.launchpad.net/bugs/1967750
Now that everything is mopped up, move all the helpers and prototypes into
the core header. They are not required by the outside.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211014230739.514095101@linutronix.de
(cherry picked from commit d72c87018d00782c3ac0a844c372158087debc0a)
Acked-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
arch/x86/include/asm/fpu/xstate.h
arch/x86/kernel/fpu/xstate.h

index 61ae396bc6e7a68b6c4a2e1ae4c6e39679f28f77..43ae89d4bcd237e7c2b1f7cbaf11bb486b0c5df8 100644 (file)
 #define XFEATURE_MASK_FPSTATE  (XFEATURE_MASK_USER_RESTORE | \
                                 XFEATURE_MASK_SUPERVISOR_SUPPORTED)
 
-static inline u64 xfeatures_mask_supervisor(void)
-{
-       return fpu_kernel_cfg.max_features & XFEATURE_MASK_SUPERVISOR_SUPPORTED;
-}
-
-static inline u64 xfeatures_mask_independent(void)
-{
-       if (!boot_cpu_has(X86_FEATURE_ARCH_LBR))
-               return XFEATURE_MASK_INDEPENDENT & ~XFEATURE_MASK_LBR;
-
-       return XFEATURE_MASK_INDEPENDENT;
-}
-
 extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
 
 extern void __init update_regset_xstate_info(unsigned int size,
index 3d45eb04471b6c112175a01576996ab95219429b..a1aa0bad2c9ca724437af3160004d59f993a045b 100644 (file)
@@ -35,6 +35,19 @@ extern void fpu__init_system_xstate(unsigned int legacy_size);
 
 extern void *get_xsave_addr(struct xregs_state *xsave, int xfeature_nr);
 
+static inline u64 xfeatures_mask_supervisor(void)
+{
+       return fpu_kernel_cfg.max_features & XFEATURE_MASK_SUPERVISOR_SUPPORTED;
+}
+
+static inline u64 xfeatures_mask_independent(void)
+{
+       if (!cpu_feature_enabled(X86_FEATURE_ARCH_LBR))
+               return XFEATURE_MASK_INDEPENDENT & ~XFEATURE_MASK_LBR;
+
+       return XFEATURE_MASK_INDEPENDENT;
+}
+
 /* XSAVE/XRSTOR wrapper functions */
 
 #ifdef CONFIG_X86_64