diff options
author | Andi Kleen <ak@suse.de> | 2006-01-11 16:42:51 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-11 22:01:12 -0500 |
commit | 3f98bc4991df8e7b5972489b4632e1e5c03cd1ee (patch) | |
tree | 877fc1305c6d2713a891fc52cc5babbe5c0d62dc | |
parent | 152bf8c55d657898c40c8ed270630c0cf9d51f7d (diff) |
[PATCH] i386/x86-64: Update AMD CPUID flags
Print bits for RDTSCP, SVM, CR8-LEGACY.
Also now print power flags on i386 like x86-64 always did.
This will add a new line in the 386 cpuinfo, but that shouldn't
be an issue - did that in the past too and I haven't heard
of any breakage.
I shrunk some of the fields in the i386 cpuinfo_x86 to chars
to make up for the new int "x86_power" field. Overall it's
smaller than before.
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/i386/kernel/cpu/amd.c | 5 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/proc.c | 25 | ||||
-rw-r--r-- | arch/x86_64/kernel/setup.c | 15 | ||||
-rw-r--r-- | include/asm-i386/processor.h | 8 |
4 files changed, 40 insertions, 13 deletions
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c index 4397f61705e2..333578a4e91a 100644 --- a/arch/i386/kernel/cpu/amd.c +++ b/arch/i386/kernel/cpu/amd.c | |||
@@ -217,8 +217,9 @@ static void __init init_amd(struct cpuinfo_x86 *c) | |||
217 | } | 217 | } |
218 | 218 | ||
219 | if (cpuid_eax(0x80000000) >= 0x80000007) { | 219 | if (cpuid_eax(0x80000000) >= 0x80000007) { |
220 | if (cpuid_edx(0x80000007) & (1<<8)) | 220 | c->x86_power = cpuid_edx(0x80000007); |
221 | set_bit(X86_FEATURE_CONSTANT_TSC, &c->x86_capability); | 221 | if (c->x86_power & (1<<8)) |
222 | set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability); | ||
222 | } | 223 | } |
223 | 224 | ||
224 | #ifdef CONFIG_X86_HT | 225 | #ifdef CONFIG_X86_HT |
diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c index 66592fad2bfe..89a85af33d28 100644 --- a/arch/i386/kernel/cpu/proc.c +++ b/arch/i386/kernel/cpu/proc.c | |||
@@ -29,7 +29,7 @@ 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", NULL, NULL, NULL, "lm", "3dnowext", "3dnow", | 32 | NULL, "fxsr_opt", "rdtscp", NULL, NULL, "lm", "3dnowext", "3dnow", |
33 | 33 | ||
34 | /* Transmeta-defined */ | 34 | /* Transmeta-defined */ |
35 | "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, | 35 | "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, |
@@ -57,11 +57,21 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
57 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 57 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
58 | 58 | ||
59 | /* AMD-defined (#2) */ | 59 | /* AMD-defined (#2) */ |
60 | "lahf_lm", "cmp_legacy", NULL, NULL, NULL, NULL, NULL, NULL, | 60 | "lahf_lm", "cmp_legacy", "svm", NULL, "cr8legacy", NULL, NULL, NULL, |
61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 61 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 62 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 63 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
64 | }; | 64 | }; |
65 | static char *x86_power_flags[] = { | ||
66 | "ts", /* temperature sensor */ | ||
67 | "fid", /* frequency id control */ | ||
68 | "vid", /* voltage id control */ | ||
69 | "ttp", /* thermal trip */ | ||
70 | "tm", | ||
71 | "stc", | ||
72 | NULL, | ||
73 | /* nothing */ /* constant_tsc - moved to flags */ | ||
74 | }; | ||
65 | struct cpuinfo_x86 *c = v; | 75 | struct cpuinfo_x86 *c = v; |
66 | int i, n = c - cpu_data; | 76 | int i, n = c - cpu_data; |
67 | int fpu_exception; | 77 | int fpu_exception; |
@@ -131,6 +141,17 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
131 | x86_cap_flags[i] != NULL ) | 141 | x86_cap_flags[i] != NULL ) |
132 | seq_printf(m, " %s", x86_cap_flags[i]); | 142 | seq_printf(m, " %s", x86_cap_flags[i]); |
133 | 143 | ||
144 | for (i = 0; i < 32; i++) | ||
145 | if (c->x86_power & (1 << i)) { | ||
146 | if (i < ARRAY_SIZE(x86_power_flags) && | ||
147 | x86_power_flags[i]) | ||
148 | seq_printf(m, "%s%s", | ||
149 | x86_power_flags[i][0]?" ":"", | ||
150 | x86_power_flags[i]); | ||
151 | else | ||
152 | seq_printf(m, " [%d]", i); | ||
153 | } | ||
154 | |||
134 | seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n", | 155 | seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n", |
135 | c->loops_per_jiffy/(500000/HZ), | 156 | c->loops_per_jiffy/(500000/HZ), |
136 | (c->loops_per_jiffy/(5000/HZ)) % 100); | 157 | (c->loops_per_jiffy/(5000/HZ)) % 100); |
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index d9c1c3bd6150..ee3a5cd7d8d9 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -1233,7 +1233,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
1233 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 1233 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
1234 | NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, | 1234 | NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, |
1235 | NULL, NULL, NULL, NULL, "nx", NULL, "mmxext", NULL, | 1235 | NULL, NULL, NULL, NULL, "nx", NULL, "mmxext", NULL, |
1236 | NULL, "fxsr_opt", NULL, NULL, NULL, "lm", "3dnowext", "3dnow", | 1236 | NULL, "fxsr_opt", "rdtscp", NULL, NULL, "lm", "3dnowext", "3dnow", |
1237 | 1237 | ||
1238 | /* Transmeta-defined */ | 1238 | /* Transmeta-defined */ |
1239 | "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, | 1239 | "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, |
@@ -1261,7 +1261,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
1261 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 1261 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
1262 | 1262 | ||
1263 | /* AMD-defined (#2) */ | 1263 | /* AMD-defined (#2) */ |
1264 | "lahf_lm", "cmp_legacy", NULL, NULL, NULL, NULL, NULL, NULL, | 1264 | "lahf_lm", "cmp_legacy", "svm", NULL, "cr8_legacy", NULL, NULL, NULL, |
1265 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 1265 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
1266 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 1266 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
1267 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 1267 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
@@ -1272,8 +1272,8 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
1272 | "vid", /* voltage id control */ | 1272 | "vid", /* voltage id control */ |
1273 | "ttp", /* thermal trip */ | 1273 | "ttp", /* thermal trip */ |
1274 | "tm", | 1274 | "tm", |
1275 | "stc" | 1275 | "stc", |
1276 | "?", | 1276 | NULL, |
1277 | /* nothing */ /* constant_tsc - moved to flags */ | 1277 | /* nothing */ /* constant_tsc - moved to flags */ |
1278 | }; | 1278 | }; |
1279 | 1279 | ||
@@ -1354,8 +1354,11 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
1354 | unsigned i; | 1354 | unsigned i; |
1355 | for (i = 0; i < 32; i++) | 1355 | for (i = 0; i < 32; i++) |
1356 | if (c->x86_power & (1 << i)) { | 1356 | if (c->x86_power & (1 << i)) { |
1357 | if (i < ARRAY_SIZE(x86_power_flags)) | 1357 | if (i < ARRAY_SIZE(x86_power_flags) && |
1358 | seq_printf(m, " %s", x86_power_flags[i]); | 1358 | x86_power_flags[i]) |
1359 | seq_printf(m, "%s%s", | ||
1360 | x86_power_flags[i][0]?" ":"", | ||
1361 | x86_power_flags[i]); | ||
1359 | else | 1362 | else |
1360 | seq_printf(m, " [%d]", i); | 1363 | seq_printf(m, " [%d]", i); |
1361 | } | 1364 | } |
diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 5c96cf6dcb39..53461f42b663 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h | |||
@@ -61,9 +61,11 @@ struct cpuinfo_x86 { | |||
61 | int x86_cache_size; /* in KB - valid for CPUS which support this | 61 | int x86_cache_size; /* in KB - valid for CPUS which support this |
62 | call */ | 62 | call */ |
63 | int x86_cache_alignment; /* In bytes */ | 63 | int x86_cache_alignment; /* In bytes */ |
64 | int fdiv_bug; | 64 | char fdiv_bug; |
65 | int f00f_bug; | 65 | char f00f_bug; |
66 | int coma_bug; | 66 | char coma_bug; |
67 | char pad0; | ||
68 | int x86_power; | ||
67 | unsigned long loops_per_jiffy; | 69 | unsigned long loops_per_jiffy; |
68 | unsigned char x86_max_cores; /* cpuid returned max cores value */ | 70 | unsigned char x86_max_cores; /* cpuid returned max cores value */ |
69 | unsigned char booted_cores; /* number of cores as seen by OS */ | 71 | unsigned char booted_cores; /* number of cores as seen by OS */ |