Commit 490f561b authored by Frederic Weisbecker's avatar Frederic Weisbecker
Browse files

context-tracking: Introduce CONFIG_HAVE_TIF_NOHZ



A few archs (x86, arm, arm64) don't rely anymore on TIF_NOHZ to call
into context tracking on user entry/exit but instead use static keys
(or not) to optimize those calls. Ideally every arch should migrate to
that behaviour in the long run.

Settle a config option to let those archs remove their TIF_NOHZ
definitions.

Signed-off-by: default avatarFrederic Weisbecker <frederic@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: David S. Miller <davem@davemloft.net>
parent 7c805795
Loading
Loading
Loading
Loading
+11 −5
Original line number Diff line number Diff line
@@ -540,11 +540,17 @@ config HAVE_CONTEXT_TRACKING
	help
	  Provide kernel/user boundaries probes necessary for subsystems
	  that need it, such as userspace RCU extended quiescent state.
	  Syscalls need to be wrapped inside user_exit()-user_enter() through
	  the slow path using TIF_NOHZ flag. Exceptions handlers must be
	  wrapped as well. Irqs are already protected inside
	  rcu_irq_enter/rcu_irq_exit() but preemption or signal handling on
	  irq exit still need to be protected.
	  Syscalls need to be wrapped inside user_exit()-user_enter(), either
	  optimized behind static key or through the slow path using TIF_NOHZ
	  flag. Exceptions handlers must be wrapped as well. Irqs are already
	  protected inside rcu_irq_enter/rcu_irq_exit() but preemption or signal
	  handling on irq exit still need to be protected.

config HAVE_TIF_NOHZ
	bool
	help
	  Arch relies on TIF_NOHZ and syscall slow path to implement context
	  tracking calls to user_enter()/user_exit().

config HAVE_VIRT_CPU_ACCOUNTING
	bool
+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ config ARM
	select HAVE_ARM_SMCCC if CPU_V7
	select HAVE_EBPF_JIT if !CPU_ENDIAN_BE32
	select HAVE_CONTEXT_TRACKING
	select HAVE_TIF_NOHZ
	select HAVE_COPY_THREAD_TLS
	select HAVE_C_RECORDMCOUNT
	select HAVE_DEBUG_KMEMLEAK if !XIP_KERNEL
+1 −0
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ config ARM64
	select HAVE_CMPXCHG_DOUBLE
	select HAVE_CMPXCHG_LOCAL
	select HAVE_CONTEXT_TRACKING
	select HAVE_TIF_NOHZ
	select HAVE_COPY_THREAD_TLS
	select HAVE_DEBUG_BUGVERBOSE
	select HAVE_DEBUG_KMEMLEAK
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ config MIPS
	select HAVE_ASM_MODVERSIONS
	select HAVE_CBPF_JIT if !64BIT && !CPU_MICROMIPS
	select HAVE_CONTEXT_TRACKING
	select HAVE_TIF_NOHZ
	select HAVE_COPY_THREAD_TLS
	select HAVE_C_RECORDMCOUNT
	select HAVE_DEBUG_KMEMLEAK
+1 −0
Original line number Diff line number Diff line
@@ -182,6 +182,7 @@ config PPC
	select HAVE_STACKPROTECTOR		if PPC64 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r13)
	select HAVE_STACKPROTECTOR		if PPC32 && $(cc-option,-mstack-protector-guard=tls -mstack-protector-guard-reg=r2)
	select HAVE_CONTEXT_TRACKING		if PPC64
	select HAVE_TIF_NOHZ			if PPC64
	select HAVE_COPY_THREAD_TLS
	select HAVE_DEBUG_KMEMLEAK
	select HAVE_DEBUG_STACKOVERFLOW
Loading