aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2008-01-30 07:33:20 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:33:20 -0500
commit135302577bb964ebf23376e2d991405ef4ff0457 (patch)
treea6343812dabd617356ff13b3e51444e3c5e9ac47 /arch
parent7d851c8d3db0f79b92c8b14361779ede8acd2488 (diff)
x86: convert some existing cpuid disable options to new generic bitmap
This convers nofxsr, mem=nopentium and nosep to use the new generic cpuid disable bitmap instead of using own variables. Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/cpu/common.c34
-rw-r--r--arch/x86/kernel/setup_32.c5
2 files changed, 5 insertions, 34 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index f0f29ddf33a2..5f9c8e3a3e0f 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -60,14 +60,10 @@ EXPORT_PER_CPU_SYMBOL_GPL(gdt_page);
60__u32 cleared_cpu_caps[NCAPINTS] __cpuinitdata; 60__u32 cleared_cpu_caps[NCAPINTS] __cpuinitdata;
61 61
62static int cachesize_override __cpuinitdata = -1; 62static int cachesize_override __cpuinitdata = -1;
63static int disable_x86_fxsr __cpuinitdata;
64static int disable_x86_serial_nr __cpuinitdata = 1; 63static int disable_x86_serial_nr __cpuinitdata = 1;
65static int disable_x86_sep __cpuinitdata;
66 64
67struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {}; 65struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
68 66
69extern int disable_pse;
70
71static void __cpuinit default_init(struct cpuinfo_x86 * c) 67static void __cpuinit default_init(struct cpuinfo_x86 * c)
72{ 68{
73 /* Not much we can do here... */ 69 /* Not much we can do here... */
@@ -216,16 +212,8 @@ static void __cpuinit get_cpu_vendor(struct cpuinfo_x86 *c, int early)
216 212
217static int __init x86_fxsr_setup(char * s) 213static int __init x86_fxsr_setup(char * s)
218{ 214{
219 /* Tell all the other CPUs to not use it... */ 215 setup_clear_cpu_cap(X86_FEATURE_FXSR);
220 disable_x86_fxsr = 1; 216 setup_clear_cpu_cap(X86_FEATURE_XMM);
221
222 /*
223 * ... and clear the bits early in the boot_cpu_data
224 * so that the bootup process doesn't try to do this
225 * either.
226 */
227 clear_bit(X86_FEATURE_FXSR, boot_cpu_data.x86_capability);
228 clear_bit(X86_FEATURE_XMM, boot_cpu_data.x86_capability);
229 return 1; 217 return 1;
230} 218}
231__setup("nofxsr", x86_fxsr_setup); 219__setup("nofxsr", x86_fxsr_setup);
@@ -233,7 +221,7 @@ __setup("nofxsr", x86_fxsr_setup);
233 221
234static int __init x86_sep_setup(char * s) 222static int __init x86_sep_setup(char * s)
235{ 223{
236 disable_x86_sep = 1; 224 setup_clear_cpu_cap(X86_FEATURE_SEP);
237 return 1; 225 return 1;
238} 226}
239__setup("nosep", x86_sep_setup); 227__setup("nosep", x86_sep_setup);
@@ -462,19 +450,6 @@ void __cpuinit identify_cpu(struct cpuinfo_x86 *c)
462 if ( tsc_disable ) 450 if ( tsc_disable )
463 clear_bit(X86_FEATURE_TSC, c->x86_capability); 451 clear_bit(X86_FEATURE_TSC, c->x86_capability);
464 452
465 /* FXSR disabled? */
466 if (disable_x86_fxsr) {
467 clear_bit(X86_FEATURE_FXSR, c->x86_capability);
468 clear_bit(X86_FEATURE_XMM, c->x86_capability);
469 }
470
471 /* SEP disabled? */
472 if (disable_x86_sep)
473 clear_bit(X86_FEATURE_SEP, c->x86_capability);
474
475 if (disable_pse)
476 clear_bit(X86_FEATURE_PSE, c->x86_capability);
477
478 /* If the model name is still unset, do table lookup. */ 453 /* If the model name is still unset, do table lookup. */
479 if ( !c->x86_model_id[0] ) { 454 if ( !c->x86_model_id[0] ) {
480 char *p; 455 char *p;
@@ -629,8 +604,7 @@ void __init early_cpu_init(void)
629 /* pse is not compatible with on-the-fly unmapping, 604 /* pse is not compatible with on-the-fly unmapping,
630 * disable it even if the cpus claim to support it. 605 * disable it even if the cpus claim to support it.
631 */ 606 */
632 clear_bit(X86_FEATURE_PSE, boot_cpu_data.x86_capability); 607 setup_clear_cpu_cap(X86_FEATURE_PSE);
633 disable_pse = 1;
634#endif 608#endif
635} 609}
636 610
diff --git a/arch/x86/kernel/setup_32.c b/arch/x86/kernel/setup_32.c
index 6802a383077d..26a56f714d34 100644
--- a/arch/x86/kernel/setup_32.c
+++ b/arch/x86/kernel/setup_32.c
@@ -68,8 +68,6 @@
68 address, and must not be in the .bss segment! */ 68 address, and must not be in the .bss segment! */
69unsigned long init_pg_tables_end __initdata = ~0UL; 69unsigned long init_pg_tables_end __initdata = ~0UL;
70 70
71int disable_pse __cpuinitdata = 0;
72
73/* 71/*
74 * Machine setup.. 72 * Machine setup..
75 */ 73 */
@@ -242,8 +240,7 @@ static int __init parse_mem(char *arg)
242 return -EINVAL; 240 return -EINVAL;
243 241
244 if (strcmp(arg, "nopentium") == 0) { 242 if (strcmp(arg, "nopentium") == 0) {
245 clear_cpu_cap(&boot_cpu_data, X86_FEATURE_PSE); 243 setup_clear_cpu_cap(X86_FEATURE_PSE);
246 disable_pse = 1;
247 } else { 244 } else {
248 /* If the user specifies memory size, we 245 /* If the user specifies memory size, we
249 * limit the BIOS-provided memory map to 246 * limit the BIOS-provided memory map to