diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-31 11:59:46 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-31 11:59:46 -0500 |
commit | ab5318788c6725b6d5c95aff28e63af4c35a0e2c (patch) | |
tree | fb4a81d66ed06828948e3272ebe15088d405ec1e | |
parent | 14164b46fc994bcf82963ace00372cf808a31af1 (diff) | |
parent | 270750dbc18a71b23d660df110e433ff9616a2d4 (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.txt | 42 | ||||
-rw-r--r-- | MAINTAINERS | 13 | ||||
-rw-r--r-- | arch/x86/include/asm/uv/uv.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/x2apic_uv_x.c | 1 | ||||
-rw-r--r-- | arch/x86/platform/uv/uv_nmi.c | 65 | ||||
-rw-r--r-- | include/linux/kgdb.h | 3 | ||||
-rw-r--r-- | include/linux/sched/sysctl.h | 2 | ||||
-rw-r--r-- | kernel/debug/debug_core.c | 5 | ||||
-rw-r--r-- | kernel/debug/debug_core.h | 2 | ||||
-rw-r--r-- | kernel/hung_task.c | 6 | ||||
-rw-r--r-- | kernel/sysctl.c | 7 |
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 | ||
295 | hung_task_panic: | ||
296 | |||
297 | Controls the kernel's behavior when a hung task is detected. | ||
298 | This file shows up if CONFIG_DETECT_HUNG_TASK is enabled. | ||
299 | |||
300 | 0: continue operation. This is the default behavior. | ||
301 | |||
302 | 1: panic immediately. | ||
303 | |||
304 | ============================================================== | ||
305 | |||
306 | hung_task_check_count: | ||
307 | |||
308 | The upper bound on the number of tasks that are checked. | ||
309 | This file shows up if CONFIG_DETECT_HUNG_TASK is enabled. | ||
310 | |||
311 | ============================================================== | ||
312 | |||
313 | hung_task_timeout_secs: | ||
314 | |||
315 | Check interval. When a task in D state did not get scheduled | ||
316 | for more than this value report a warning. | ||
317 | This file shows up if CONFIG_DETECT_HUNG_TASK is enabled. | ||
318 | |||
319 | 0: means infinite timeout - no checking done. | ||
320 | |||
321 | ============================================================== | ||
322 | |||
323 | hung_task_warning: | ||
324 | |||
325 | The maximum number of warnings to report. During a check interval | ||
326 | When this value is reached, no more the warnings will be reported. | ||
327 | This file shows up if CONFIG_DETECT_HUNG_TASK is enabled. | ||
328 | |||
329 | -1: report an infinite number of warnings. | ||
330 | |||
331 | ============================================================== | ||
332 | |||
291 | kexec_load_disabled: | 333 | kexec_load_disabled: |
292 | 334 | ||
293 | A toggle indicating if the kexec_load syscall has been disabled. This | 335 | A 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 | |||
2222 | CLOCKSOURCE, CLOCKEVENT DRIVERS | 2222 | CLOCKSOURCE, CLOCKEVENT DRIVERS |
2223 | M: Daniel Lezcano <daniel.lezcano@linaro.org> | 2223 | M: Daniel Lezcano <daniel.lezcano@linaro.org> |
2224 | M: Thomas Gleixner <tglx@linutronix.de> | 2224 | M: Thomas Gleixner <tglx@linutronix.de> |
2225 | L: linux-kernel@vger.kernel.org | ||
2225 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core | 2226 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core |
2226 | S: Supported | 2227 | S: Supported |
2227 | F: drivers/clocksource | 2228 | F: drivers/clocksource |
@@ -4023,6 +4024,7 @@ F: include/uapi/linux/hid* | |||
4023 | 4024 | ||
4024 | HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS | 4025 | HIGH-RESOLUTION TIMERS, CLOCKEVENTS, DYNTICKS |
4025 | M: Thomas Gleixner <tglx@linutronix.de> | 4026 | M: Thomas Gleixner <tglx@linutronix.de> |
4027 | L: linux-kernel@vger.kernel.org | ||
4026 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core | 4028 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core |
4027 | S: Maintained | 4029 | S: Maintained |
4028 | F: Documentation/timers/ | 4030 | F: Documentation/timers/ |
@@ -4694,6 +4696,7 @@ F: net/irda/ | |||
4694 | 4696 | ||
4695 | IRQ SUBSYSTEM | 4697 | IRQ SUBSYSTEM |
4696 | M: Thomas Gleixner <tglx@linutronix.de> | 4698 | M: Thomas Gleixner <tglx@linutronix.de> |
4699 | L: linux-kernel@vger.kernel.org | ||
4697 | S: Maintained | 4700 | S: Maintained |
4698 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core | 4701 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq/core |
4699 | F: kernel/irq/ | 4702 | F: kernel/irq/ |
@@ -5325,6 +5328,7 @@ F: drivers/media/usb/dvb-usb-v2/lmedm04* | |||
5325 | LOCKDEP AND LOCKSTAT | 5328 | LOCKDEP AND LOCKSTAT |
5326 | M: Peter Zijlstra <peterz@infradead.org> | 5329 | M: Peter Zijlstra <peterz@infradead.org> |
5327 | M: Ingo Molnar <mingo@redhat.com> | 5330 | M: Ingo Molnar <mingo@redhat.com> |
5331 | L: linux-kernel@vger.kernel.org | ||
5328 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/locking | 5332 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/locking |
5329 | S: Maintained | 5333 | S: Maintained |
5330 | F: Documentation/lockdep*.txt | 5334 | F: Documentation/lockdep*.txt |
@@ -6622,6 +6626,7 @@ M: Peter Zijlstra <a.p.zijlstra@chello.nl> | |||
6622 | M: Paul Mackerras <paulus@samba.org> | 6626 | M: Paul Mackerras <paulus@samba.org> |
6623 | M: Ingo Molnar <mingo@redhat.com> | 6627 | M: Ingo Molnar <mingo@redhat.com> |
6624 | M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> | 6628 | M: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> |
6629 | L: linux-kernel@vger.kernel.org | ||
6625 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core | 6630 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core |
6626 | S: Supported | 6631 | S: Supported |
6627 | F: kernel/events/* | 6632 | F: kernel/events/* |
@@ -6745,6 +6750,7 @@ F: drivers/scsi/pm8001/ | |||
6745 | 6750 | ||
6746 | POSIX CLOCKS and TIMERS | 6751 | POSIX CLOCKS and TIMERS |
6747 | M: Thomas Gleixner <tglx@linutronix.de> | 6752 | M: Thomas Gleixner <tglx@linutronix.de> |
6753 | L: linux-kernel@vger.kernel.org | ||
6748 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core | 6754 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core |
6749 | S: Supported | 6755 | S: Supported |
6750 | F: fs/timerfd.c | 6756 | F: fs/timerfd.c |
@@ -7153,6 +7159,7 @@ F: drivers/net/wireless/ray* | |||
7153 | RCUTORTURE MODULE | 7159 | RCUTORTURE MODULE |
7154 | M: Josh Triplett <josh@freedesktop.org> | 7160 | M: Josh Triplett <josh@freedesktop.org> |
7155 | M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> | 7161 | M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
7162 | L: linux-kernel@vger.kernel.org | ||
7156 | S: Supported | 7163 | S: Supported |
7157 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git | 7164 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git |
7158 | F: Documentation/RCU/torture.txt | 7165 | F: Documentation/RCU/torture.txt |
@@ -7160,6 +7167,7 @@ F: kernel/rcu/torture.c | |||
7160 | 7167 | ||
7161 | RCUTORTURE TEST FRAMEWORK | 7168 | RCUTORTURE TEST FRAMEWORK |
7162 | M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> | 7169 | M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
7170 | L: linux-kernel@vger.kernel.org | ||
7163 | S: Supported | 7171 | S: Supported |
7164 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git | 7172 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git |
7165 | F: tools/testing/selftests/rcutorture | 7173 | F: tools/testing/selftests/rcutorture |
@@ -7183,6 +7191,7 @@ F: net/rds/ | |||
7183 | READ-COPY UPDATE (RCU) | 7191 | READ-COPY UPDATE (RCU) |
7184 | M: Dipankar Sarma <dipankar@in.ibm.com> | 7192 | M: Dipankar Sarma <dipankar@in.ibm.com> |
7185 | M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> | 7193 | M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
7194 | L: linux-kernel@vger.kernel.org | ||
7186 | W: http://www.rdrop.com/users/paulmck/RCU/ | 7195 | W: http://www.rdrop.com/users/paulmck/RCU/ |
7187 | S: Supported | 7196 | S: Supported |
7188 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git | 7197 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git |
@@ -7492,6 +7501,7 @@ F: drivers/mmc/host/dw_mmc* | |||
7492 | TIMEKEEPING, CLOCKSOURCE CORE, NTP | 7501 | TIMEKEEPING, CLOCKSOURCE CORE, NTP |
7493 | M: John Stultz <john.stultz@linaro.org> | 7502 | M: John Stultz <john.stultz@linaro.org> |
7494 | M: Thomas Gleixner <tglx@linutronix.de> | 7503 | M: Thomas Gleixner <tglx@linutronix.de> |
7504 | L: linux-kernel@vger.kernel.org | ||
7495 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core | 7505 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core |
7496 | S: Supported | 7506 | S: Supported |
7497 | F: include/linux/clocksource.h | 7507 | F: include/linux/clocksource.h |
@@ -7517,6 +7527,7 @@ F: drivers/watchdog/sc1200wdt.c | |||
7517 | SCHEDULER | 7527 | SCHEDULER |
7518 | M: Ingo Molnar <mingo@redhat.com> | 7528 | M: Ingo Molnar <mingo@redhat.com> |
7519 | M: Peter Zijlstra <peterz@infradead.org> | 7529 | M: Peter Zijlstra <peterz@infradead.org> |
7530 | L: linux-kernel@vger.kernel.org | ||
7520 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core | 7531 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core |
7521 | S: Maintained | 7532 | S: Maintained |
7522 | F: kernel/sched/ | 7533 | F: kernel/sched/ |
@@ -7884,6 +7895,7 @@ F: mm/sl?b.c | |||
7884 | SLEEPABLE READ-COPY UPDATE (SRCU) | 7895 | SLEEPABLE READ-COPY UPDATE (SRCU) |
7885 | M: Lai Jiangshan <laijs@cn.fujitsu.com> | 7896 | M: Lai Jiangshan <laijs@cn.fujitsu.com> |
7886 | M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> | 7897 | M: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> |
7898 | L: linux-kernel@vger.kernel.org | ||
7887 | W: http://www.rdrop.com/users/paulmck/RCU/ | 7899 | W: http://www.rdrop.com/users/paulmck/RCU/ |
7888 | S: Supported | 7900 | S: Supported |
7889 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git | 7901 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git |
@@ -9587,6 +9599,7 @@ M: Thomas Gleixner <tglx@linutronix.de> | |||
9587 | M: Ingo Molnar <mingo@redhat.com> | 9599 | M: Ingo Molnar <mingo@redhat.com> |
9588 | M: "H. Peter Anvin" <hpa@zytor.com> | 9600 | M: "H. Peter Anvin" <hpa@zytor.com> |
9589 | M: x86@kernel.org | 9601 | M: x86@kernel.org |
9602 | L: linux-kernel@vger.kernel.org | ||
9590 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core | 9603 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core |
9591 | S: Maintained | 9604 | S: Maintained |
9592 | F: Documentation/x86/ | 9605 | F: 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); | |||
12 | extern int is_uv_system(void); | 12 | extern int is_uv_system(void); |
13 | extern void uv_cpu_init(void); | 13 | extern void uv_cpu_init(void); |
14 | extern void uv_nmi_init(void); | 14 | extern void uv_nmi_init(void); |
15 | extern void uv_register_nmi_notifier(void); | ||
16 | extern void uv_system_init(void); | 15 | extern void uv_system_init(void); |
17 | extern const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, | 16 | extern 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; } | |||
26 | static inline int is_uv_system(void) { return 0; } | 25 | static inline int is_uv_system(void) { return 0; } |
27 | static inline void uv_cpu_init(void) { } | 26 | static inline void uv_cpu_init(void) { } |
28 | static inline void uv_system_init(void) { } | 27 | static inline void uv_system_init(void) { } |
29 | static inline void uv_register_nmi_notifier(void) { } | ||
30 | static inline const struct cpumask * | 28 | static inline const struct cpumask * |
31 | uv_flush_tlb_others(const struct cpumask *cpumask, struct mm_struct *mm, | 29 | uv_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; | |||
74 | static atomic_t uv_nmi_cpu = ATOMIC_INIT(-1); | 74 | static atomic_t uv_nmi_cpu = ATOMIC_INIT(-1); |
75 | static atomic_t uv_nmi_cpus_in_nmi = ATOMIC_INIT(-1); | 75 | static atomic_t uv_nmi_cpus_in_nmi = ATOMIC_INIT(-1); |
76 | static atomic_t uv_nmi_slave_continue; | 76 | static atomic_t uv_nmi_slave_continue; |
77 | static atomic_t uv_nmi_kexec_failed; | ||
78 | static cpumask_var_t uv_nmi_cpu_mask; | 77 | static 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 | */ |
154 | static char uv_nmi_action[8] = "kdb"; | 154 | static char uv_nmi_action[8] = "kdb"; |
155 | module_param_string(action, uv_nmi_action, sizeof(uv_nmi_action), 0644); | 155 | module_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) |
507 | static atomic_t uv_nmi_kexec_failed; | ||
507 | static void uv_nmi_kdump(int cpu, int master, struct pt_regs *regs) | 508 | static 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 */ | 543 | static inline int uv_nmi_kdb_reason(void) |
542 | static 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 */ | ||
548 | static 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 | */ | ||
566 | static 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 */ |
571 | static inline void uv_call_kdb(int cpu, struct pt_regs *regs, int master) | 599 | static 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 | */ |
637 | int uv_handle_nmi_ping(unsigned int reason, struct pt_regs *regs) | 665 | static 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 | ||
654 | void uv_register_nmi_notifier(void) | 682 | static 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 | |||
310 | kgdb_handle_exception(int ex_vector, int signo, int err_code, | 310 | kgdb_handle_exception(int ex_vector, int signo, int err_code, |
311 | struct pt_regs *regs); | 311 | struct pt_regs *regs); |
312 | extern int kgdb_nmicallback(int cpu, void *regs); | 312 | extern int kgdb_nmicallback(int cpu, void *regs); |
313 | extern int kgdb_nmicallin(int cpu, int trapnr, void *regs, atomic_t *snd_rdy); | 313 | extern int kgdb_nmicallin(int cpu, int trapnr, void *regs, int err_code, |
314 | atomic_t *snd_rdy); | ||
314 | extern void gdbstub_exit(int status); | 315 | extern void gdbstub_exit(int status); |
315 | 316 | ||
316 | extern int kgdb_single_step; | 317 | extern 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 @@ | |||
5 | extern int sysctl_hung_task_check_count; | 5 | extern int sysctl_hung_task_check_count; |
6 | extern unsigned int sysctl_hung_task_panic; | 6 | extern unsigned int sysctl_hung_task_panic; |
7 | extern unsigned long sysctl_hung_task_timeout_secs; | 7 | extern unsigned long sysctl_hung_task_timeout_secs; |
8 | extern unsigned long sysctl_hung_task_warnings; | 8 | extern int sysctl_hung_task_warnings; |
9 | extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, | 9 | extern 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 | ||
739 | int kgdb_nmicallin(int cpu, int trapnr, void *regs, atomic_t *send_ready) | 739 | int 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); | |||
75 | extern int kdb_parse(const char *cmdstr); | 75 | extern int kdb_parse(const char *cmdstr); |
76 | extern int kdb_common_init_state(struct kgdb_state *ks); | 76 | extern int kdb_common_init_state(struct kgdb_state *ks); |
77 | extern int kdb_common_deinit_state(void); | 77 | extern 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 */ |
80 | static inline int kdb_stub(struct kgdb_state *ks) | 79 | static 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 | */ |
38 | unsigned long __read_mostly sysctl_hung_task_timeout_secs = CONFIG_DEFAULT_HUNG_TASK_TIMEOUT; | 38 | unsigned long __read_mostly sysctl_hung_task_timeout_secs = CONFIG_DEFAULT_HUNG_TASK_TIMEOUT; |
39 | 39 | ||
40 | unsigned long __read_mostly sysctl_hung_task_warnings = 10; | 40 | int __read_mostly sysctl_hung_task_warnings = 10; |
41 | 41 | ||
42 | static int __read_mostly did_panic; | 42 | static 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; | |||
121 | static int sixty = 60; | 121 | static int sixty = 60; |
122 | #endif | 122 | #endif |
123 | 123 | ||
124 | static int __maybe_unused neg_one = -1; | ||
125 | |||
124 | static int zero; | 126 | static int zero; |
125 | static int __maybe_unused one = 1; | 127 | static int __maybe_unused one = 1; |
126 | static int __maybe_unused two = 2; | 128 | static 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 |