From 9a89b02918c03d91e685d06e49a652da5f35befc Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Thu, 23 Apr 2015 11:26:08 +0200 Subject: [PATCH] x86/fpu: Print out whether we are doing lazy/eager FPU context switches Ever since the kernel started defaulting to eager FPU switches on modern Intel CPUs it's not been obvious whether a given system is using the lazy or the eager FPU context switching logic. So generate a boot message about which mode the FPU code is in: x86/fpu: Using 'lazy' FPU context switches. or: x86/fpu: Using 'eager' FPU context switches. Reviewed-by: Borislav Petkov Cc: Andy Lutomirski Cc: Dave Hansen Cc: Fenghua Yu Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Thomas Gleixner Signed-off-by: Ingo Molnar --- arch/x86/kernel/fpu/xsave.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/fpu/xsave.c b/arch/x86/kernel/fpu/xsave.c index a52205b87acb..61696c5005eb 100644 --- a/arch/x86/kernel/fpu/xsave.c +++ b/arch/x86/kernel/fpu/xsave.c @@ -691,6 +691,8 @@ void __init_refok eager_fpu_init(void) if (eagerfpu == ENABLE) setup_force_cpu_cap(X86_FEATURE_EAGER_FPU); + printk_once(KERN_INFO "x86/fpu: Using '%s' FPU context switches.\n", eagerfpu == ENABLE ? "eager" : "lazy"); + if (!cpu_has_eager_fpu) { stts(); return; -- 2.20.1