diff options
author | Don Zickus <dzickus@redhat.com> | 2006-09-26 04:52:26 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-26 04:52:26 -0400 |
commit | 3adbbcce9a49b900d4cc118cdccfdefa78bf1afb (patch) | |
tree | 3163758ed23d973a54b396593957c63470f39a0d /arch/i386/kernel/nmi.c | |
parent | b7471c6da94d30d3deadc55986cc38d1ff57f9ca (diff) |
[PATCH] x86: Cleanup NMI interrupt path
This patch cleans up the NMI interrupt path. Instead of being gated by if
the 'nmi callback' is set, the interrupt handler now calls everyone who is
registered on the die_chain and additionally checks the nmi watchdog,
reseting it if enabled. This allows more subsystems to hook into the NMI if
they need to (without being block by set_nmi_callback).
Signed-off-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch/i386/kernel/nmi.c')
-rw-r--r-- | arch/i386/kernel/nmi.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c index d88004343034..bd96ea4f2942 100644 --- a/arch/i386/kernel/nmi.c +++ b/arch/i386/kernel/nmi.c | |||
@@ -781,7 +781,7 @@ EXPORT_SYMBOL(touch_nmi_watchdog); | |||
781 | 781 | ||
782 | extern void die_nmi(struct pt_regs *, const char *msg); | 782 | extern void die_nmi(struct pt_regs *, const char *msg); |
783 | 783 | ||
784 | void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason) | 784 | int nmi_watchdog_tick (struct pt_regs * regs, unsigned reason) |
785 | { | 785 | { |
786 | 786 | ||
787 | /* | 787 | /* |
@@ -794,10 +794,12 @@ void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason) | |||
794 | int cpu = smp_processor_id(); | 794 | int cpu = smp_processor_id(); |
795 | struct nmi_watchdog_ctlblk *wd = &__get_cpu_var(nmi_watchdog_ctlblk); | 795 | struct nmi_watchdog_ctlblk *wd = &__get_cpu_var(nmi_watchdog_ctlblk); |
796 | u64 dummy; | 796 | u64 dummy; |
797 | int rc=0; | ||
797 | 798 | ||
798 | /* check for other users first */ | 799 | /* check for other users first */ |
799 | if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) | 800 | if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT) |
800 | == NOTIFY_STOP) { | 801 | == NOTIFY_STOP) { |
802 | rc = 1; | ||
801 | touched = 1; | 803 | touched = 1; |
802 | } | 804 | } |
803 | 805 | ||
@@ -850,10 +852,18 @@ void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason) | |||
850 | } | 852 | } |
851 | /* start the cycle over again */ | 853 | /* start the cycle over again */ |
852 | write_watchdog_counter(wd->perfctr_msr, NULL); | 854 | write_watchdog_counter(wd->perfctr_msr, NULL); |
853 | } | 855 | rc = 1; |
856 | } else if (nmi_watchdog == NMI_IO_APIC) { | ||
857 | /* don't know how to accurately check for this. | ||
858 | * just assume it was a watchdog timer interrupt | ||
859 | * This matches the old behaviour. | ||
860 | */ | ||
861 | rc = 1; | ||
862 | } else | ||
863 | printk(KERN_WARNING "Unknown enabled NMI hardware?!\n"); | ||
854 | } | 864 | } |
855 | done: | 865 | done: |
856 | return; | 866 | return rc; |
857 | } | 867 | } |
858 | 868 | ||
859 | #ifdef CONFIG_SYSCTL | 869 | #ifdef CONFIG_SYSCTL |