All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH] x86/ucode: Drop the sanity check for interrupts being disabled
@ 2020-03-27 12:19 Andrew Cooper
  2020-03-27 12:37 ` Jan Beulich
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cooper @ 2020-03-27 12:19 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Wei Liu, Jan Beulich, Roger Pau Monné

Of the substantial number of things which can go wrong during microcode load,
this is not one.  Loading occurs entirely within the boundary of a single
WRMSR instruction.  Its certainly not a BUG()-worthy condition.

Xen has legitimate reasons to not want interrupts enabled at this point, but
that is to do with organising the system rendezvous.  As these are private low
level helpers invoked only from the microcode core logic, forgo the check
entirely.

While dropping system.h, clean up the processor.h include which was an
oversight in the previous header cleanup.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>

An ASSERT() would be one option, but I'd prefer to remove the include.
---
 xen/arch/x86/cpu/microcode/amd.c   | 4 ----
 xen/arch/x86/cpu/microcode/intel.c | 4 ----
 2 files changed, 8 deletions(-)

diff --git a/xen/arch/x86/cpu/microcode/amd.c b/xen/arch/x86/cpu/microcode/amd.c
index 01854be92c..9fe1a3c941 100644
--- a/xen/arch/x86/cpu/microcode/amd.c
+++ b/xen/arch/x86/cpu/microcode/amd.c
@@ -20,8 +20,6 @@
 
 #include <asm/hvm/svm/svm.h>
 #include <asm/msr.h>
-#include <asm/processor.h>
-#include <asm/system.h>
 
 #include "private.h"
 
@@ -237,8 +235,6 @@ static int apply_microcode(const struct microcode_patch *patch)
 
     hdr = patch->mpb;
 
-    BUG_ON(local_irq_is_enabled());
-
     hw_err = wrmsr_safe(MSR_AMD_PATCHLOADER, (unsigned long)hdr);
 
     /* get patch id after patching */
diff --git a/xen/arch/x86/cpu/microcode/intel.c b/xen/arch/x86/cpu/microcode/intel.c
index bd33f5bc9b..b8b28060f5 100644
--- a/xen/arch/x86/cpu/microcode/intel.c
+++ b/xen/arch/x86/cpu/microcode/intel.c
@@ -25,8 +25,6 @@
 #include <xen/init.h>
 
 #include <asm/msr.h>
-#include <asm/processor.h>
-#include <asm/system.h>
 
 #include "private.h"
 
@@ -304,8 +302,6 @@ static int apply_microcode(const struct microcode_patch *patch)
     if ( !match_cpu(patch) )
         return -EINVAL;
 
-    BUG_ON(local_irq_is_enabled());
-
     /* write microcode via MSR 0x79 */
     wrmsrl(MSR_IA32_UCODE_WRITE, (unsigned long)patch->data);
 
-- 
2.11.0



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

* Re: [Xen-devel] [PATCH] x86/ucode: Drop the sanity check for interrupts being disabled
  2020-03-27 12:19 [Xen-devel] [PATCH] x86/ucode: Drop the sanity check for interrupts being disabled Andrew Cooper
@ 2020-03-27 12:37 ` Jan Beulich
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Beulich @ 2020-03-27 12:37 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: Xen-devel, Wei Liu, Roger Pau Monné

On 27.03.2020 13:19, Andrew Cooper wrote:
> Of the substantial number of things which can go wrong during microcode load,
> this is not one.  Loading occurs entirely within the boundary of a single
> WRMSR instruction.  Its certainly not a BUG()-worthy condition.
> 
> Xen has legitimate reasons to not want interrupts enabled at this point, but
> that is to do with organising the system rendezvous.  As these are private low
> level helpers invoked only from the microcode core logic, forgo the check
> entirely.
> 
> While dropping system.h, clean up the processor.h include which was an
> oversight in the previous header cleanup.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>


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

end of thread, other threads:[~2020-03-27 12:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-27 12:19 [Xen-devel] [PATCH] x86/ucode: Drop the sanity check for interrupts being disabled Andrew Cooper
2020-03-27 12:37 ` Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.