From: Uwe Dannowski Date: Fri, 16 Feb 2018 13:19:54 +0000 (+0000) Subject: x86/microcode: Propagate microcode update errors X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=24882b38d640ff5260742bdb1f88bc92b4039392;p=people%2Fdariof%2Fxen.git x86/microcode: Propagate microcode update errors Errors on updating the microcode in the processor were silently dropped when invoked via the microcode_update hypercall. Also, the log message was misleading. Signed-off-by: Uwe Dannowski Reviewed-by: Stefan Nuernberger Reviewed-by: Martin Pohlack Reviewed-by: Amit Shah Reviewed-by: Andrew Cooper --- diff --git a/xen/arch/x86/microcode_intel.c b/xen/arch/x86/microcode_intel.c index c6b67e4fe7..9657575c29 100644 --- a/xen/arch/x86/microcode_intel.c +++ b/xen/arch/x86/microcode_intel.c @@ -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]); + "%#x to %#x failed. Resulting revision is %#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; }