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 05E45606A31A for ; Tue, 1 Dec 2026 04:25:09 +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=gvbdHfAG; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FXNqXvo/ DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=zhFEoXxHQmdRPWxrPMPqVXO+JGcD9xYRguGqwms43V4=; b=gvbdHfAGG7ulUR1lYB/zncU7Xp mtXo+a7W4dlaSdgCcnIfM2uSuyasw50/GWb63SSIYB93/6Indu0rtXCCTw08V1Win1zxxQ8mDrnzq d2IejMnQDmF/IR3XQfg3p8z13uNHUeyXWCf1IyI2goKmVPAaiUNYpCHfuD5kLh8JjL9MjE/ZmeaDS 7bcoeXmmqLdTGgF8Vkh2tEI+p9ZWVEi8JWiqXc0Q7d+SEHngld0hETt4rliTg302aFcOz/m4eLszM siBJkGFcb5nsWvvtrV4bbFw2ZJyZUmMrE73NFjMJYn/QDcoX/8A864VTRzYCFYO5jmk/aqhlQNGm/ OnZkxoZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYFQO-00000006Y6b-3sUF; Tue, 01 Dec 2026 04:25:04 +0000 Received: from tor.source.kernel.org ([172.105.4.254]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYFQI-00000006XzF-199W; Tue, 01 Dec 2026 04:24:59 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id AE569611F6; Tue, 1 Dec 2026 04:24:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37E9C1F00927; Tue, 1 Dec 2026 04:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796099097; bh=02EoNYzm02/bgARBBVzIhOL2s122D3CcCKO90ckJYg4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FXNqXvo/sakV6sB/viRSH4HiRzimUgzet5eqUcgFPr4W1NurDzbfCsqXzsutIQTH+ cljn26KVD4RmJS5dy4klPzOGJT2Tui6ggC0NAQTRwfI35neCh2iqvdO2uOFx8o1/Wq xhEPB4TJnhaitZDcfTGF/GQ7T9K4W0t5QoWJoYMdB9sohxS20DSO153BUJ661FFqvZ 5vmXAuXwMUnraYp1jGTYjGHce7eGwG2UUcm3WQ8M6D1VxrTRKRoprQnTPkNEzvxrzY co/IhiAMQR0NwZiuRnyQ1mU4b3HkSJj65rrdCgpwQwfHu7BShoxuVlL8GvL4+k1UVr XhoqCuHVDcJCw== 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 09/22] arm64: Mark the preempt count helpers notrace Date: Mon, 30 Nov 2026 20:21:48 -0800 Message-ID: <20261201042201.3199928-10-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 X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham 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 preempt_count() to find the current context, and preempt_disable_notrace() and preempt_enable_notrace() use __preempt_count_add(), __preempt_count_sub(), __preempt_count_dec_and_test() and should_resched(). On arm64 these are plain inline functions. If the compiler emits one of them out of line, that copy is untraced only because inline implies notrace, and tracing it would recurse before the recursion check takes effect. Mark them, and preempt_count_set(), notrace explicitly. The x86 and generic versions are __always_inline. No functional change. Assisted-by: Claude:claude-opus-5 Signed-off-by: Song Liu --- arch/arm64/include/asm/preempt.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm64/include/asm/preempt.h b/arch/arm64/include/asm/preempt.h index 75a592b7f47f..d371e09c1521 100644 --- a/arch/arm64/include/asm/preempt.h +++ b/arch/arm64/include/asm/preempt.h @@ -7,12 +7,12 @@ #define PREEMPT_NEED_RESCHED BIT(32) #define PREEMPT_ENABLED (PREEMPT_NEED_RESCHED) -static inline int preempt_count(void) +static inline int notrace preempt_count(void) { return READ_ONCE(current_thread_info()->preempt.count); } -static inline void preempt_count_set(u64 pc) +static inline void notrace preempt_count_set(u64 pc) { /* Preserve existing value of PREEMPT_NEED_RESCHED */ WRITE_ONCE(current_thread_info()->preempt.count, pc); @@ -41,14 +41,14 @@ static inline bool test_preempt_need_resched(void) return !current_thread_info()->preempt.need_resched; } -static inline void __preempt_count_add(int val) +static inline void notrace __preempt_count_add(int val) { u32 pc = READ_ONCE(current_thread_info()->preempt.count); pc += val; WRITE_ONCE(current_thread_info()->preempt.count, pc); } -static inline void __preempt_count_sub(int val) +static inline void notrace __preempt_count_sub(int val) { u32 pc = READ_ONCE(current_thread_info()->preempt.count); pc -= val; @@ -75,13 +75,13 @@ static inline int __preempt_count_sub_return(int val) return pc; } -static inline bool should_resched(int preempt_offset) +static inline bool notrace should_resched(int preempt_offset) { u64 pc = READ_ONCE(current_thread_info()->preempt_count); return unlikely(pc == preempt_offset); } -static inline bool __preempt_count_dec_and_test(void) +static inline bool notrace __preempt_count_dec_and_test(void) { /* * We must load the combined 'preempt_count' after decrementing -- 2.53.1-Meta _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv