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=1796099228; b=A3RrEihcktSbHyWZICCsyPtO+0jENyKHQkaHQzoQd9ixCLI8mdbQHuC+qCHf3mDg7EF/ Te9wkhLZVS6QoLlak0bF07j0c1BjmeFQppU0G50AD2dpnJdJEXMmRYXWF2kEMqENc2xWj EAiaNBWkPMQKuogu2F2vTVJI+6r2qYl76/e7d7ns4sHdsaIzUBfJgBop2q+A9lUu3hxY2 dJueNIwDyXBgXhzj9bIsqX1AK2KkRO3TDEXD6bLxneqKwAtUXgAKEebzZGuxV3n10kt2z 7860Q4V49F3YANOQHA+Db9eKmeDAVgxFVWieS/s73Wq0Qjfqo3LilReT27HsOyEUuQA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796099228; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=A2t5iu5t/ovKZpN5dcwwK9F5J8Fu+nquR65gCkL+VN4=; b=0DIu7g94QN6BX9aPL4dzM2WzefuIsjZxWSYoNC6A3sqd+Q/H0UWbsURl9KnozIa5LfKY B7okvd0ufCd2epGTW1uyQJ/5wWLDOp1cfOx6P6AubDuJ8D32p/sFeNdDlTW7SQizobQQk +FsCYpL3AbheSATauj2nrUzyo910BgxVMl+ROxKbGRNgu2vHZ+YeuscDPY0F7UX89c9yn XuxQR8CJf06GvPo3HfrluZI2Nd8JQj/4N1MUhekDu4wIj+mXwNFai8ucNla1WS0DeyeZw 2MPzkDJ0lGpjOt9henRCgq7HDhPkJBcxxUIhUnLes8euf/biyIswmek1UZ64snWZ0uA== 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=fsausKB+; 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 76F69606A320; Tue, 1 Dec 2026 04:27:08 +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=fsausKB+ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48B1E1F00926; Tue, 1 Dec 2026 04:26:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796099228; bh=A2t5iu5t/ovKZpN5dcwwK9F5J8Fu+nquR65gCkL+VN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fsausKB+tXcBLx0oLZpTS2OXwBee2l1MKKgRGSBwTIKUqo+OhzLkhca74ACTuK/eu FsJQv1/QUe1C7WG9KJcUzxpBf/x97yMG1a2ij/D20ey4lH4hdjzWmpEkoYjo83eeXH bJepsMyLgg7ePjAuw8BhcvpDU92SSU2PeNUjeJprZqbc3eabhllRTCz24MklJS7j2B vq0djWuP9/47a72QUN8VqHQMCahRpoErVfu2Bfka0qkxzhRblimKnEOLhJgKONRro8 3zG5ah4JrP7sKS6yhzfjzKdjhiDFuQjEFXqdVb6AuQRrkkTX/bazZsuTYGOkxB1iHV DSI5Dy8RmTUtQ== 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 16/22] context_tracking: Mark exception_enter() and exception_exit() notrace Date: Mon, 30 Nov 2026 20:21:55 -0800 Message-ID: <20261201042201.3199928-17-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 The tracing code uses preempt_enable_notrace(), which calls preempt_schedule_notrace(). Tracing can happen before the kernel has left user context, so preempt_schedule_notrace() calls exception_enter() to leave it before calling the scheduler. exception_enter() therefore runs while RCU may not be watching. exception_enter() and exception_exit() are plain inline functions, so an out-of-line copy is untraced only because inline implies notrace. With clang, a powerpc ppc64le_defconfig build has such a copy of exception_enter(), called from preempt_schedule_notrace(). Mark them notrace explicitly. No functional change. Assisted-by: Claude:claude-opus-5 Signed-off-by: Song Liu --- include/linux/context_tracking.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index af9fe87a0922..0059328995cc 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h @@ -48,7 +48,7 @@ static __always_inline void user_exit_irqoff(void) __ct_user_exit(CT_STATE_USER); } -static inline enum ctx_state exception_enter(void) +static inline enum ctx_state notrace exception_enter(void) { enum ctx_state prev_ctx; @@ -63,7 +63,7 @@ static inline enum ctx_state exception_enter(void) return prev_ctx; } -static inline void exception_exit(enum ctx_state prev_ctx) +static inline void notrace exception_exit(enum ctx_state prev_ctx) { if (!IS_ENABLED(CONFIG_HAVE_CONTEXT_TRACKING_USER_OFFSTACK) && context_tracking_enabled()) { -- 2.53.1-Meta