aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2011-01-05 12:13:19 -0500
committerBorislav Petkov <borislav.petkov@amd.com>2011-02-09 10:05:36 -0500
commit258721ef34fce97a7a6ca9cebebb303827645868 (patch)
tree8a36c70f7c65476961feddb8ccd50a12f9c8788e
parent05ff02e4c0686051fcb074aec92df03f2c184fd1 (diff)
x86, microcode, AMD: Cleanup dmesg output
Unify pr_* to use pr_fmt, shorten messages, correct type formatting. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com> Acked-by: Andreas Herrmann <Andreas.Herrmann3@amd.com>
-rw-r--r--arch/x86/kernel/microcode_amd.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 274fa4063c7a..adbcef4f6333 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -78,12 +78,13 @@ static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
78 u32 dummy; 78 u32 dummy;
79 79
80 if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) { 80 if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
81 pr_warning("microcode: CPU%d: AMD CPU family 0x%x not " 81 pr_warning("CPU%d: family %d not supported\n", cpu, c->x86);
82 "supported\n", cpu, c->x86);
83 return -1; 82 return -1;
84 } 83 }
84
85 rdmsr(MSR_AMD64_PATCH_LEVEL, csig->rev, dummy); 85 rdmsr(MSR_AMD64_PATCH_LEVEL, csig->rev, dummy);
86 pr_info("CPU%d: patch_level=0x%x\n", cpu, csig->rev); 86 pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev);
87
87 return 0; 88 return 0;
88} 89}
89 90
@@ -113,7 +114,7 @@ static int get_matching_microcode(int cpu, struct microcode_header_amd *mc_hdr,
113 114
114 /* ucode might be chipset specific -- currently we don't support this */ 115 /* ucode might be chipset specific -- currently we don't support this */
115 if (mc_hdr->nb_dev_id || mc_hdr->sb_dev_id) { 116 if (mc_hdr->nb_dev_id || mc_hdr->sb_dev_id) {
116 pr_err("CPU%d: loading of chipset specific code not yet supported\n", 117 pr_err("CPU%d: chipset specific code not yet supported\n",
117 cpu); 118 cpu);
118 return 0; 119 return 0;
119 } 120 }
@@ -143,12 +144,12 @@ static int apply_microcode_amd(int cpu)
143 144
144 /* check current patch id and patch's id for match */ 145 /* check current patch id and patch's id for match */
145 if (rev != mc_amd->hdr.patch_id) { 146 if (rev != mc_amd->hdr.patch_id) {
146 pr_err("CPU%d: update failed (for patch_level=0x%x)\n", 147 pr_err("CPU%d: update failed for patch_level=0x%08x\n",
147 cpu, mc_amd->hdr.patch_id); 148 cpu, mc_amd->hdr.patch_id);
148 return -1; 149 return -1;
149 } 150 }
150 151
151 pr_info("CPU%d: updated (new patch_level=0x%x)\n", cpu, rev); 152 pr_info("CPU%d: new patch_level=0x%08x\n", cpu, rev);
152 uci->cpu_sig.rev = rev; 153 uci->cpu_sig.rev = rev;
153 154
154 return 0; 155 return 0;
@@ -161,14 +162,14 @@ get_next_ucode(const u8 *buf, unsigned int size, unsigned int *mc_size)
161 unsigned int total_size; 162 unsigned int total_size;
162 163
163 if (buf[0] != UCODE_UCODE_TYPE) { 164 if (buf[0] != UCODE_UCODE_TYPE) {
164 pr_err("error: invalid type field in container file section header\n"); 165 pr_err("invalid type field in container file section header\n");
165 return NULL; 166 return NULL;
166 } 167 }
167 168
168 total_size = buf[4] + (buf[5] << 8); 169 total_size = buf[4] + (buf[5] << 8);
169 170
170 if (total_size > size || total_size > UCODE_MAX_SIZE) { 171 if (total_size > size || total_size > UCODE_MAX_SIZE) {
171 pr_err("error: size mismatch\n"); 172 pr_err("section size mismatch\n");
172 return NULL; 173 return NULL;
173 } 174 }
174 175
@@ -189,7 +190,8 @@ static int install_equiv_cpu_table(const u8 *buf)
189 unsigned int size = ibuf[2]; 190 unsigned int size = ibuf[2];
190 191
191 if (type != UCODE_EQUIV_CPU_TABLE_TYPE || !size) { 192 if (type != UCODE_EQUIV_CPU_TABLE_TYPE || !size) {
192 pr_err("error: invalid type field in container file section header\n"); 193 pr_err("empty section/"
194 "invalid type field in container file section header\n");
193 return -EINVAL; 195 return -EINVAL;
194 } 196 }
195 197
@@ -219,7 +221,7 @@ generic_load_microcode(int cpu, const u8 *data, size_t size)
219 unsigned long offset; 221 unsigned long offset;
220 const u8 *ucode_ptr = data; 222 const u8 *ucode_ptr = data;
221 void *new_mc = NULL; 223 void *new_mc = NULL;
222 int new_rev = uci->cpu_sig.rev; 224 unsigned int new_rev = uci->cpu_sig.rev;
223 enum ucode_state state = UCODE_OK; 225 enum ucode_state state = UCODE_OK;
224 226
225 offset = install_equiv_cpu_table(ucode_ptr); 227 offset = install_equiv_cpu_table(ucode_ptr);
@@ -255,8 +257,8 @@ generic_load_microcode(int cpu, const u8 *data, size_t size)
255 if (!leftover) { 257 if (!leftover) {
256 vfree(uci->mc); 258 vfree(uci->mc);
257 uci->mc = new_mc; 259 uci->mc = new_mc;
258 pr_debug("CPU%d update ucode to version 0x%x (from 0x%x)\n", 260 pr_debug("CPU%d update ucode (0x%08x -> 0x%08x)\n",
259 cpu, new_rev, uci->cpu_sig.rev); 261 cpu, uci->cpu_sig.rev, new_rev);
260 } else { 262 } else {
261 vfree(new_mc); 263 vfree(new_mc);
262 state = UCODE_ERROR; 264 state = UCODE_ERROR;
@@ -275,13 +277,13 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device)
275 enum ucode_state ret = UCODE_NFOUND; 277 enum ucode_state ret = UCODE_NFOUND;
276 278
277 if (request_firmware(&fw, fw_name, device)) { 279 if (request_firmware(&fw, fw_name, device)) {
278 printk(KERN_ERR "microcode: failed to load file %s\n", fw_name); 280 pr_err("failed to load file %s\n", fw_name);
279 goto out; 281 goto out;
280 } 282 }
281 283
282 ret = UCODE_ERROR; 284 ret = UCODE_ERROR;
283 if (*(u32 *)fw->data != UCODE_MAGIC) { 285 if (*(u32 *)fw->data != UCODE_MAGIC) {
284 pr_err("Invalid UCODE_MAGIC (0x%08x)\n", *(u32 *)fw->data); 286 pr_err("invalid magic value (0x%08x)\n", *(u32 *)fw->data);
285 goto fw_release; 287 goto fw_release;
286 } 288 }
287 289