Skip to contentSkip to conversation

Propagate microcode update errors

PATCH In review Peter Lawthers 3 participants 3 messages Feb 16, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Propagate microcode update errors

From: Uwe Dannowski <[email protected]>

Errors on updating the microcode in the processor were silently dropped when invoked via the microcode_update hypercall. Also, the log message was misleading.

---
 xen/arch/x86/microcode_intel.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
xen/arch/x86/microcode_intel.c +3 -2
index c6b67e4..a9b0ff9 100644
@@ -309,7 +309,8 @@ static int apply_microcode(unsigned int cpu)
     if ( val[1] != uci->mc.mc_intel->hdr.rev )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "%#x to %#x failed\n", cpu_num, uci->cpu_sig.rev, val[1]);
+                "0x%x to 0x%x failed. Resulting revision is 0x%x.\n", cpu_num,
+                uci->cpu_sig.rev, uci->mc.mc_intel->hdr.rev, val[1]);
         return -EIO;
     }
     printk(KERN_INFO "microcode: CPU%d updated from revision "
@@ -387,7 +388,7 @@ static int cpu_request_microcode(unsigned int cpu, const void *buf,
         error = offset;
 
     if ( !error && matching_count )
-        apply_microcode(cpu);
+        error = apply_microcode(cpu);
 
     return error;
 }
Signature · 7 lines
2.7.3.AMZN


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw
Quoted 22 lines · Peter Lawthers

From: Uwe Dannowski <[email protected]>

Errors on updating the microcode in the processor were silently dropped when invoked via the microcode_update hypercall. Also, the log message was misleading.

---
 xen/arch/x86/microcode_intel.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
xen/arch/x86/microcode_intel.c +0 -0
index c6b67e4..a9b0ff9 100644

xen/arch/x86/microcode_intel.c static int apply_microcode(unsigned int cpu) · line 312

Quoted 5 lines
xen/arch/x86/microcode_intel.c +1 -1
@@ -309,7 +309,8 @@ static int apply_microcode(unsigned int cpu)
     if ( val[1] != uci->mc.mc_intel->hdr.rev )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "%#x to %#x failed\n", cpu_num, uci->cpu_sig.rev, val[1]);
+                "0x%x to 0x%x failed. Resulting revision is 0x%x.\n", cpu_num,

0x%x and %#x are identical, except the latter is shorter.  Also, there's some indentation issue.

Either way, Reviewed-by: Andrew Cooper <[email protected]> and I can fix these issues on commit.

xen/arch/x86/microcode_intel.c static int cpu_request_microcode(unsigned int cpu, const void *buf, · line 394

Quoted 13 lines
xen/arch/x86/microcode_intel.c +2 -1
+                uci->cpu_sig.rev, uci->mc.mc_intel->hdr.rev, val[1]);
         return -EIO;
     }
     printk(KERN_INFO "microcode: CPU%d updated from revision "
@@ -387,7 +388,7 @@ static int cpu_request_microcode(unsigned int cpu, const void *buf,
         error = offset;
 
     if ( !error && matching_count )
-        apply_microcode(cpu);
+        error = apply_microcode(cpu);
 
     return error;
 }

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by Amit Shah on v1 1/1
#2 lore raw
In reply to Peter Lawthers
Quoted 7 lines · Peter Lawthers

From: Uwe Dannowski <[email protected]>

Errors on updating the microcode in the processor were silently dropped when invoked via the microcode_update hypercall. Also, the log
message was misleading.

Quoted 7 lines
Signature · 11 lines
				Amit
Amazon Development Center Germany GmbH
Berlin - Dresden - Aachen
main office: Krausenstr. 38, 10117 Berlin
Geschaeftsfuehrer: Dr. Ralf Herbrich, Christian Schlaeger
Ust-ID: DE289237879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel