Commit 32d4d9cc authored by Ingo Molnar's avatar Ingo Molnar

x86/fpu: Improve FPU detection kernel messages

Standardize the various boot time messages printed during FPU detection:

 - Use a common 'x86/fpu: ' prefix for consistency and to make it easy
   to grep boot logs for FPU related messages

 - Correct speling errors

 - Add printout for the legacy FPU case as well

 - Clarify messages
Reviewed-by: default avatarBorislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 7b302e67
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
* *
* Author: Suresh Siddha <suresh.b.siddha@intel.com> * Author: Suresh Siddha <suresh.b.siddha@intel.com>
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/cpu.h> #include <linux/cpu.h>
...@@ -615,7 +612,7 @@ static void /* __init */ xstate_enable_boot_cpu(void) ...@@ -615,7 +612,7 @@ static void /* __init */ xstate_enable_boot_cpu(void)
unsigned int eax, ebx, ecx, edx; unsigned int eax, ebx, ecx, edx;
if (boot_cpu_data.cpuid_level < XSTATE_CPUID) { if (boot_cpu_data.cpuid_level < XSTATE_CPUID) {
WARN(1, KERN_ERR "XSTATE_CPUID missing\n"); WARN(1, "x86/fpu: XSTATE_CPUID missing!\n");
return; return;
} }
...@@ -623,8 +620,7 @@ static void /* __init */ xstate_enable_boot_cpu(void) ...@@ -623,8 +620,7 @@ static void /* __init */ xstate_enable_boot_cpu(void)
pcntxt_mask = eax + ((u64)edx << 32); pcntxt_mask = eax + ((u64)edx << 32);
if ((pcntxt_mask & XSTATE_FPSSE) != XSTATE_FPSSE) { if ((pcntxt_mask & XSTATE_FPSSE) != XSTATE_FPSSE) {
pr_err("FP/SSE not shown under xsave features 0x%llx\n", pr_err("x86/fpu: FP/SSE not present amongst the CPU's xstate features: 0x%llx.\n", pcntxt_mask);
pcntxt_mask);
BUG(); BUG();
} }
...@@ -650,7 +646,7 @@ static void /* __init */ xstate_enable_boot_cpu(void) ...@@ -650,7 +646,7 @@ static void /* __init */ xstate_enable_boot_cpu(void)
if (pcntxt_mask & XSTATE_EAGER) { if (pcntxt_mask & XSTATE_EAGER) {
if (eagerfpu == DISABLE) { if (eagerfpu == DISABLE) {
pr_err("eagerfpu not present, disabling some xstate features: 0x%llx\n", pr_err("x86/fpu: eagerfpu switching disabled, disabling the following xstate features: 0x%llx.\n",
pcntxt_mask & XSTATE_EAGER); pcntxt_mask & XSTATE_EAGER);
pcntxt_mask &= ~XSTATE_EAGER; pcntxt_mask &= ~XSTATE_EAGER;
} else { } else {
...@@ -658,9 +654,10 @@ static void /* __init */ xstate_enable_boot_cpu(void) ...@@ -658,9 +654,10 @@ static void /* __init */ xstate_enable_boot_cpu(void)
} }
} }
pr_info("enabled xstate_bv 0x%llx, cntxt size 0x%x using %s\n", pr_info("x86/fpu: Enabled xstate features 0x%llx, context size is 0x%x bytes, using '%s' format.\n",
pcntxt_mask, xstate_size, pcntxt_mask,
cpu_has_xsaves ? "compacted form" : "standard form"); xstate_size,
cpu_has_xsaves ? "compacted" : "standard");
} }
/* /*
...@@ -671,8 +668,13 @@ void xsave_init(void) ...@@ -671,8 +668,13 @@ void xsave_init(void)
{ {
static char on_boot_cpu = 1; static char on_boot_cpu = 1;
if (!cpu_has_xsave) if (!cpu_has_xsave) {
if (on_boot_cpu) {
on_boot_cpu = 0;
pr_info("x86/fpu: Legacy x87 FPU detected.\n");
}
return; return;
}
if (on_boot_cpu) { if (on_boot_cpu) {
on_boot_cpu = 0; on_boot_cpu = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment