Skip to content

Commit

Permalink
x86/nmi: self_nmi() should not unconditionally enable interrupts
Browse files Browse the repository at this point in the history
It seems that all current callers have interrupts enabled, making the
code currently safe but dangerous.  Also, fix a trailing whitespace
issue.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
  • Loading branch information
andyhhp committed Nov 15, 2012
1 parent 6802624 commit fea4b10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions xen/arch/x86/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,14 @@ void nmi_watchdog_tick(struct cpu_user_regs * regs)
* 8-3 and 8-4 in IA32 Reference Manual Volume 3. We send the IPI to
* our own APIC ID explicitly which is valid.
*/
void self_nmi(void)
void self_nmi(void)
{
unsigned long flags;
u32 id = get_apic_id();
local_irq_disable();
local_irq_save(flags);
apic_wait_icr_idle();
apic_icr_write(APIC_DM_NMI | APIC_DEST_PHYSICAL, id);
local_irq_enable();
local_irq_restore(flags);
}

static void do_nmi_trigger(unsigned char key)
Expand Down

0 comments on commit fea4b10

Please sign in to comment.