From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C249F606A31A for ; Tue, 1 Dec 2026 04:25:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=GfrMkrHa; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=L0yEW3oj DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=2ouiGm+zvfQIZ2MpKrn4zCCLYDp9tm6tnMppipcPWs8=; b=GfrMkrHaYuO+by I1V13yhHNJrzVccoTPCAkd2Iztj8EdO8m0hcDALhHeLWjIJ6AryhrIcygLkWe+BxfW3q9JM51bRHh KBw1TYzHO3PG4gJKYxJVsidnOGIQENimh4VWGZPhmO1rO7zOvVen3hvT6303DAmkQZV3Zrk6gHmTK Xq6lt6s6BQ3SEu4qeqCFTwkbh613LzJETg3eYCZHtYDESL1O55q5XtU4SdnPkuv+HrgY84zbE7smz gHwQkaPJ6lETTDBSjHTvAS+QCpDSQhnpfVEmtYNR6PsqHWmrPJhxrOgYOIv9ho+yEKT0d5PmjVfUm lTCPe8RCGRe3wfxE/ryA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYFQc-00000006YIl-0M23; Tue, 01 Dec 2026 04:25:18 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYFQY-00000006YFi-323i; Tue, 01 Dec 2026 04:25:14 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 6D3CF43254; Tue, 1 Dec 2026 04:25:14 +0000 (UTC) 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-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-18.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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