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=1796099188; b=M8540AZQNkJvMzKZaoXEAdsQjjSFn27dz06WJ3+kraG9kv3DvMUOc8QvOSZGwuw5k/0X aQtFnDHnmCbLET5azauQtSHqESxdNzmgZCl1L8e60fiqICIYjjB4i2j8jCyiHZKInMF0h xMX9zn8yzNQ+Zd7eQ61/xSgKirgtPrgo24ZQ0o/V+VfmnSrCsvjEGGjY7ehWjWiQNqUN3 Dk+hgTFYenLIPG4TBzdAXK/mcAcy7m9oQjdxzgOGJWj9F4tnDmNZOW76d7GBhFHjJa58k Ew68MRjTNEhBLui5CSqxQZKn7eQGMcmEQuZm7lve+ITcGjGbLHFlQKmo2YFKQdmzXCw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796099188; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=idUrPObM2BvfUbW5tVBtz/gz9SQT9rpc2VGyFE2Glkw=; b=BipaTscgjHjMbkwR3ph7PVWItflzRLFzMYI3HofvViv+eWkDG0FJtFXxk4Y/gdl7Zu/X C3Rkys/zCDP3itr38Uspl1/trqcL52/4YZ9ShiTGmTcor5pzc6dxiETAYjerIpZWMooYD 3z6yJO+iLquMYVy4Tu2m8UB6YupN6BxgiNTZg8YgQLjWydVbVxZTZqva96E+2hR0yM0KM loZ6Ds8tvN7EwzNoTu5IOXFka72hL9F9KNoZPokWWFkZPqRocd+k7yeHfzGY7tID/aVAM phgeOaGJt1tsQvSccjWuIAXiQzLP7dOzJauNVsmvHqSFHbs+FzYPULz9TOEStMvwfyA== 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=jO2n4oP9; 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 B9284606A31A; Tue, 1 Dec 2026 04:26:28 +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=jO2n4oP9 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-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 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