arch: make TRACE_IRQFLAGS_NMI_SUPPORT generic
authorMark Rutland <mark.rutland@arm.com>
Wed, 11 May 2022 13:17:32 +0000 (14:17 +0100)
committerWill Deacon <will@kernel.org>
Thu, 23 Jun 2022 14:39:21 +0000 (15:39 +0100)
On most architectures, IRQ flag tracing is disabled in NMI context, and
architectures need to define and select TRACE_IRQFLAGS_NMI_SUPPORT in
order to enable this.

Commit:

  859d069ee1ddd878 ("lockdep: Prepare for NMI IRQ state tracking")

Permitted IRQ flag tracing in NMI context, allowing lockdep to work in
NMI context where an architecture had suitable entry logic. At the time,
most architectures did not have such suitable entry logic, and this broke
lockdep on such architectures. Thus, this was partially disabled in
commit:

  ed00495333ccc80f ("locking/lockdep: Fix TRACE_IRQFLAGS vs. NMIs")

... with architectures needing to select TRACE_IRQFLAGS_NMI_SUPPORT to
enable IRQ flag tracing in NMI context.

Currently TRACE_IRQFLAGS_NMI_SUPPORT is defined under
arch/x86/Kconfig.debug. Move it to arch/Kconfig so architectures can
select it without having to provide their own definition.

Since the regular TRACE_IRQFLAGS_SUPPORT is selected by
arch/x86/Kconfig, the select of TRACE_IRQFLAGS_NMI_SUPPORT is moved
there too.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20220511131733.4074499-2-mark.rutland@arm.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/Kconfig
arch/x86/Kconfig
arch/x86/Kconfig.debug

index fcf9a41a4ef5b15efaac04bc85c420a435603fb8..52eaa16d9b79bb7e606adfdf89ffc842cac86def 100644 (file)
@@ -223,6 +223,9 @@ config HAVE_FUNCTION_DESCRIPTORS
 config TRACE_IRQFLAGS_SUPPORT
        bool
 
+config TRACE_IRQFLAGS_NMI_SUPPORT
+       bool
+
 #
 # An arch should select this if it provides all these things:
 #
index be0b95e51df663f94a5c7e4c3fc3965179d26bdc..e31840edd90ebfb05f7c34c21d27327fc132f7d9 100644 (file)
@@ -277,6 +277,7 @@ config X86
        select SYSCTL_EXCEPTION_TRACE
        select THREAD_INFO_IN_TASK
        select TRACE_IRQFLAGS_SUPPORT
+       select TRACE_IRQFLAGS_NMI_SUPPORT
        select USER_STACKTRACE_SUPPORT
        select VIRT_TO_BUS
        select HAVE_ARCH_KCSAN                  if X86_64
index 340399f699544fec5b28e2ef4274113f8f44cf76..bdfe08f1a9304f8c7c8df77de4665fc07a63c21c 100644 (file)
@@ -1,8 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 
-config TRACE_IRQFLAGS_NMI_SUPPORT
-       def_bool y
-
 config EARLY_PRINTK_USB
        bool