diff options
-rw-r--r-- | arch/x86/kernel/cpu/common_64.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/common_64.c b/arch/x86/kernel/cpu/common_64.c index b82479c10835..f1fb94e766bb 100644 --- a/arch/x86/kernel/cpu/common_64.c +++ b/arch/x86/kernel/cpu/common_64.c | |||
@@ -83,6 +83,7 @@ static struct cpu_dev *this_cpu __cpuinitdata; | |||
83 | int __cpuinit get_model_name(struct cpuinfo_x86 *c) | 83 | int __cpuinit get_model_name(struct cpuinfo_x86 *c) |
84 | { | 84 | { |
85 | unsigned int *v; | 85 | unsigned int *v; |
86 | char *p, *q; | ||
86 | 87 | ||
87 | if (c->extended_cpuid_level < 0x80000004) | 88 | if (c->extended_cpuid_level < 0x80000004) |
88 | return 0; | 89 | return 0; |
@@ -92,6 +93,19 @@ int __cpuinit get_model_name(struct cpuinfo_x86 *c) | |||
92 | cpuid(0x80000003, &v[4], &v[5], &v[6], &v[7]); | 93 | cpuid(0x80000003, &v[4], &v[5], &v[6], &v[7]); |
93 | cpuid(0x80000004, &v[8], &v[9], &v[10], &v[11]); | 94 | cpuid(0x80000004, &v[8], &v[9], &v[10], &v[11]); |
94 | c->x86_model_id[48] = 0; | 95 | c->x86_model_id[48] = 0; |
96 | |||
97 | /* Intel chips right-justify this string for some dumb reason; | ||
98 | undo that brain damage */ | ||
99 | p = q = &c->x86_model_id[0]; | ||
100 | while (*p == ' ') | ||
101 | p++; | ||
102 | if (p != q) { | ||
103 | while (*p) | ||
104 | *q++ = *p++; | ||
105 | while (q <= &c->x86_model_id[48]) | ||
106 | *q++ = '\0'; /* Zero-pad the rest */ | ||
107 | } | ||
108 | |||
95 | return 1; | 109 | return 1; |
96 | } | 110 | } |
97 | 111 | ||