xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Propagate microcode update errors
@ 2018-02-16 13:19 Peter Lawthers
  2018-02-16 13:25 ` Andrew Cooper
  2018-02-16 13:26 ` Shah, Amit
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Lawthers @ 2018-02-16 13:19 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, Jan Beulich, Amit Shah, David Woodhouse,
	Uwe Dannowski

From: Uwe Dannowski <uwed@amazon.de>

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 <uwed@amazon.de>
Reviewed-by: Stefan Nuernberger <snu@amazon.de>
Reviewed-by: Martin Pohlack <mpohlack@amazon.de>
CC: David Woodhouse <dwmw@amazon.co.uk>
CC: Amit Shah <aams@amazon.de>
CC: Jan Beulich <jbeulich@suse.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/microcode_intel.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/microcode_intel.c b/xen/arch/x86/microcode_intel.c
index c6b67e4..a9b0ff9 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]);
+                "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;
 }
-- 
2.7.3.AMZN


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Propagate microcode update errors
  2018-02-16 13:19 [PATCH] Propagate microcode update errors Peter Lawthers
@ 2018-02-16 13:25 ` Andrew Cooper
  2018-02-16 13:26 ` Shah, Amit
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2018-02-16 13:25 UTC (permalink / raw)
  To: Peter Lawthers, xen-devel
  Cc: Jan Beulich, Amit Shah, David Woodhouse, Uwe Dannowski

On 16/02/18 13:19, Peter Lawthers wrote:
> From: Uwe Dannowski <uwed@amazon.de>
>
> 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 <uwed@amazon.de>
> Reviewed-by: Stefan Nuernberger <snu@amazon.de>
> Reviewed-by: Martin Pohlack <mpohlack@amazon.de>
> CC: David Woodhouse <dwmw@amazon.co.uk>
> CC: Amit Shah <aams@amazon.de>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
>  xen/arch/x86/microcode_intel.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/x86/microcode_intel.c b/xen/arch/x86/microcode_intel.c
> index c6b67e4..a9b0ff9 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]);
> +                "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 <andrew.cooper3@citrix.com> and I
can fix these issues on commit.

> +                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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Propagate microcode update errors
  2018-02-16 13:19 [PATCH] Propagate microcode update errors Peter Lawthers
  2018-02-16 13:25 ` Andrew Cooper
@ 2018-02-16 13:26 ` Shah, Amit
  1 sibling, 0 replies; 3+ messages in thread
From: Shah, Amit @ 2018-02-16 13:26 UTC (permalink / raw)
  To: Lawthers, Peter, xen-devel@lists.xenproject.org
  Cc: andrew.cooper3@citrix.com, Dannowski, Uwe, Woodhouse, David,
	jbeulich@suse.com



On Fr, 2018-02-16 at 13:19 +0000, Peter Lawthers wrote:
> From: Uwe Dannowski <uwed@amazon.de>
> 
> 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 <uwed@amazon.de>
> Reviewed-by: Stefan Nuernberger <snu@amazon.de>
> Reviewed-by: Martin Pohlack <mpohlack@amazon.de>
> CC: David Woodhouse <dwmw@amazon.co.uk>
> CC: Amit Shah <aams@amazon.de>
> CC: Jan Beulich <jbeulich@suse.com>
> CC: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Amit Shah <aams@amazon.com>

-- 

				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
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-16 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-16 13:19 [PATCH] Propagate microcode update errors Peter Lawthers
2018-02-16 13:25 ` Andrew Cooper
2018-02-16 13:26 ` Shah, Amit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).