Skip to content

Commit 992414a

Browse files
author
Ingo Molnar
committed
Merge branch 'locking/nmi' into locking/core, to pick up completed topic branch
Signed-off-by: Ingo Molnar <[email protected]>
2 parents a68415c + ed00495 commit 992414a

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

arch/x86/Kconfig.debug

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
config TRACE_IRQFLAGS_SUPPORT
44
def_bool y
55

6+
config TRACE_IRQFLAGS_NMI_SUPPORT
7+
def_bool y
8+
69
config EARLY_PRINTK_USB
710
bool
811

kernel/locking/lockdep.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3714,6 +3714,9 @@ void noinstr lockdep_hardirqs_on(unsigned long ip)
37143714
* and not rely on hardware state like normal interrupts.
37153715
*/
37163716
if (unlikely(in_nmi())) {
3717+
if (!IS_ENABLED(CONFIG_TRACE_IRQFLAGS_NMI))
3718+
return;
3719+
37173720
/*
37183721
* Skip:
37193722
* - recursion check, because NMI can hit lockdep;
@@ -3773,7 +3776,10 @@ void noinstr lockdep_hardirqs_off(unsigned long ip)
37733776
* they will restore the software state. This ensures the software
37743777
* state is consistent inside NMIs as well.
37753778
*/
3776-
if (unlikely(!in_nmi() && (current->lockdep_recursion & LOCKDEP_RECURSION_MASK)))
3779+
if (in_nmi()) {
3780+
if (!IS_ENABLED(CONFIG_TRACE_IRQFLAGS_NMI))
3781+
return;
3782+
} else if (current->lockdep_recursion & LOCKDEP_RECURSION_MASK)
37773783
return;
37783784

37793785
/*

lib/Kconfig.debug

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,11 +1326,17 @@ config WW_MUTEX_SELFTEST
13261326
endmenu # lock debugging
13271327

13281328
config TRACE_IRQFLAGS
1329+
depends on TRACE_IRQFLAGS_SUPPORT
13291330
bool
13301331
help
13311332
Enables hooks to interrupt enabling and disabling for
13321333
either tracing or lock debugging.
13331334

1335+
config TRACE_IRQFLAGS_NMI
1336+
def_bool y
1337+
depends on TRACE_IRQFLAGS
1338+
depends on TRACE_IRQFLAGS_NMI_SUPPORT
1339+
13341340
config STACKTRACE
13351341
bool "Stack backtrace support"
13361342
depends on STACKTRACE_SUPPORT

0 commit comments

Comments
 (0)