diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2012-11-15 09:54:38 +0000 |
---|---|---|
committer | Andrew Cooper <andrew.cooper3@citrix.com> | 2012-11-15 09:54:38 +0000 |
commit | 322cfce187c3b69b2f9bc56c5e81f6b6c893e13c (patch) | |
tree | f1ac751adf8110638a929991eb3fe0b31465c8ac /xen/arch/x86/nmi.c | |
parent | 65d41473da58c842c04ea4880630fd47e7c194ec (diff) | |
download | xen-322cfce187c3b69b2f9bc56c5e81f6b6c893e13c.tar.gz xen-322cfce187c3b69b2f9bc56c5e81f6b6c893e13c.tar.bz2 xen-322cfce187c3b69b2f9bc56c5e81f6b6c893e13c.zip |
x86/nmi: self_nmi() should not unconditionally enable interrupts
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>
Diffstat (limited to 'xen/arch/x86/nmi.c')
-rw-r--r-- | xen/arch/x86/nmi.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c index 6ee407f8b6..4fd6711e82 100644 --- a/xen/arch/x86/nmi.c +++ b/xen/arch/x86/nmi.c @@ -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) |