aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/microcode_amd.c
diff options
context:
space:
mode:
authorAndreas Herrmann <andreas.herrmann3@amd.com>2008-12-16 13:22:36 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-16 13:58:07 -0500
commitdf23cab563912ba43f7e9bc8ac517e5a2ddc9cd2 (patch)
tree8c7c28192892539674d9f46ebed62bd136a89ae6 /arch/x86/kernel/microcode_amd.c
parent5549b94bc74c3e7edd44e0aeb7d9f773e82d2d20 (diff)
x86: microcode_amd: modify log messages
Impact: change microcode printk content Change log level and provide (at least I tried to;-) consistent, short, meaningful content. Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com> Cc: Dmitry Adamushko <dmitry.adamushko@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/microcode_amd.c')
-rw-r--r--arch/x86/kernel/microcode_amd.c58
1 files changed, 26 insertions, 32 deletions
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index e1ce650f276b..24c256f4e50a 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -91,18 +91,13 @@ static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
91 u32 dummy; 91 u32 dummy;
92 92
93 memset(csig, 0, sizeof(*csig)); 93 memset(csig, 0, sizeof(*csig));
94
95 if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) { 94 if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
96 printk(KERN_ERR "microcode: CPU%d not a capable AMD processor\n", 95 printk(KERN_WARNING "microcode: CPU%d: AMD CPU family 0x%x not "
97 cpu); 96 "supported\n", cpu, c->x86);
98 return -1; 97 return -1;
99 } 98 }
100
101 rdmsr(MSR_AMD64_PATCH_LEVEL, csig->rev, dummy); 99 rdmsr(MSR_AMD64_PATCH_LEVEL, csig->rev, dummy);
102 100 printk(KERN_INFO "microcode: CPU%d: patch_level=0x%x\n", cpu, csig->rev);
103 printk(KERN_INFO "microcode: collect_cpu_info_amd : patch_id=0x%x\n",
104 csig->rev);
105
106 return 0; 101 return 0;
107} 102}
108 103
@@ -125,21 +120,21 @@ static int get_matching_microcode(int cpu, void *mc, int rev)
125 } 120 }
126 121
127 if (!equiv_cpu_id) { 122 if (!equiv_cpu_id) {
128 printk(KERN_ERR "microcode: CPU%d cpu_id " 123 printk(KERN_WARNING "microcode: CPU%d: cpu revision "
129 "not found in equivalent cpu table\n", cpu); 124 "not listed in equivalent cpu table\n", cpu);
130 return 0; 125 return 0;
131 } 126 }
132 127
133 if (mc_header->processor_rev_id != equiv_cpu_id) { 128 if (mc_header->processor_rev_id != equiv_cpu_id) {
134 printk(KERN_ERR "microcode: CPU%d patch does not match " 129 printk(KERN_ERR "microcode: CPU%d: patch mismatch "
135 "(processor_rev_id: %x, eqiv_cpu_id: %x)\n", 130 "(processor_rev_id: %x, equiv_cpu_id: %x)\n",
136 cpu, mc_header->processor_rev_id, equiv_cpu_id); 131 cpu, mc_header->processor_rev_id, equiv_cpu_id);
137 return 0; 132 return 0;
138 } 133 }
139 134
140 /* ucode might be chipset specific -- currently we don't support this */ 135 /* ucode might be chipset specific -- currently we don't support this */
141 if (mc_header->nb_dev_id || mc_header->sb_dev_id) { 136 if (mc_header->nb_dev_id || mc_header->sb_dev_id) {
142 printk(KERN_WARNING "microcode: CPU%d loading of chipset " 137 printk(KERN_ERR "microcode: CPU%d: loading of chipset "
143 "specific code not yet supported\n", cpu); 138 "specific code not yet supported\n", cpu);
144 return 0; 139 return 0;
145 } 140 }
@@ -172,15 +167,13 @@ static void apply_microcode_amd(int cpu)
172 167
173 /* check current patch id and patch's id for match */ 168 /* check current patch id and patch's id for match */
174 if (rev != mc_amd->hdr.patch_id) { 169 if (rev != mc_amd->hdr.patch_id) {
175 printk(KERN_ERR "microcode: CPU%d update from revision " 170 printk(KERN_ERR "microcode: CPU%d: update failed "
176 "0x%x to 0x%x failed\n", cpu_num, 171 "(for patch_level=0x%x)\n", cpu, mc_amd->hdr.patch_id);
177 mc_amd->hdr.patch_id, rev);
178 return; 172 return;
179 } 173 }
180 174
181 printk(KERN_INFO "microcode: CPU%d updated from revision " 175 printk(KERN_INFO "microcode: CPU%d: updated (new patch_level=0x%x)\n",
182 "0x%x to 0x%x\n", 176 cpu, rev);
183 cpu_num, uci->cpu_sig.rev, mc_amd->hdr.patch_id);
184 177
185 uci->cpu_sig.rev = rev; 178 uci->cpu_sig.rev = rev;
186} 179}
@@ -202,18 +195,18 @@ static void *get_next_ucode(const u8 *buf, unsigned int size,
202 return NULL; 195 return NULL;
203 196
204 if (section_hdr[0] != UCODE_UCODE_TYPE) { 197 if (section_hdr[0] != UCODE_UCODE_TYPE) {
205 printk(KERN_ERR "microcode: error! " 198 printk(KERN_ERR "microcode: error: invalid type field in "
206 "Wrong microcode payload type field\n"); 199 "container file section header\n");
207 return NULL; 200 return NULL;
208 } 201 }
209 202
210 total_size = (unsigned long) (section_hdr[4] + (section_hdr[5] << 8)); 203 total_size = (unsigned long) (section_hdr[4] + (section_hdr[5] << 8));
211 204
212 printk(KERN_INFO "microcode: size %u, total_size %u\n", 205 printk(KERN_DEBUG "microcode: size %u, total_size %u\n",
213 size, total_size); 206 size, total_size);
214 207
215 if (total_size > size || total_size > UCODE_MAX_SIZE) { 208 if (total_size > size || total_size > UCODE_MAX_SIZE) {
216 printk(KERN_ERR "microcode: error! Bad data in microcode data file\n"); 209 printk(KERN_ERR "microcode: error: size mismatch\n");
217 return NULL; 210 return NULL;
218 } 211 }
219 212
@@ -243,14 +236,15 @@ static int install_equiv_cpu_table(const u8 *buf)
243 size = buf_pos[2]; 236 size = buf_pos[2];
244 237
245 if (buf_pos[1] != UCODE_EQUIV_CPU_TABLE_TYPE || !size) { 238 if (buf_pos[1] != UCODE_EQUIV_CPU_TABLE_TYPE || !size) {
246 printk(KERN_ERR "microcode: error! " 239 printk(KERN_ERR "microcode: error: invalid type field in "
247 "Wrong microcode equivalent cpu table\n"); 240 "container file section header\n");
248 return 0; 241 return 0;
249 } 242 }
250 243
251 equiv_cpu_table = (struct equiv_cpu_entry *) vmalloc(size); 244 equiv_cpu_table = (struct equiv_cpu_entry *) vmalloc(size);
252 if (!equiv_cpu_table) { 245 if (!equiv_cpu_table) {
253 printk(KERN_ERR "microcode: error, can't allocate memory for equiv CPU table\n"); 246 printk(KERN_ERR "microcode: failed to allocate "
247 "equivalent CPU table\n");
254 return 0; 248 return 0;
255 } 249 }
256 250
@@ -283,7 +277,8 @@ static int generic_load_microcode(int cpu, const u8 *data, size_t size)
283 277
284 offset = install_equiv_cpu_table(ucode_ptr); 278 offset = install_equiv_cpu_table(ucode_ptr);
285 if (!offset) { 279 if (!offset) {
286 printk(KERN_ERR "microcode: installing equivalent cpu table failed\n"); 280 printk(KERN_ERR "microcode: failed to create "
281 "equivalent cpu table\n");
287 return -EINVAL; 282 return -EINVAL;
288 } 283 }
289 284
@@ -339,8 +334,7 @@ static int request_microcode_fw(int cpu, struct device *device)
339 334
340 ret = request_firmware(&firmware, fw_name, device); 335 ret = request_firmware(&firmware, fw_name, device);
341 if (ret) { 336 if (ret) {
342 printk(KERN_ERR "microcode: ucode data file %s load failed\n", 337 printk(KERN_ERR "microcode: failed to load file %s\n", fw_name);
343 fw_name);
344 return ret; 338 return ret;
345 } 339 }
346 340
@@ -353,8 +347,8 @@ static int request_microcode_fw(int cpu, struct device *device)
353 347
354static int request_microcode_user(int cpu, const void __user *buf, size_t size) 348static int request_microcode_user(int cpu, const void __user *buf, size_t size)
355{ 349{
356 printk(KERN_WARNING "microcode: AMD microcode update via " 350 printk(KERN_INFO "microcode: AMD microcode update via "
357 "/dev/cpu/microcode is not supported\n"); 351 "/dev/cpu/microcode not supported\n");
358 return -1; 352 return -1;
359} 353}
360 354