aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-31 11:59:46 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-31 11:59:46 -0500
commitab5318788c6725b6d5c95aff28e63af4c35a0e2c (patch)
treefb4a81d66ed06828948e3272ebe15088d405ec1e
parent14164b46fc994bcf82963ace00372cf808a31af1 (diff)
parent270750dbc18a71b23d660df110e433ff9616a2d4 (diff)
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core debug changes from Ingo Molnar: "This contains mostly kernel debugging related updates: - make hung_task detection more configurable to distros - add final bits for x86 UV NMI debugging, with related KGDB changes - update the mailing-list of MAINTAINERS entries I'm involved with" * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: hung_task: Display every hung task warning sysctl: Add neg_one as a standard constraint x86/uv/nmi, kgdb/kdb: Fix UV NMI handler when KDB not configured x86/uv/nmi: Fix Sparse warnings kgdb/kdb: Fix no KDB config problem MAINTAINERS: Restore "L: linux-kernel@vger.kernel.org" entries
-rw-r--r--Documentation/sysctl/kernel.txt42
-rw-r--r--MAINTAINERS13
-rw-r--r--arch/x86/include/asm/uv/uv.h2
-rw-r--r--arch/x86/kernel/apic/x2apic_uv_x.c1
-rw-r--r--arch/x86/platform/uv/uv_nmi.c65
-rw-r--r--include/linux/kgdb.h3
-rw-r--r--include/linux/sched/sysctl.h2
-rw-r--r--kernel/debug/debug_core.c5
-rw-r--r--kernel/debug/debug_core.h2
-rw-r--r--kernel/hung_task.c6
-rw-r--r--kernel/sysctl.c7
11 files changed, 116 insertions, 32 deletions
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index ee9a2f983b99..e55124e7c40c 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -33,6 +33,10 @@ show up in /proc/sys/kernel:
33- domainname 33- domainname
34- hostname 34- hostname
35- hotplug 35- hotplug
36- hung_task_panic
37- hung_task_check_count
38- hung_task_timeout_secs
39- hung_task_warnings
36- kexec_load_disabled 40- kexec_load_disabled
37- kptr_restrict 41- kptr_restrict
38- kstack_depth_to_print [ X86 only ] 42- kstack_depth_to_print [ X86 only ]
@@ -288,6 +292,44 @@ Default value is "/sbin/hotplug".
288 292
289============================================================== 293==============================================================
290 294
295hung_task_panic:
296
297Controls the kernel's behavior when a hung task is detected.
298This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
299
3000: continue operation. This is the default behavior.
301
3021: panic immediately.
303
304==============================================================
305
306hung_task_check_count:
307
308The upper bound on the number of tasks that are checked.
309This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
310
311==============================================================
312
313hung_task_timeout_secs:
314
315Check interval. When a task in D state did not get scheduled
316for more than this value report a warning.
317This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
318
3190: means infinite timeout - no checking done.
320
321==============================================================
322
323hung_task_warning:
324
325The maximum number of warnings to report. During a check interval
326When this value is reached, no more the warnings will be reported.
327This file shows up if CONFIG_DETECT_HUNG_TASK is enabled.
328
329-1: report an infinite number of warnings.
330
331==============================================================
332
291kexec_load_disabled: 333kexec_load_disabled:
292 334
293A toggle indicating if the kexec_load syscall has been disabled. This 335A toggle indicating if the kexec_load syscall has been disabled. This
diff --git a/MAINTAINERS b/MAINTAINERS
index 5f840aeab64d..6fb8759f49de 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2222,6 +2222,7 @@ F: include/linux/clk.h
2222CLOCKSOURCE, CLOCKEVENT DRIVERS 2222CLOCKSOURCE, CLOCKEVENT DRIVERS
2223M: Daniel Lezcano <daniel.lezcano@linaro.org> 2223M: Daniel Lezcano <daniel.lezcano@linaro.org>
2224M: Thomas Gleixner <tglx@linutronix.de> 2224M: Thomas Gleixner <tglx@linutronix.de>
2225L: linux-kernel@vger.kernel.org
2225T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core 2226T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
2226S: Supported 2227S: Supported
2227F: drivers/clocksource 2228F: drivers/clocksource
@@ -4023,6 +4024,7 @@ F: include/uapi/linux/hid*
4023 4024
4024HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS 4025HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS
4025M: Thomas Gleixner <tglx@linutronix.de> 4026M: Thomas Gleixner <tglx@linutronix.de>
4027L: linux-kernel@vger.kernel.org
4026T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core 4028T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
4027S: Maintained 4029S: Maintained
4028F: Documentation/timers/ 4030F: Documentation/timers/
@@ -4694,6 +4696,7 @@ F: net/irda/
4694 4696
4695IRQ SUBSYSTEM 4697IRQ SUBSYSTEM
4696M: Thomas Gleixner <tglx@linutronix.de> 4698M: Thomas Gleixner <tglx@linutronix.de>
4699L: linux-kernel@vger.kernel.org
4697S: Maintained 4700S: Maintained
4698T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core 4701T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core
4699F: kernel/irq/ 4702F: kernel/irq/
@@ -5325,6 +5328,7 @@ F: drivers/media/usb/dvb-usb-v2/lmedm04*
5325LOCKDEP AND LOCKSTAT 5328LOCKDEP AND LOCKSTAT
5326M: Peter Zijlstra <peterz@infradead.org> 5329M: Peter Zijlstra <peterz@infradead.org>
5327M: Ingo Molnar <mingo@redhat.com> 5330M: Ingo Molnar <mingo@redhat.com>
5331L: linux-kernel@vger.kernel.org
5328T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/locking 5332T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/locking
5329S: Maintained 5333S: Maintained
5330F: Documentation/lockdep*.txt 5334F: Documentation/lockdep*.txt
@@ -6622,6 +6626,7 @@ M: Peter Zijlstra <a.p.zijlstra@chello.nl>
6622M: Paul Mackerras <paulus@samba.org> 6626M: Paul Mackerras <paulus@samba.org>
6623M: Ingo Molnar <mingo@redhat.com> 6627M: Ingo Molnar <mingo@redhat.com>
6624M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> 6628M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
6629L: linux-kernel@vger.kernel.org
6625T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core 6630T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core
6626S: Supported 6631S: Supported
6627F: kernel/events/* 6632F: kernel/events/*
@@ -6745,6 +6750,7 @@ F: drivers/scsi/pm8001/
6745 6750
6746POSIX CLOCKS and TIMERS 6751POSIX CLOCKS and TIMERS
6747M: Thomas Gleixner <tglx@linutronix.de> 6752M: Thomas Gleixner <tglx@linutronix.de>
6753L: linux-kernel@vger.kernel.org
6748T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core 6754T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
6749S: Supported 6755S: Supported
6750F: fs/timerfd.c 6756F: fs/timerfd.c
@@ -7153,6 +7159,7 @@ F: drivers/net/wireless/ray*
7153RCUTORTURE MODULE 7159RCUTORTURE MODULE
7154M: Josh Triplett <josh@freedesktop.org> 7160M: Josh Triplett <josh@freedesktop.org>
7155M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> 7161M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
7162L: linux-kernel@vger.kernel.org
7156S: Supported 7163S: Supported
7157T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git 7164T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
7158F: Documentation/RCU/torture.txt 7165F: Documentation/RCU/torture.txt
@@ -7160,6 +7167,7 @@ F: kernel/rcu/torture.c
7160 7167
7161RCUTORTURE TEST FRAMEWORK 7168RCUTORTURE TEST FRAMEWORK
7162M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> 7169M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
7170L: linux-kernel@vger.kernel.org
7163S: Supported 7171S: Supported
7164T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git 7172T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
7165F: tools/testing/selftests/rcutorture 7173F: tools/testing/selftests/rcutorture
@@ -7183,6 +7191,7 @@ F: net/rds/
7183READ-COPY UPDATE (RCU) 7191READ-COPY UPDATE (RCU)
7184M: Dipankar Sarma <dipankar@in.ibm.com> 7192M: Dipankar Sarma <dipankar@in.ibm.com>
7185M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> 7193M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
7194L: linux-kernel@vger.kernel.org
7186W: http://www.rdrop.com/users/paulmck/RCU/ 7195W: http://www.rdrop.com/users/paulmck/RCU/
7187S: Supported 7196S: Supported
7188T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git 7197T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
@@ -7492,6 +7501,7 @@ F: drivers/mmc/host/dw_mmc*
7492TIMEKEEPING, CLOCKSOURCE CORE, NTP 7501TIMEKEEPING, CLOCKSOURCE CORE, NTP
7493M: John Stultz <john.stultz@linaro.org> 7502M: John Stultz <john.stultz@linaro.org>
7494M: Thomas Gleixner <tglx@linutronix.de> 7503M: Thomas Gleixner <tglx@linutronix.de>
7504L: linux-kernel@vger.kernel.org
7495T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core 7505T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
7496S: Supported 7506S: Supported
7497F: include/linux/clocksource.h 7507F: include/linux/clocksource.h
@@ -7517,6 +7527,7 @@ F: drivers/watchdog/sc1200wdt.c
7517SCHEDULER 7527SCHEDULER
7518M: Ingo Molnar <mingo@redhat.com> 7528M: Ingo Molnar <mingo@redhat.com>
7519M: Peter Zijlstra <peterz@infradead.org> 7529M: Peter Zijlstra <peterz@infradead.org>
7530L: linux-kernel@vger.kernel.org
7520T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core 7531T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core
7521S: Maintained 7532S: Maintained
7522F: kernel/sched/ 7533F: kernel/sched/
@@ -7884,6 +7895,7 @@ F: mm/sl?b.c
7884SLEEPABLE READ-COPY UPDATE (SRCU) 7895SLEEPABLE READ-COPY UPDATE (SRCU)
7885M: Lai Jiangshan <laijs@cn.fujitsu.com> 7896M: Lai Jiangshan <laijs@cn.fujitsu.com>
7886M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> 7897M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
7898L: linux-kernel@vger.kernel.org
7887W: http://www.rdrop.com/users/paulmck/RCU/ 7899W: http://www.rdrop.com/users/paulmck/RCU/
7888S: Supported 7900S: Supported
7889T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git 7901T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
@@ -9587,6 +9599,7 @@ M: Thomas Gleixner <tglx@linutronix.de>
9587M: Ingo Molnar <mingo@redhat.com> 9599M: Ingo Molnar <mingo@redhat.com>
9588M: "H. Peter Anvin" <hpa@zytor.com> 9600M: "H. Peter Anvin" <hpa@zytor.com>
9589M: x86@kernel.org 9601M: x86@kernel.org
9602L: linux-kernel@vger.kernel.org
9590T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core 9603T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core
9591S: Maintained 9604S: Maintained
9592F: Documentation/x86/ 9605F: Documentation/x86/
diff --git a/arch/x86/include/asm/uv/uv.h b/arch/x86/include/asm/uv/uv.h
index 6b964a0b86d1..062921ef34e9 100644
--- a/arch/x86/include/asm/uv/uv.h
+++ b/arch/x86/include/asm/uv/uv.h
@@ -12,7 +12,6 @@ extern enum uv_system_type get_uv_system_type(void);
12extern int is_uv_system(void); 12extern int is_uv_system(void);
13extern void uv_cpu_init(void); 13extern void uv_cpu_init(void);
14extern void uv_nmi_init(void); 14extern void uv_nmi_init(void);
15extern void uv_register_nmi_notifier(void);
16extern void uv_system_init(void); 15extern void uv_system_init(void);
17extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, 16extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
18 struct mm_struct *mm, 17 struct mm_struct *mm,
@@ -26,7 +25,6 @@ static inline enum uv_system_type get_uv_system_type(void) { return UV_NONE; }
26static inline int is_uv_system(void) { return 0; } 25static inline int is_uv_system(void) { return 0; }
27static inline void uv_cpu_init(void) { } 26static inline void uv_cpu_init(void) { }
28static inline void uv_system_init(void) { } 27static inline void uv_system_init(void) { }
29static inline void uv_register_nmi_notifier(void) { }
30static inline const struct cpumask * 28static inline const struct cpumask *
31uv_flush_tlb_others(const struct cpumask *cpumask, struct mm_struct *mm, 29uv_flush_tlb_others(const struct cpumask *cpumask, struct mm_struct *mm,
32 unsigned long start, unsigned long end, unsigned int cpu) 30 unsigned long start, unsigned long end, unsigned int cpu)
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c
index ad0dc0428baf..d263b1307de1 100644
--- a/arch/x86/kernel/apic/x2apic_uv_x.c
+++ b/arch/x86/kernel/apic/x2apic_uv_x.c
@@ -980,7 +980,6 @@ void __init uv_system_init(void)
980 uv_nmi_setup(); 980 uv_nmi_setup();
981 uv_cpu_init(); 981 uv_cpu_init();
982 uv_scir_register_cpu_notifier(); 982 uv_scir_register_cpu_notifier();
983 uv_register_nmi_notifier();
984 proc_mkdir("sgi_uv", NULL); 983 proc_mkdir("sgi_uv", NULL);
985 984
986 /* register Legacy VGA I/O redirection handler */ 985 /* register Legacy VGA I/O redirection handler */
diff --git a/arch/x86/platform/uv/uv_nmi.c b/arch/x86/platform/uv/uv_nmi.c
index 8eeccba73130..be27da60dc8f 100644
--- a/arch/x86/platform/uv/uv_nmi.c
+++ b/arch/x86/platform/uv/uv_nmi.c
@@ -74,7 +74,6 @@ static atomic_t uv_in_nmi;
74static atomic_t uv_nmi_cpu = ATOMIC_INIT(-1); 74static atomic_t uv_nmi_cpu = ATOMIC_INIT(-1);
75static atomic_t uv_nmi_cpus_in_nmi = ATOMIC_INIT(-1); 75static atomic_t uv_nmi_cpus_in_nmi = ATOMIC_INIT(-1);
76static atomic_t uv_nmi_slave_continue; 76static atomic_t uv_nmi_slave_continue;
77static atomic_t uv_nmi_kexec_failed;
78static cpumask_var_t uv_nmi_cpu_mask; 77static cpumask_var_t uv_nmi_cpu_mask;
79 78
80/* Values for uv_nmi_slave_continue */ 79/* Values for uv_nmi_slave_continue */
@@ -149,7 +148,8 @@ module_param_named(retry_count, uv_nmi_retry_count, int, 0644);
149 * "dump" - dump process stack for each cpu 148 * "dump" - dump process stack for each cpu
150 * "ips" - dump IP info for each cpu 149 * "ips" - dump IP info for each cpu
151 * "kdump" - do crash dump 150 * "kdump" - do crash dump
152 * "kdb" - enter KDB/KGDB (default) 151 * "kdb" - enter KDB (default)
152 * "kgdb" - enter KGDB
153 */ 153 */
154static char uv_nmi_action[8] = "kdb"; 154static char uv_nmi_action[8] = "kdb";
155module_param_string(action, uv_nmi_action, sizeof(uv_nmi_action), 0644); 155module_param_string(action, uv_nmi_action, sizeof(uv_nmi_action), 0644);
@@ -504,6 +504,7 @@ static void uv_nmi_touch_watchdogs(void)
504} 504}
505 505
506#if defined(CONFIG_KEXEC) 506#if defined(CONFIG_KEXEC)
507static atomic_t uv_nmi_kexec_failed;
507static void uv_nmi_kdump(int cpu, int master, struct pt_regs *regs) 508static void uv_nmi_kdump(int cpu, int master, struct pt_regs *regs)
508{ 509{
509 /* Call crash to dump system state */ 510 /* Call crash to dump system state */
@@ -537,18 +538,45 @@ static inline void uv_nmi_kdump(int cpu, int master, struct pt_regs *regs)
537} 538}
538#endif /* !CONFIG_KEXEC */ 539#endif /* !CONFIG_KEXEC */
539 540
541#ifdef CONFIG_KGDB
540#ifdef CONFIG_KGDB_KDB 542#ifdef CONFIG_KGDB_KDB
541/* Call KDB from NMI handler */ 543static inline int uv_nmi_kdb_reason(void)
542static void uv_call_kdb(int cpu, struct pt_regs *regs, int master)
543{ 544{
544 int ret; 545 return KDB_REASON_SYSTEM_NMI;
546}
547#else /* !CONFIG_KGDB_KDB */
548static inline int uv_nmi_kdb_reason(void)
549{
550 /* Insure user is expecting to attach gdb remote */
551 if (uv_nmi_action_is("kgdb"))
552 return 0;
553
554 pr_err("UV: NMI error: KDB is not enabled in this kernel\n");
555 return -1;
556}
557#endif /* CONFIG_KGDB_KDB */
545 558
559/*
560 * Call KGDB/KDB from NMI handler
561 *
562 * Note that if both KGDB and KDB are configured, then the action of 'kgdb' or
563 * 'kdb' has no affect on which is used. See the KGDB documention for further
564 * information.
565 */
566static void uv_call_kgdb_kdb(int cpu, struct pt_regs *regs, int master)
567{
546 if (master) { 568 if (master) {
569 int reason = uv_nmi_kdb_reason();
570 int ret;
571
572 if (reason < 0)
573 return;
574
547 /* call KGDB NMI handler as MASTER */ 575 /* call KGDB NMI handler as MASTER */
548 ret = kgdb_nmicallin(cpu, X86_TRAP_NMI, regs, 576 ret = kgdb_nmicallin(cpu, X86_TRAP_NMI, regs, reason,
549 &uv_nmi_slave_continue); 577 &uv_nmi_slave_continue);
550 if (ret) { 578 if (ret) {
551 pr_alert("KDB returned error, is kgdboc set?\n"); 579 pr_alert("KGDB returned error, is kgdboc set?\n");
552 atomic_set(&uv_nmi_slave_continue, SLAVE_EXIT); 580 atomic_set(&uv_nmi_slave_continue, SLAVE_EXIT);
553 } 581 }
554 } else { 582 } else {
@@ -567,12 +595,12 @@ static void uv_call_kdb(int cpu, struct pt_regs *regs, int master)
567 uv_nmi_sync_exit(master); 595 uv_nmi_sync_exit(master);
568} 596}
569 597
570#else /* !CONFIG_KGDB_KDB */ 598#else /* !CONFIG_KGDB */
571static inline void uv_call_kdb(int cpu, struct pt_regs *regs, int master) 599static inline void uv_call_kgdb_kdb(int cpu, struct pt_regs *regs, int master)
572{ 600{
573 pr_err("UV: NMI error: KGDB/KDB is not enabled in this kernel\n"); 601 pr_err("UV: NMI error: KGDB is not enabled in this kernel\n");
574} 602}
575#endif /* !CONFIG_KGDB_KDB */ 603#endif /* !CONFIG_KGDB */
576 604
577/* 605/*
578 * UV NMI handler 606 * UV NMI handler
@@ -606,9 +634,9 @@ int uv_handle_nmi(unsigned int reason, struct pt_regs *regs)
606 if (uv_nmi_action_is("ips") || uv_nmi_action_is("dump")) 634 if (uv_nmi_action_is("ips") || uv_nmi_action_is("dump"))
607 uv_nmi_dump_state(cpu, regs, master); 635 uv_nmi_dump_state(cpu, regs, master);
608 636
609 /* Call KDB if enabled */ 637 /* Call KGDB/KDB if enabled */
610 else if (uv_nmi_action_is("kdb")) 638 else if (uv_nmi_action_is("kdb") || uv_nmi_action_is("kgdb"))
611 uv_call_kdb(cpu, regs, master); 639 uv_call_kgdb_kdb(cpu, regs, master);
612 640
613 /* Clear per_cpu "in nmi" flag */ 641 /* Clear per_cpu "in nmi" flag */
614 atomic_set(&uv_cpu_nmi.state, UV_NMI_STATE_OUT); 642 atomic_set(&uv_cpu_nmi.state, UV_NMI_STATE_OUT);
@@ -634,7 +662,7 @@ int uv_handle_nmi(unsigned int reason, struct pt_regs *regs)
634/* 662/*
635 * NMI handler for pulling in CPUs when perf events are grabbing our NMI 663 * NMI handler for pulling in CPUs when perf events are grabbing our NMI
636 */ 664 */
637int uv_handle_nmi_ping(unsigned int reason, struct pt_regs *regs) 665static int uv_handle_nmi_ping(unsigned int reason, struct pt_regs *regs)
638{ 666{
639 int ret; 667 int ret;
640 668
@@ -651,7 +679,7 @@ int uv_handle_nmi_ping(unsigned int reason, struct pt_regs *regs)
651 return ret; 679 return ret;
652} 680}
653 681
654void uv_register_nmi_notifier(void) 682static void uv_register_nmi_notifier(void)
655{ 683{
656 if (register_nmi_handler(NMI_UNKNOWN, uv_handle_nmi, 0, "uv")) 684 if (register_nmi_handler(NMI_UNKNOWN, uv_handle_nmi, 0, "uv"))
657 pr_warn("UV: NMI handler failed to register\n"); 685 pr_warn("UV: NMI handler failed to register\n");
@@ -695,6 +723,5 @@ void uv_nmi_setup(void)
695 uv_hub_nmi_per(cpu) = uv_hub_nmi_list[nid]; 723 uv_hub_nmi_per(cpu) = uv_hub_nmi_list[nid];
696 } 724 }
697 BUG_ON(!alloc_cpumask_var(&uv_nmi_cpu_mask, GFP_KERNEL)); 725 BUG_ON(!alloc_cpumask_var(&uv_nmi_cpu_mask, GFP_KERNEL));
726 uv_register_nmi_notifier();
698} 727}
699
700
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index dfb4f2ffdaa2..6b06d378f3df 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -310,7 +310,8 @@ extern int
310kgdb_handle_exception(int ex_vector, int signo, int err_code, 310kgdb_handle_exception(int ex_vector, int signo, int err_code,
311 struct pt_regs *regs); 311 struct pt_regs *regs);
312extern int kgdb_nmicallback(int cpu, void *regs); 312extern int kgdb_nmicallback(int cpu, void *regs);
313extern int kgdb_nmicallin(int cpu, int trapnr, void *regs, atomic_t *snd_rdy); 313extern int kgdb_nmicallin(int cpu, int trapnr, void *regs, int err_code,
314 atomic_t *snd_rdy);
314extern void gdbstub_exit(int status); 315extern void gdbstub_exit(int status);
315 316
316extern int kgdb_single_step; 317extern int kgdb_single_step;
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h
index b13cf430764f..8045a554cafb 100644
--- a/include/linux/sched/sysctl.h
+++ b/include/linux/sched/sysctl.h
@@ -5,7 +5,7 @@
5extern int sysctl_hung_task_check_count; 5extern int sysctl_hung_task_check_count;
6extern unsigned int sysctl_hung_task_panic; 6extern unsigned int sysctl_hung_task_panic;
7extern unsigned long sysctl_hung_task_timeout_secs; 7extern unsigned long sysctl_hung_task_timeout_secs;
8extern unsigned long sysctl_hung_task_warnings; 8extern int sysctl_hung_task_warnings;
9extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, 9extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write,
10 void __user *buffer, 10 void __user *buffer,
11 size_t *lenp, loff_t *ppos); 11 size_t *lenp, loff_t *ppos);
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c
index 7d2f35e5df2f..334b3980ffc1 100644
--- a/kernel/debug/debug_core.c
+++ b/kernel/debug/debug_core.c
@@ -736,7 +736,8 @@ int kgdb_nmicallback(int cpu, void *regs)
736 return 1; 736 return 1;
737} 737}
738 738
739int kgdb_nmicallin(int cpu, int trapnr, void *regs, atomic_t *send_ready) 739int kgdb_nmicallin(int cpu, int trapnr, void *regs, int err_code,
740 atomic_t *send_ready)
740{ 741{
741#ifdef CONFIG_SMP 742#ifdef CONFIG_SMP
742 if (!kgdb_io_ready(0) || !send_ready) 743 if (!kgdb_io_ready(0) || !send_ready)
@@ -750,7 +751,7 @@ int kgdb_nmicallin(int cpu, int trapnr, void *regs, atomic_t *send_ready)
750 ks->cpu = cpu; 751 ks->cpu = cpu;
751 ks->ex_vector = trapnr; 752 ks->ex_vector = trapnr;
752 ks->signo = SIGTRAP; 753 ks->signo = SIGTRAP;
753 ks->err_code = KGDB_KDB_REASON_SYSTEM_NMI; 754 ks->err_code = err_code;
754 ks->linux_regs = regs; 755 ks->linux_regs = regs;
755 ks->send_ready = send_ready; 756 ks->send_ready = send_ready;
756 kgdb_cpu_enter(ks, regs, DCPU_WANT_MASTER); 757 kgdb_cpu_enter(ks, regs, DCPU_WANT_MASTER);
diff --git a/kernel/debug/debug_core.h b/kernel/debug/debug_core.h
index 572aa4f5677c..127d9bc49fb4 100644
--- a/kernel/debug/debug_core.h
+++ b/kernel/debug/debug_core.h
@@ -75,13 +75,11 @@ extern int kdb_stub(struct kgdb_state *ks);
75extern int kdb_parse(const char *cmdstr); 75extern int kdb_parse(const char *cmdstr);
76extern int kdb_common_init_state(struct kgdb_state *ks); 76extern int kdb_common_init_state(struct kgdb_state *ks);
77extern int kdb_common_deinit_state(void); 77extern int kdb_common_deinit_state(void);
78#define KGDB_KDB_REASON_SYSTEM_NMI KDB_REASON_SYSTEM_NMI
79#else /* ! CONFIG_KGDB_KDB */ 78#else /* ! CONFIG_KGDB_KDB */
80static inline int kdb_stub(struct kgdb_state *ks) 79static inline int kdb_stub(struct kgdb_state *ks)
81{ 80{
82 return DBG_PASS_EVENT; 81 return DBG_PASS_EVENT;
83} 82}
84#define KGDB_KDB_REASON_SYSTEM_NMI 0
85#endif /* CONFIG_KGDB_KDB */ 83#endif /* CONFIG_KGDB_KDB */
86 84
87#endif /* _DEBUG_CORE_H_ */ 85#endif /* _DEBUG_CORE_H_ */
diff --git a/kernel/hung_task.c b/kernel/hung_task.c
index 9328b80eaf14..0b9c169d577f 100644
--- a/kernel/hung_task.c
+++ b/kernel/hung_task.c
@@ -37,7 +37,7 @@ int __read_mostly sysctl_hung_task_check_count = PID_MAX_LIMIT;
37 */ 37 */
38unsigned long __read_mostly sysctl_hung_task_timeout_secs = CONFIG_DEFAULT_HUNG_TASK_TIMEOUT; 38unsigned long __read_mostly sysctl_hung_task_timeout_secs = CONFIG_DEFAULT_HUNG_TASK_TIMEOUT;
39 39
40unsigned long __read_mostly sysctl_hung_task_warnings = 10; 40int __read_mostly sysctl_hung_task_warnings = 10;
41 41
42static int __read_mostly did_panic; 42static int __read_mostly did_panic;
43 43
@@ -98,7 +98,9 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
98 98
99 if (!sysctl_hung_task_warnings) 99 if (!sysctl_hung_task_warnings)
100 return; 100 return;
101 sysctl_hung_task_warnings--; 101
102 if (sysctl_hung_task_warnings > 0)
103 sysctl_hung_task_warnings--;
102 104
103 /* 105 /*
104 * Ok, the task did not get scheduled for more than 2 minutes, 106 * Ok, the task did not get scheduled for more than 2 minutes,
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 096db7452cbd..49e13e1f8fe6 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -121,6 +121,8 @@ extern int blk_iopoll_enabled;
121static int sixty = 60; 121static int sixty = 60;
122#endif 122#endif
123 123
124static int __maybe_unused neg_one = -1;
125
124static int zero; 126static int zero;
125static int __maybe_unused one = 1; 127static int __maybe_unused one = 1;
126static int __maybe_unused two = 2; 128static int __maybe_unused two = 2;
@@ -997,9 +999,10 @@ static struct ctl_table kern_table[] = {
997 { 999 {
998 .procname = "hung_task_warnings", 1000 .procname = "hung_task_warnings",
999 .data = &sysctl_hung_task_warnings, 1001 .data = &sysctl_hung_task_warnings,
1000 .maxlen = sizeof(unsigned long), 1002 .maxlen = sizeof(int),
1001 .mode = 0644, 1003 .mode = 0644,
1002 .proc_handler = proc_doulongvec_minmax, 1004 .proc_handler = proc_dointvec_minmax,
1005 .extra1 = &neg_one,
1003 }, 1006 },
1004#endif 1007#endif
1005#ifdef CONFIG_COMPAT 1008#ifdef CONFIG_COMPAT