diff options
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r-- | arch/i386/kernel/cpu/Makefile | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/addon_cpuid_features.c | 50 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/common.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/proc.c | 21 | ||||
-rw-r--r-- | arch/i386/kernel/e820.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/setup.c | 12 | ||||
-rw-r--r-- | arch/i386/kernel/verify_cpu.S | 94 |
7 files changed, 70 insertions, 113 deletions
diff --git a/arch/i386/kernel/cpu/Makefile b/arch/i386/kernel/cpu/Makefile index 74f27a463db0..0b6a8551e9e2 100644 --- a/arch/i386/kernel/cpu/Makefile +++ b/arch/i386/kernel/cpu/Makefile | |||
@@ -8,7 +8,7 @@ obj-y += amd.o | |||
8 | obj-y += cyrix.o | 8 | obj-y += cyrix.o |
9 | obj-y += centaur.o | 9 | obj-y += centaur.o |
10 | obj-y += transmeta.o | 10 | obj-y += transmeta.o |
11 | obj-y += intel.o intel_cacheinfo.o | 11 | obj-y += intel.o intel_cacheinfo.o addon_cpuid_features.o |
12 | obj-y += rise.o | 12 | obj-y += rise.o |
13 | obj-y += nexgen.o | 13 | obj-y += nexgen.o |
14 | obj-y += umc.o | 14 | obj-y += umc.o |
diff --git a/arch/i386/kernel/cpu/addon_cpuid_features.c b/arch/i386/kernel/cpu/addon_cpuid_features.c new file mode 100644 index 000000000000..3e91d3ee26ec --- /dev/null +++ b/arch/i386/kernel/cpu/addon_cpuid_features.c | |||
@@ -0,0 +1,50 @@ | |||
1 | |||
2 | /* | ||
3 | * Routines to indentify additional cpu features that are scattered in | ||
4 | * cpuid space. | ||
5 | */ | ||
6 | |||
7 | #include <linux/cpu.h> | ||
8 | |||
9 | #include <asm/processor.h> | ||
10 | |||
11 | struct cpuid_bit { | ||
12 | u16 feature; | ||
13 | u8 reg; | ||
14 | u8 bit; | ||
15 | u32 level; | ||
16 | }; | ||
17 | |||
18 | enum cpuid_regs { | ||
19 | CR_EAX = 0, | ||
20 | CR_ECX, | ||
21 | CR_EDX, | ||
22 | CR_EBX | ||
23 | }; | ||
24 | |||
25 | void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c) | ||
26 | { | ||
27 | u32 max_level; | ||
28 | u32 regs[4]; | ||
29 | const struct cpuid_bit *cb; | ||
30 | |||
31 | static const struct cpuid_bit cpuid_bits[] = { | ||
32 | { X86_FEATURE_IDA, CR_EAX, 1, 0x00000006 }, | ||
33 | { 0, 0, 0, 0 } | ||
34 | }; | ||
35 | |||
36 | for (cb = cpuid_bits; cb->feature; cb++) { | ||
37 | |||
38 | /* Verify that the level is valid */ | ||
39 | max_level = cpuid_eax(cb->level & 0xffff0000); | ||
40 | if (max_level < cb->level || | ||
41 | max_level > (cb->level | 0xffff)) | ||
42 | continue; | ||
43 | |||
44 | cpuid(cb->level, ®s[CR_EAX], ®s[CR_EBX], | ||
45 | ®s[CR_ECX], ®s[CR_EDX]); | ||
46 | |||
47 | if (regs[cb->reg] & (1 << cb->bit)) | ||
48 | set_bit(cb->feature, c->x86_capability); | ||
49 | } | ||
50 | } | ||
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c index 794d593c47eb..e5419a9dec88 100644 --- a/arch/i386/kernel/cpu/common.c +++ b/arch/i386/kernel/cpu/common.c | |||
@@ -353,6 +353,8 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 * c) | |||
353 | if ( xlvl >= 0x80000004 ) | 353 | if ( xlvl >= 0x80000004 ) |
354 | get_model_name(c); /* Default name */ | 354 | get_model_name(c); /* Default name */ |
355 | } | 355 | } |
356 | |||
357 | init_scattered_cpuid_features(c); | ||
356 | } | 358 | } |
357 | 359 | ||
358 | early_intel_workaround(c); | 360 | early_intel_workaround(c); |
diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c index 89d91e6cc972..1e31b6caffb1 100644 --- a/arch/i386/kernel/cpu/proc.c +++ b/arch/i386/kernel/cpu/proc.c | |||
@@ -29,7 +29,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
29 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 29 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
30 | NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, | 30 | NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, |
31 | NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL, | 31 | NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL, |
32 | NULL, "fxsr_opt", "pdpe1gb", "rdtscp", NULL, "lm", "3dnowext", "3dnow", | 32 | NULL, "fxsr_opt", "pdpe1gb", "rdtscp", NULL, "lm", |
33 | "3dnowext", "3dnow", | ||
33 | 34 | ||
34 | /* Transmeta-defined */ | 35 | /* Transmeta-defined */ |
35 | "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, | 36 | "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, |
@@ -40,8 +41,9 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
40 | /* Other (Linux-defined) */ | 41 | /* Other (Linux-defined) */ |
41 | "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr", | 42 | "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr", |
42 | NULL, NULL, NULL, NULL, | 43 | NULL, NULL, NULL, NULL, |
43 | "constant_tsc", "up", NULL, NULL, NULL, NULL, NULL, NULL, | 44 | "constant_tsc", "up", NULL, "arch_perfmon", |
44 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 45 | "pebs", "bts", NULL, "sync_rdtsc", |
46 | "rep_good", NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
45 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 47 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
46 | 48 | ||
47 | /* Intel-defined (#2) */ | 49 | /* Intel-defined (#2) */ |
@@ -57,9 +59,16 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
57 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 59 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
58 | 60 | ||
59 | /* AMD-defined (#2) */ | 61 | /* AMD-defined (#2) */ |
60 | "lahf_lm", "cmp_legacy", "svm", "extapic", "cr8legacy", "abm", | 62 | "lahf_lm", "cmp_legacy", "svm", "extapic", "cr8_legacy", |
61 | "sse4a", "misalignsse", | 63 | "altmovcr8", "abm", "sse4a", |
62 | "3dnowprefetch", "osvw", "ibs", NULL, NULL, NULL, NULL, NULL, | 64 | "misalignsse", "3dnowprefetch", |
65 | "osvw", "ibs", NULL, NULL, NULL, NULL, | ||
66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
68 | |||
69 | /* Auxiliary (Linux-defined) */ | ||
70 | "ida", NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
71 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | ||
63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 72 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 73 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
65 | }; | 74 | }; |
diff --git a/arch/i386/kernel/e820.c b/arch/i386/kernel/e820.c index 9645bb51f76a..fc822a46897a 100644 --- a/arch/i386/kernel/e820.c +++ b/arch/i386/kernel/e820.c | |||
@@ -734,7 +734,7 @@ void __init print_memory_map(char *who) | |||
734 | case E820_NVS: | 734 | case E820_NVS: |
735 | printk("(ACPI NVS)\n"); | 735 | printk("(ACPI NVS)\n"); |
736 | break; | 736 | break; |
737 | default: printk("type %lu\n", e820.map[i].type); | 737 | default: printk("type %u\n", e820.map[i].type); |
738 | break; | 738 | break; |
739 | } | 739 | } |
740 | } | 740 | } |
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 698c24fe482e..2d61e65eeb50 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
@@ -102,19 +102,10 @@ static unsigned int highmem_pages = -1; | |||
102 | /* | 102 | /* |
103 | * Setup options | 103 | * Setup options |
104 | */ | 104 | */ |
105 | struct drive_info_struct { char dummy[32]; } drive_info; | ||
106 | #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || \ | ||
107 | defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE) | ||
108 | EXPORT_SYMBOL(drive_info); | ||
109 | #endif | ||
110 | struct screen_info screen_info; | 105 | struct screen_info screen_info; |
111 | EXPORT_SYMBOL(screen_info); | 106 | EXPORT_SYMBOL(screen_info); |
112 | struct apm_info apm_info; | 107 | struct apm_info apm_info; |
113 | EXPORT_SYMBOL(apm_info); | 108 | EXPORT_SYMBOL(apm_info); |
114 | struct sys_desc_table_struct { | ||
115 | unsigned short length; | ||
116 | unsigned char table[0]; | ||
117 | }; | ||
118 | struct edid_info edid_info; | 109 | struct edid_info edid_info; |
119 | EXPORT_SYMBOL_GPL(edid_info); | 110 | EXPORT_SYMBOL_GPL(edid_info); |
120 | struct ist_info ist_info; | 111 | struct ist_info ist_info; |
@@ -134,7 +125,7 @@ unsigned long saved_videomode; | |||
134 | 125 | ||
135 | static char __initdata command_line[COMMAND_LINE_SIZE]; | 126 | static char __initdata command_line[COMMAND_LINE_SIZE]; |
136 | 127 | ||
137 | unsigned char __initdata boot_params[PARAM_SIZE]; | 128 | struct boot_params __initdata boot_params; |
138 | 129 | ||
139 | #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) | 130 | #if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE) |
140 | struct edd edd; | 131 | struct edd edd; |
@@ -528,7 +519,6 @@ void __init setup_arch(char **cmdline_p) | |||
528 | #endif | 519 | #endif |
529 | 520 | ||
530 | ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); | 521 | ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); |
531 | drive_info = DRIVE_INFO; | ||
532 | screen_info = SCREEN_INFO; | 522 | screen_info = SCREEN_INFO; |
533 | edid_info = EDID_INFO; | 523 | edid_info = EDID_INFO; |
534 | apm_info.bios = APM_BIOS_INFO; | 524 | apm_info.bios = APM_BIOS_INFO; |
diff --git a/arch/i386/kernel/verify_cpu.S b/arch/i386/kernel/verify_cpu.S deleted file mode 100644 index f1d1eacf4ab0..000000000000 --- a/arch/i386/kernel/verify_cpu.S +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | /* Check if CPU has some minimum CPUID bits | ||
2 | This runs in 16bit mode so that the caller can still use the BIOS | ||
3 | to output errors on the screen */ | ||
4 | #include <asm/cpufeature.h> | ||
5 | #include <asm/msr.h> | ||
6 | |||
7 | verify_cpu: | ||
8 | pushfl # Save caller passed flags | ||
9 | pushl $0 # Kill any dangerous flags | ||
10 | popfl | ||
11 | |||
12 | #if CONFIG_X86_MINIMUM_CPU_MODEL >= 4 | ||
13 | pushfl | ||
14 | pop %eax | ||
15 | orl $(1<<18),%eax # try setting AC | ||
16 | push %eax | ||
17 | popfl | ||
18 | pushfl | ||
19 | popl %eax | ||
20 | testl $(1<<18),%eax | ||
21 | jz bad | ||
22 | #endif | ||
23 | #if REQUIRED_MASK1 != 0 | ||
24 | pushfl # standard way to check for cpuid | ||
25 | popl %eax | ||
26 | movl %eax,%ebx | ||
27 | xorl $0x200000,%eax | ||
28 | pushl %eax | ||
29 | popfl | ||
30 | pushfl | ||
31 | popl %eax | ||
32 | cmpl %eax,%ebx | ||
33 | pushfl # standard way to check for cpuid | ||
34 | popl %eax | ||
35 | movl %eax,%ebx | ||
36 | xorl $0x200000,%eax | ||
37 | pushl %eax | ||
38 | popfl | ||
39 | pushfl | ||
40 | popl %eax | ||
41 | cmpl %eax,%ebx | ||
42 | jz bad # REQUIRED_MASK1 != 0 requires CPUID | ||
43 | |||
44 | movl $0x0,%eax # See if cpuid 1 is implemented | ||
45 | cpuid | ||
46 | cmpl $0x1,%eax | ||
47 | jb bad # no cpuid 1 | ||
48 | |||
49 | #if REQUIRED_MASK1 & NEED_CMPXCHG64 | ||
50 | /* Some VIA C3s need magic MSRs to enable CX64. Do this here */ | ||
51 | cmpl $0x746e6543,%ebx # Cent | ||
52 | jne 1f | ||
53 | cmpl $0x48727561,%edx # aurH | ||
54 | jne 1f | ||
55 | cmpl $0x736c7561,%ecx # auls | ||
56 | jne 1f | ||
57 | movl $1,%eax # check model | ||
58 | cpuid | ||
59 | movl %eax,%ebx | ||
60 | shr $8,%ebx | ||
61 | andl $0xf,%ebx | ||
62 | cmp $6,%ebx # check family == 6 | ||
63 | jne 1f | ||
64 | shr $4,%eax | ||
65 | andl $0xf,%eax | ||
66 | cmpl $6,%eax # check model >= 6 | ||
67 | jb 1f | ||
68 | # assume models >= 6 all support this MSR | ||
69 | movl $MSR_VIA_FCR,%ecx | ||
70 | rdmsr | ||
71 | orl $((1<<1)|(1<<7)),%eax # enable CMPXCHG64 and PGE | ||
72 | wrmsr | ||
73 | 1: | ||
74 | #endif | ||
75 | movl $0x1,%eax # Does the cpu have what it takes | ||
76 | cpuid | ||
77 | |||
78 | #if CONFIG_X86_MINIMUM_CPU_MODEL > 4 | ||
79 | #error add proper model checking here | ||
80 | #endif | ||
81 | |||
82 | andl $REQUIRED_MASK1,%edx | ||
83 | xorl $REQUIRED_MASK1,%edx | ||
84 | jnz bad | ||
85 | #endif /* REQUIRED_MASK1 */ | ||
86 | |||
87 | popfl | ||
88 | xor %eax,%eax | ||
89 | ret | ||
90 | |||
91 | bad: | ||
92 | popfl | ||
93 | movl $1,%eax | ||
94 | ret | ||