Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796099114; b=B5c/YGyWICZ2E2Cfpe7pPItTsXOLMiRGaek+rA7VJMjRiRMhOl/kkNncqfeAJh8PfDDF CVUwMuTaEXF3EpNpfTAWFl566zvtiC4rmpYiTFP3f3cEaMm7XhRe1i873ssvMoEaxaKY7 068yFhB9PG51p5SYDaNbOA1Mzr9VS3Zge7tp+hP/fo491LkckQXoXcxMz+7sBHyZYF8V6 1lbyLkfVc2rfgYQez2grc+5LuPXdFUsx9GeFtrLGipafzb5slXxQmc8KaPF9ZeZpgN7dk 2vlm5Z2qIsz1SFTfjzknyeAtp+7UjPxyoLR/0Pmh6Ha9VYC0mIOKey8EUIl1DkqCiNw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796099114; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=2ouiGm+zvfQIZ2MpKrn4zCCLYDp9tm6tnMppipcPWs8=; b=diRx9fSAua7UbgSAjMb7sAjm2u/zPCMfmLwTD38KoMxKVAGJrYdVkgPgLLuwAMjNs362 YMcAPQZqkHUv4TWEHT0k3o0L3/4LX2k8NMEpvYWH1zBEnxQFo4DPaEHkFymlJZ91R5KUz FfNH3NmSShBgNBlPpEkXapUmG1vWnv1BiRbEBDHZOXgh8TFiinHsZ9FquEWx6gFWA9l2+ TPdIJbT810CuOFixkZtzY6JFgjQgAdWRMs5D0+lI3MfBCqu5NwmB06mzyuZurV+u2yy8y UJV9LSOGVt1D9mdaILHXjG5L3k9PK1zJejRNIJYCTgyZyv8hmFyg1fDlp07i9Aq+reg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=L0yEW3oj; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0EC6606A31A; Tue, 1 Dec 2026 04:25:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=L0yEW3oj Received: by smtp.kernel.org (Postfix) with ESMTPSA id 659C31F00919; Tue, 1 Dec 2026 04:25:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796099114; bh=2ouiGm+zvfQIZ2MpKrn4zCCLYDp9tm6tnMppipcPWs8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=L0yEW3ojb5fT/szF2ouDrejz9MhnrJdrPNLwOL/mpGprrMjgqxsUOu2c9KF+GBX6t s7O+kpgqhxVTYBMrbBORgibRQlLQ67nt24z51Mnr0h10YkevWLLGFSIN5Ieg4MWAnC fmF+N4Ba2OWv4FqmH7J8jWua8qQJB8juvJCaffBpuJmwVP9F2Rysg5JFXizyPc+Ngn td5muxMmgZzRJuk7AlyqgK5KnT6/H/0/i9B5E2lpB+Qt9o2d97DMBzAdZucqwj+QYK p3IOp98dgQuy0xastn69yu6dzkd8krj+z+4/k9+AgeJPWUnQT6gsA8CRWwpk1ge/NV S0LhfN6bPGmrQ== From: Song Liu To: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, live-patching@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, bpf@vger.kernel.org Cc: rostedt@goodmis.org, mhiramat@kernel.org, mark.rutland@arm.com, peterz@infradead.org, tglx@kernel.org, frederic@kernel.org, paulmck@kernel.org, catalin.marinas@arm.com, will@kernel.org, maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, ojeda@kernel.org, kernel-team@meta.com, Song Liu Subject: [PATCH v3 10/22] powerpc, csky, mips, sh: Mark the accessors behind current notrace Date: Mon, 30 Nov 2026 20:21:49 -0800 Message-ID: <20261201042201.3199928-11-song@kernel.org> X-Mailer: git-send-email 2.53.1 In-Reply-To: <20261201042201.3199928-1-song@kernel.org> References: <20261201042201.3199928-1-song@kernel.org> X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ftrace_test_recursion_trylock() reads current->trace_recursion before it knows whether it is safe to trace, so reading current must never be a traced call. On powerpc, get_current() is a plain inline function. On csky, mips and sh, current comes from the generic get_current(), which calls current_thread_info(), and current_thread_info() is a plain inline function. An out-of-line copy of any of these is untraced only because inline implies notrace. Mark them notrace explicitly. On the other architectures that support the function tracer, get_current() is already __always_inline. No functional change. Assisted-by: Claude:claude-opus-5 Signed-off-by: Song Liu --- arch/csky/include/asm/thread_info.h | 2 +- arch/mips/include/asm/thread_info.h | 2 +- arch/powerpc/include/asm/current.h | 2 +- arch/sh/include/asm/thread_info.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/csky/include/asm/thread_info.h b/arch/csky/include/asm/thread_info.h index fdd4f8ad45ac..d39498883c9a 100644 --- a/arch/csky/include/asm/thread_info.h +++ b/arch/csky/include/asm/thread_info.h @@ -42,7 +42,7 @@ struct thread_info { #define thread_saved_lr(tsk) \ ((unsigned long)(((struct switch_stack *)(tsk->thread.sp))->r15)) -static inline struct thread_info *current_thread_info(void) +static inline notrace struct thread_info *current_thread_info(void) { unsigned long sp; diff --git a/arch/mips/include/asm/thread_info.h b/arch/mips/include/asm/thread_info.h index 2707dad260dd..4d531efd89ec 100644 --- a/arch/mips/include/asm/thread_info.h +++ b/arch/mips/include/asm/thread_info.h @@ -64,7 +64,7 @@ extern struct thread_info *__current_thread_info; register struct thread_info *__current_thread_info __asm__("$28"); #endif -static inline struct thread_info *current_thread_info(void) +static inline notrace struct thread_info *current_thread_info(void) { return __current_thread_info; } diff --git a/arch/powerpc/include/asm/current.h b/arch/powerpc/include/asm/current.h index bbfb94800415..9663d3737d5c 100644 --- a/arch/powerpc/include/asm/current.h +++ b/arch/powerpc/include/asm/current.h @@ -12,7 +12,7 @@ struct task_struct; #include #include -static inline struct task_struct *get_current(void) +static inline notrace struct task_struct *get_current(void) { struct task_struct *task; diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h index 471db5173036..9e1ccdd70a7d 100644 --- a/arch/sh/include/asm/thread_info.h +++ b/arch/sh/include/asm/thread_info.h @@ -63,7 +63,7 @@ struct thread_info { register unsigned long current_stack_pointer asm("r15") __used; /* how to get the thread information struct from C */ -static inline struct thread_info *current_thread_info(void) +static inline notrace struct thread_info *current_thread_info(void) { struct thread_info *ti; #if defined(CONFIG_CPU_HAS_SR_RB) -- 2.53.1-Meta