diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-07-11 15:18:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-12 13:55:54 -0400 |
commit | ec481536b15eb0520d8f0204b0294480050fe1f8 (patch) | |
tree | 3f959a26ca58477734ea1e4d5370b2d3a33a1680 /arch/i386 | |
parent | f8c09377d754f35a135454181b869ab527cc0757 (diff) |
Unify the CPU features vectors between i386 and x86-64
Unify the handling of the CPU features vectors between i386 and x86-64.
This also adopts the collapsing of features which are required at
compile-time into constant tests from x86-64 to i386.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/kernel/cpu/proc.c | 15 | ||||
-rw-r--r-- | arch/i386/kernel/verify_cpu.S | 12 |
2 files changed, 15 insertions, 12 deletions
diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c index 89d91e6cc972..ed73091d3dd0 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,10 @@ 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, | ||
63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 66 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
64 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 67 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
65 | }; | 68 | }; |
diff --git a/arch/i386/kernel/verify_cpu.S b/arch/i386/kernel/verify_cpu.S index f1d1eacf4ab0..3efc5c137d14 100644 --- a/arch/i386/kernel/verify_cpu.S +++ b/arch/i386/kernel/verify_cpu.S | |||
@@ -20,7 +20,7 @@ verify_cpu: | |||
20 | testl $(1<<18),%eax | 20 | testl $(1<<18),%eax |
21 | jz bad | 21 | jz bad |
22 | #endif | 22 | #endif |
23 | #if REQUIRED_MASK1 != 0 | 23 | #if REQUIRED_MASK0 != 0 |
24 | pushfl # standard way to check for cpuid | 24 | pushfl # standard way to check for cpuid |
25 | popl %eax | 25 | popl %eax |
26 | movl %eax,%ebx | 26 | movl %eax,%ebx |
@@ -39,14 +39,14 @@ verify_cpu: | |||
39 | pushfl | 39 | pushfl |
40 | popl %eax | 40 | popl %eax |
41 | cmpl %eax,%ebx | 41 | cmpl %eax,%ebx |
42 | jz bad # REQUIRED_MASK1 != 0 requires CPUID | 42 | jz bad # REQUIRED_MASK0 != 0 requires CPUID |
43 | 43 | ||
44 | movl $0x0,%eax # See if cpuid 1 is implemented | 44 | movl $0x0,%eax # See if cpuid 1 is implemented |
45 | cpuid | 45 | cpuid |
46 | cmpl $0x1,%eax | 46 | cmpl $0x1,%eax |
47 | jb bad # no cpuid 1 | 47 | jb bad # no cpuid 1 |
48 | 48 | ||
49 | #if REQUIRED_MASK1 & NEED_CMPXCHG64 | 49 | #if REQUIRED_MASK0 & NEED_CMPXCHG64 |
50 | /* Some VIA C3s need magic MSRs to enable CX64. Do this here */ | 50 | /* Some VIA C3s need magic MSRs to enable CX64. Do this here */ |
51 | cmpl $0x746e6543,%ebx # Cent | 51 | cmpl $0x746e6543,%ebx # Cent |
52 | jne 1f | 52 | jne 1f |
@@ -79,10 +79,10 @@ verify_cpu: | |||
79 | #error add proper model checking here | 79 | #error add proper model checking here |
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | andl $REQUIRED_MASK1,%edx | 82 | andl $REQUIRED_MASK0,%edx |
83 | xorl $REQUIRED_MASK1,%edx | 83 | xorl $REQUIRED_MASK0,%edx |
84 | jnz bad | 84 | jnz bad |
85 | #endif /* REQUIRED_MASK1 */ | 85 | #endif /* REQUIRED_MASK0 */ |
86 | 86 | ||
87 | popfl | 87 | popfl |
88 | xor %eax,%eax | 88 | xor %eax,%eax |