Commit 97cfab6a authored by Andreas Herrmann's avatar Andreas Herrmann Committed by Ingo Molnar

x86: PAT: fix ambiguous paranoia check in pat_init()

Starting with commit 8d4a4300 (x86:
cleanup PAT cpu validation) the PAT CPU feature flag is not cleared
anymore. Now the error message

  "PAT enabled, but CPU feature cleared"

in pat_init() is misleading.

Furthermore the current code does not check for existence of the PAT
CPU feature flag if a CPU is whitelisted in validate_pat_support.

This patch clears pat_wc_enabled if boot CPU has no PAT feature flag
and adapts the paranoia check.
Signed-off-by: default avatarAndreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent ee863ba7
...@@ -53,6 +53,9 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c) ...@@ -53,6 +53,9 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c)
#ifdef CONFIG_X86_PAT #ifdef CONFIG_X86_PAT
void __cpuinit validate_pat_support(struct cpuinfo_x86 *c) void __cpuinit validate_pat_support(struct cpuinfo_x86 *c)
{ {
if (!cpu_has_pat)
pat_disable("PAT not supported by CPU.");
switch (c->x86_vendor) { switch (c->x86_vendor) {
case X86_VENDOR_INTEL: case X86_VENDOR_INTEL:
if (c->x86 == 0xF || (c->x86 == 6 && c->x86_model >= 15)) if (c->x86 == 0xF || (c->x86 == 6 && c->x86_model >= 15))
...@@ -64,8 +67,6 @@ void __cpuinit validate_pat_support(struct cpuinfo_x86 *c) ...@@ -64,8 +67,6 @@ void __cpuinit validate_pat_support(struct cpuinfo_x86 *c)
return; return;
} }
pat_disable(cpu_has_pat ? pat_disable("PAT disabled. Not yet verified on this CPU type.");
"PAT disabled. Not yet verified on this CPU type." :
"PAT not supported by CPU.");
} }
#endif #endif
...@@ -76,14 +76,15 @@ void pat_init(void) ...@@ -76,14 +76,15 @@ void pat_init(void)
return; return;
/* Paranoia check. */ /* Paranoia check. */
if (!cpu_has_pat) { if (!cpu_has_pat && boot_pat_state) {
printk(KERN_ERR "PAT enabled, but CPU feature cleared\n");
/* /*
* Panic if this happens on the secondary CPU, and we * If this happens we are on a secondary CPU, but
* switched to PAT on the boot CPU. We have no way to * switched to PAT on the boot CPU. We have no way to
* undo PAT. * undo PAT.
*/ */
BUG_ON(boot_pat_state); printk(KERN_ERR "PAT enabled, "
"but not supported by secondary CPU\n");
BUG();
} }
/* Set PWT to Write-Combining. All other bits stay the same */ /* Set PWT to Write-Combining. All other bits stay the same */
......
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