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 75C7D606A32C for ; Tue, 1 Dec 2026 04:23:58 +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=VLbGbTyJ; 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=ViAcqhtH 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=7GNGdDVz0mvyD+UtIZlcvS0uBomzG7yxiCM+ha/1ftY=; b=VLbGbTyJCH8FZY4g32nxk8oD1g bYGA7hrI1pWiYQdjhvk3OtFs6gqPtSvy1yrbwK16xiVqmGysjHGEerl8hq7wY29L7lrR6JmovkVlH mkcp3TZK/0ABPnbR7Hd6zHQfzxTT8aThL21Jk/DCg1tiA2UbmEwFp7lbQMdEk/BmsmTTbewoSDpGS 2JiJxULma/Mw0SjAG5HlFddAGuRNsOc+WWoXTzpt+0pg/ZjWiU5HmcI80gfWREB0T1Gl8/8qFdyBH Th7kYFRgYNxOBM804FRPP3OOy/Ty0vRQwgVNfe4+aiq0MIkrZE9jScnqtDJvBat7bGkWIjepdbuEk FUvUHw7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYFPG-00000006WyY-0CMo; Tue, 01 Dec 2026 04:23:54 +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 1xYFPB-00000006WtS-0Bop; Tue, 01 Dec 2026 04:23:50 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id C849240F66; Tue, 1 Dec 2026 04:23:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A36631F0092A; Tue, 1 Dec 2026 04:23:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796099028; bh=Cc9WP2M7ilCLKH5nq6B51jgpM8ZnJcFzegcnKxUJHBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ViAcqhtHZOzEp3nFA0WQsr76Xba3iudIe4IjR3WaJrulZyQRut5PLE0hpCgazBGn5 KD2ApPcAY96A8fk8DDcNBONDANddSS7KM00cm5jK1F3NwwJPfbFT30fjBxINk9PK34 V9re/PWwtqWlbj9WlQjJ3gbHuSc/1P6QqWQN9W2ycS8nKUMqWRZ1KKwQ+eYfnTp7Kp qG2CbP69ixjmBBAq5a3qdFc4hbCt4WBEMZYRQN5tjoaIYaM4vwlxlisRY9NtkqJPIw ZTWJRiIzYH6hY5vLr7X0SkA+saY3DCwbr2mDlSlarc969y5F1I75GmIHpSTnob8Qdb jrjuvcjx3oGRQ== 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 05/22] bpf: Mark the bpf_mem_alloc fast path helpers notrace Date: Mon, 30 Nov 2026 20:21:44 -0800 Message-ID: <20261201042201.3199928-6-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 unit_alloc(), unit_free() and unit_free_rcu() are notrace so that BPF programs cannot attach to them and corrupt the per-CPU free lists, as the comment above unit_alloc() says. To take and release c->active and to update the free lists, they call local_inc_return() (local_add_return() on x86), local_dec(), __llist_add() and llist_add(). These are plain inline functions, as are __llist_add_batch() and llist_add_batch(), which the llist helpers call. 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 --- arch/x86/include/asm/local.h | 4 ++-- include/linux/llist.h | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h index 07b1d52e9ab4..e2f5710af4cb 100644 --- a/arch/x86/include/asm/local.h +++ b/arch/x86/include/asm/local.h @@ -22,7 +22,7 @@ static inline void notrace local_inc(local_t *l) : "+m" (l->a.counter)); } -static inline void local_dec(local_t *l) +static inline void notrace local_dec(local_t *l) { asm volatile(_ASM_DEC "%0" : "+m" (l->a.counter)); @@ -103,7 +103,7 @@ static inline bool local_add_negative(long i, local_t *l) * * Atomically adds @i to @l and returns @i + @l */ -static inline long local_add_return(long i, local_t *l) +static inline long notrace local_add_return(long i, local_t *l) { long __i = i; asm volatile(_ASM_XADD "%0, %1" diff --git a/include/linux/llist.h b/include/linux/llist.h index 413249764f7b..bebfaad36818 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h @@ -231,9 +231,9 @@ static inline struct llist_node *llist_next(struct llist_node *node) * * Return whether list is empty before adding. */ -static inline bool llist_add_batch(struct llist_node *new_first, - struct llist_node *new_last, - struct llist_head *head) +static inline bool notrace llist_add_batch(struct llist_node *new_first, + struct llist_node *new_last, + struct llist_head *head) { struct llist_node *first = READ_ONCE(head->first); @@ -244,9 +244,9 @@ static inline bool llist_add_batch(struct llist_node *new_first, return !first; } -static inline bool __llist_add_batch(struct llist_node *new_first, - struct llist_node *new_last, - struct llist_head *head) +static inline bool notrace __llist_add_batch(struct llist_node *new_first, + struct llist_node *new_last, + struct llist_head *head) { new_last->next = head->first; head->first = new_first; @@ -260,12 +260,12 @@ static inline bool __llist_add_batch(struct llist_node *new_first, * * Returns true if the list was empty prior to adding this entry. */ -static inline bool llist_add(struct llist_node *new, struct llist_head *head) +static inline bool notrace llist_add(struct llist_node *new, struct llist_head *head) { return llist_add_batch(new, new, head); } -static inline bool __llist_add(struct llist_node *new, struct llist_head *head) +static inline bool notrace __llist_add(struct llist_node *new, struct llist_head *head) { return __llist_add_batch(new, new, head); } -- 2.53.1-Meta _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv