mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-21 00:42:16 +00:00
[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>
This commit is contained in:
parent
152bf8c55d
commit
3f98bc4991
@ -217,8 +217,9 @@ static void __init init_amd(struct cpuinfo_x86 *c)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cpuid_eax(0x80000000) >= 0x80000007) {
|
if (cpuid_eax(0x80000000) >= 0x80000007) {
|
||||||
if (cpuid_edx(0x80000007) & (1<<8))
|
c->x86_power = cpuid_edx(0x80000007);
|
||||||
set_bit(X86_FEATURE_CONSTANT_TSC, &c->x86_capability);
|
if (c->x86_power & (1<<8))
|
||||||
|
set_bit(X86_FEATURE_CONSTANT_TSC, c->x86_capability);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_X86_HT
|
#ifdef CONFIG_X86_HT
|
||||||
|
@ -29,7 +29,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
|||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL,
|
NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL,
|
||||||
NULL, "fxsr_opt", NULL, NULL, NULL, "lm", "3dnowext", "3dnow",
|
NULL, "fxsr_opt", "rdtscp", NULL, NULL, "lm", "3dnowext", "3dnow",
|
||||||
|
|
||||||
/* Transmeta-defined */
|
/* Transmeta-defined */
|
||||||
"recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL,
|
"recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL,
|
||||||
@ -57,11 +57,21 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
|||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
|
|
||||||
/* AMD-defined (#2) */
|
/* AMD-defined (#2) */
|
||||||
"lahf_lm", "cmp_legacy", NULL, NULL, NULL, NULL, NULL, NULL,
|
"lahf_lm", "cmp_legacy", "svm", NULL, "cr8legacy", NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
};
|
};
|
||||||
|
static char *x86_power_flags[] = {
|
||||||
|
"ts", /* temperature sensor */
|
||||||
|
"fid", /* frequency id control */
|
||||||
|
"vid", /* voltage id control */
|
||||||
|
"ttp", /* thermal trip */
|
||||||
|
"tm",
|
||||||
|
"stc",
|
||||||
|
NULL,
|
||||||
|
/* nothing */ /* constant_tsc - moved to flags */
|
||||||
|
};
|
||||||
struct cpuinfo_x86 *c = v;
|
struct cpuinfo_x86 *c = v;
|
||||||
int i, n = c - cpu_data;
|
int i, n = c - cpu_data;
|
||||||
int fpu_exception;
|
int fpu_exception;
|
||||||
@ -131,6 +141,17 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
|||||||
x86_cap_flags[i] != NULL )
|
x86_cap_flags[i] != NULL )
|
||||||
seq_printf(m, " %s", x86_cap_flags[i]);
|
seq_printf(m, " %s", x86_cap_flags[i]);
|
||||||
|
|
||||||
|
for (i = 0; i < 32; i++)
|
||||||
|
if (c->x86_power & (1 << i)) {
|
||||||
|
if (i < ARRAY_SIZE(x86_power_flags) &&
|
||||||
|
x86_power_flags[i])
|
||||||
|
seq_printf(m, "%s%s",
|
||||||
|
x86_power_flags[i][0]?" ":"",
|
||||||
|
x86_power_flags[i]);
|
||||||
|
else
|
||||||
|
seq_printf(m, " [%d]", i);
|
||||||
|
}
|
||||||
|
|
||||||
seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n",
|
seq_printf(m, "\nbogomips\t: %lu.%02lu\n\n",
|
||||||
c->loops_per_jiffy/(500000/HZ),
|
c->loops_per_jiffy/(500000/HZ),
|
||||||
(c->loops_per_jiffy/(5000/HZ)) % 100);
|
(c->loops_per_jiffy/(5000/HZ)) % 100);
|
||||||
|
@ -1233,7 +1233,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
|||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL, "nx", NULL, "mmxext", NULL,
|
NULL, NULL, NULL, NULL, "nx", NULL, "mmxext", NULL,
|
||||||
NULL, "fxsr_opt", NULL, NULL, NULL, "lm", "3dnowext", "3dnow",
|
NULL, "fxsr_opt", "rdtscp", NULL, NULL, "lm", "3dnowext", "3dnow",
|
||||||
|
|
||||||
/* Transmeta-defined */
|
/* Transmeta-defined */
|
||||||
"recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL,
|
"recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL,
|
||||||
@ -1261,7 +1261,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
|||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
|
|
||||||
/* AMD-defined (#2) */
|
/* AMD-defined (#2) */
|
||||||
"lahf_lm", "cmp_legacy", NULL, NULL, NULL, NULL, NULL, NULL,
|
"lahf_lm", "cmp_legacy", "svm", NULL, "cr8_legacy", NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
@ -1272,8 +1272,8 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
|||||||
"vid", /* voltage id control */
|
"vid", /* voltage id control */
|
||||||
"ttp", /* thermal trip */
|
"ttp", /* thermal trip */
|
||||||
"tm",
|
"tm",
|
||||||
"stc"
|
"stc",
|
||||||
"?",
|
NULL,
|
||||||
/* nothing */ /* constant_tsc - moved to flags */
|
/* nothing */ /* constant_tsc - moved to flags */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1354,8 +1354,11 @@ static int show_cpuinfo(struct seq_file *m, void *v)
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
for (i = 0; i < 32; i++)
|
for (i = 0; i < 32; i++)
|
||||||
if (c->x86_power & (1 << i)) {
|
if (c->x86_power & (1 << i)) {
|
||||||
if (i < ARRAY_SIZE(x86_power_flags))
|
if (i < ARRAY_SIZE(x86_power_flags) &&
|
||||||
seq_printf(m, " %s", x86_power_flags[i]);
|
x86_power_flags[i])
|
||||||
|
seq_printf(m, "%s%s",
|
||||||
|
x86_power_flags[i][0]?" ":"",
|
||||||
|
x86_power_flags[i]);
|
||||||
else
|
else
|
||||||
seq_printf(m, " [%d]", i);
|
seq_printf(m, " [%d]", i);
|
||||||
}
|
}
|
||||||
|
@ -61,9 +61,11 @@ struct cpuinfo_x86 {
|
|||||||
int x86_cache_size; /* in KB - valid for CPUS which support this
|
int x86_cache_size; /* in KB - valid for CPUS which support this
|
||||||
call */
|
call */
|
||||||
int x86_cache_alignment; /* In bytes */
|
int x86_cache_alignment; /* In bytes */
|
||||||
int fdiv_bug;
|
char fdiv_bug;
|
||||||
int f00f_bug;
|
char f00f_bug;
|
||||||
int coma_bug;
|
char coma_bug;
|
||||||
|
char pad0;
|
||||||
|
int x86_power;
|
||||||
unsigned long loops_per_jiffy;
|
unsigned long loops_per_jiffy;
|
||||||
unsigned char x86_max_cores; /* cpuid returned max cores value */
|
unsigned char x86_max_cores; /* cpuid returned max cores value */
|
||||||
unsigned char booted_cores; /* number of cores as seen by OS */
|
unsigned char booted_cores; /* number of cores as seen by OS */
|
||||||
|
Loading…
Reference in New Issue
Block a user