aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/kernel/fpu/xstate.c
diff options
context:
space:
mode:
authorIngo Molnar <[email protected]>2015-04-28 09:17:26 +0200
committerIngo Molnar <[email protected]>2015-05-19 15:47:55 +0200
commit33588b52228f6e94e970a05ead10f524f363ee44 (patch)
tree1385bc7c51390303441ff6dad18fca970b8660c0 /arch/x86/kernel/fpu/xstate.c
parent5b07343034ec9ebb0d443743c7381b25875d0067 (diff)
x86/fpu: Simplify print_xstate_features()
We do a boot time printout of xfeatures in print_xstate_features(), simplify this code to make use of the recently introduced cpu_has_xfeature() method. Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'arch/x86/kernel/fpu/xstate.c')
-rw-r--r--arch/x86/kernel/fpu/xstate.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 2e52f01f4931..0f849229c93b 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -545,13 +545,12 @@ static void __init setup_xstate_features(void)
} while (1);
}
-static void print_xstate_feature(u64 xstate_mask, const char *desc)
+static void print_xstate_feature(u64 xstate_mask)
{
- if (xfeatures_mask & xstate_mask) {
- int xstate_feature = fls64(xstate_mask)-1;
+ const char *feature_name;
- pr_info("x86/fpu: Supporting XSAVE feature %2d: '%s'\n", xstate_feature, desc);
- }
+ if (cpu_has_xfeatures(xstate_mask, &feature_name))
+ pr_info("x86/fpu: Supporting XSAVE feature 0x%02Lx: '%s'\n", xstate_mask, feature_name);
}
/*
@@ -559,14 +558,14 @@ static void print_xstate_feature(u64 xstate_mask, const char *desc)
*/
static void print_xstate_features(void)
{
- print_xstate_feature(XSTATE_FP, "x87 floating point registers");
- print_xstate_feature(XSTATE_SSE, "SSE registers");
- print_xstate_feature(XSTATE_YMM, "AVX registers");
- print_xstate_feature(XSTATE_BNDREGS, "MPX bounds registers");
- print_xstate_feature(XSTATE_BNDCSR, "MPX CSR");
- print_xstate_feature(XSTATE_OPMASK, "AVX-512 opmask");
- print_xstate_feature(XSTATE_ZMM_Hi256, "AVX-512 Hi256");
- print_xstate_feature(XSTATE_Hi16_ZMM, "AVX-512 ZMM_Hi256");
+ print_xstate_feature(XSTATE_FP);
+ print_xstate_feature(XSTATE_SSE);
+ print_xstate_feature(XSTATE_YMM);
+ print_xstate_feature(XSTATE_BNDREGS);
+ print_xstate_feature(XSTATE_BNDCSR);
+ print_xstate_feature(XSTATE_OPMASK);
+ print_xstate_feature(XSTATE_ZMM_Hi256);
+ print_xstate_feature(XSTATE_Hi16_ZMM);
}
/*