Commit 95ed636d authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] make cpu serial number disable generic

This check needs to happen for all CPUs that support PN,
not just Intel.

From hpa and Pat Mochel.
parent e06f21ae
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
static int cachesize_override __initdata = -1; static int cachesize_override __initdata = -1;
static int disable_x86_fxsr __initdata = 0; static int disable_x86_fxsr __initdata = 0;
static int disable_x86_serial_nr __initdata = 1;
struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {}; struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
...@@ -249,6 +250,31 @@ void __init generic_identify(struct cpuinfo_x86 * c) ...@@ -249,6 +250,31 @@ void __init generic_identify(struct cpuinfo_x86 * c)
} }
} }
static void __init squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
{
if (cpu_has(c, X86_FEATURE_PN) && disable_x86_serial_nr ) {
/* Disable processor serial number */
unsigned long lo,hi;
rdmsr(MSR_IA32_BBL_CR_CTL,lo,hi);
lo |= 0x200000;
wrmsr(MSR_IA32_BBL_CR_CTL,lo,hi);
printk(KERN_NOTICE "CPU serial number disabled.\n");
clear_bit(X86_FEATURE_PN, c->x86_capability);
/* Disabling the serial number may affect the cpuid level */
c->cpuid_level = cpuid_eax(0);
}
}
static int __init x86_serial_nr_setup(char *s)
{
disable_x86_serial_nr = 0;
return 1;
}
__setup("serialnumber", x86_serial_nr_setup);
/* /*
* This does the hard work of actually picking apart the CPU stuff... * This does the hard work of actually picking apart the CPU stuff...
*/ */
...@@ -298,6 +324,9 @@ void __init identify_cpu(struct cpuinfo_x86 *c) ...@@ -298,6 +324,9 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
if (this_cpu->c_init) if (this_cpu->c_init)
this_cpu->c_init(c); this_cpu->c_init(c);
/* Disable the PN if appropriate */
squash_the_stupid_serial_number(c);
printk(KERN_DEBUG "CPU: After vendor init, caps: %08lx %08lx %08lx %08lx\n", printk(KERN_DEBUG "CPU: After vendor init, caps: %08lx %08lx %08lx %08lx\n",
c->x86_capability[0], c->x86_capability[0],
c->x86_capability[1], c->x86_capability[1],
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "cpu.h" #include "cpu.h"
static int disable_x86_serial_nr __initdata = 1;
static int disable_P4_HT __initdata = 0; static int disable_P4_HT __initdata = 0;
extern int trap_init_f00f_bug(void); extern int trap_init_f00f_bug(void);
...@@ -69,29 +68,6 @@ int __init ppro_with_ram_bug(void) ...@@ -69,29 +68,6 @@ int __init ppro_with_ram_bug(void)
return 0; return 0;
} }
static void __init squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
{
if (cpu_has(c, X86_FEATURE_PN) && disable_x86_serial_nr ) {
/* Disable processor serial number */
unsigned long lo,hi;
rdmsr(MSR_IA32_BBL_CR_CTL,lo,hi);
lo |= 0x200000;
wrmsr(MSR_IA32_BBL_CR_CTL,lo,hi);
printk(KERN_NOTICE "CPU serial number disabled.\n");
clear_bit(X86_FEATURE_PN, c->x86_capability);
/* Disabling the serial number may affect the cpuid level */
c->cpuid_level = cpuid_eax(0);
}
}
static int __init x86_serial_nr_setup(char *s)
{
disable_x86_serial_nr = 0;
return 1;
}
__setup("serialnumber", x86_serial_nr_setup);
static int __init P4_disable_ht(char *s) static int __init P4_disable_ht(char *s)
{ {
disable_P4_HT = 1; disable_P4_HT = 1;
...@@ -352,9 +328,6 @@ static void __init init_intel(struct cpuinfo_x86 *c) ...@@ -352,9 +328,6 @@ static void __init init_intel(struct cpuinfo_x86 *c)
clear_bit(X86_FEATURE_HT, c->x86_capability); clear_bit(X86_FEATURE_HT, c->x86_capability);
#endif #endif
/* Disable the PN if appropriate */
squash_the_stupid_serial_number(c);
/* Work around errata */ /* Work around errata */
Intel_errata_workarounds(c); Intel_errata_workarounds(c);
......
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