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 274F8606A32C for ; Tue, 1 Dec 2026 04:26:56 +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=QLVf6Bi4; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=jO2n4oP9 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=idUrPObM2BvfUbW5tVBtz/gz9SQT9rpc2VGyFE2Glkw=; b=QLVf6Bi4fDY6ye ZP1G7tvu8NeZu5J7Qwtjz444JcHNK7563l0Xs2gWyTq5dTybocTQyE+3dnZO+5KUwCRGlGTIoBSsz 1Zsa/RlEpjeTc/s5BOdojFozaKlumTl4ugFKff9JZqTMLCaXmTu/Ghnx5wm9udMQ4Y/qx3U+1SXgd DjEWq7Wb8i7g7WULBAZ4nulnxEjQS9y1mz7Y04wPRLPrAYYWnYGnK78Gk92hFxFs09e+pJko8encA 0AIdyRudxe9Cn5Gn5RRS9hff2OjeRVWiazSl9EiG+wX+maJmoPIhqZQicqEDXp8rFsnpEb1lnKsQJ mobF8aPvxcgTdf9yMexA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYFRx-00000006ZMO-0AKq; Tue, 01 Dec 2026 04:26:41 +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 1xYFRl-00000006ZBN-0RLi; Tue, 01 Dec 2026 04:26:29 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 863C26214D; Tue, 1 Dec 2026 04:26:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBB471F000C1; Tue, 1 Dec 2026 04:26:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796099187; bh=idUrPObM2BvfUbW5tVBtz/gz9SQT9rpc2VGyFE2Glkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jO2n4oP953cSwa2eFxdUFRTXgtpo69gN480Xn/HougrULNAWWj3QNvPKdCu3JIlSN T7Cnl59Zu7WsMf+Xgw5uXtWSJBkAz3LrtaG148e0vs41rmAhHxjT0Ajqe+pim3TwL2 cBW6z23VAJPDpI3oCOGEkRT1XIAgSOF6StUmHA2eHf7YaS7tDs9r8i8vJL6EL2UVm+ +s3RBLF+cS1GpLqO+LKukvZeCjxGkw9rP0mcUkBx+WJD3XB5GWGR0Mf15OXW2LLXcv 57S/uS95rFu4o465KPy247Dl9oNFVldbTXx9AuPYwKDJ1fgBZpP+wasFZpquWHkNEe /5WbDyHGdBlLw== 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 14/22] kallsyms: Mark the kernel text address checks notrace Date: Mon, 30 Nov 2026 20:21:53 -0800 Message-ID: <20261201042201.3199928-15-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 Commit c0d80ddab899 ("kernel/extable.c: mark core_kernel_text notrace") made core_kernel_text() notrace, because the MIPS function graph tracer calls it and tracing it recursed without bound. core_kernel_text() calls is_kernel_text() and is_kernel_inittext(), and is_kernel_text() calls __is_kernel_text(). These are plain inline functions, so an out-of-line copy of any of them is untraced only because inline implies notrace. Mark them notrace explicitly. No functional change. Assisted-by: Claude:claude-opus-5 Signed-off-by: Song Liu --- include/asm-generic/sections.h | 4 ++-- include/linux/kallsyms.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index 0755bc39b0d8..d478ddc02316 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -193,7 +193,7 @@ static inline bool is_kernel_ro_after_init(unsigned long addr) * * Returns: true if the address is located in .init.text, false otherwise. */ -static inline bool is_kernel_inittext(unsigned long addr) +static inline bool notrace is_kernel_inittext(unsigned long addr) { return addr >= (unsigned long)_sinittext && addr < (unsigned long)_einittext; @@ -208,7 +208,7 @@ static inline bool is_kernel_inittext(unsigned long addr) * Returns: true if the address is located in .text, false otherwise. * Note: an internal helper, only check the range of _stext to _etext. */ -static inline bool __is_kernel_text(unsigned long addr) +static inline bool notrace __is_kernel_text(unsigned long addr) { return addr >= (unsigned long)_stext && addr < (unsigned long)_etext; diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index d5dd54c53ace..93c830b35aeb 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h @@ -24,7 +24,7 @@ struct cred; struct module; -static inline int is_kernel_text(unsigned long addr) +static inline int notrace is_kernel_text(unsigned long addr) { if (__is_kernel_text(addr)) return 1; -- 2.53.1-Meta