From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796307636; b=nM5DvozNk6XglOfG18DDD/cxnOe23OsXwSg4edxj7R5nAvefAf4yuErpDS5n+MWaJj3Y qkkfs4GPCzsYZHkAdyJhjDUKOlvSe8hn5zqjnV+ufJn3Syh7RfoTgh9459CkiDb07TYYa UqhBIrl7dA8cz3+r5FENJuQMNUPRs0N18KCQucGIVQYU4r9kHBEwjsoYuDARCSCjFZQQK iV/Y4BcNY0DOabQ3XaoTcPtirQafqV65478N9QSHr5xZ+apdzCA5OriaAl8DU6JZsbaZf hZ3Fc24zdrDEJvqbbF2MKw/t55Xlt2Zpyz6/5rG/fQjaXwMBVEEhlV1jHrzWXhuEZzQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796307636; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=UbmS+kwPdu6FlDInJU0fFF4FHYbGn2StjhjbuPQgWrU=; b=YxKTAEKciCP93VjUpZdbaPxbMTLvC6C+BpKT2K2OZWhPIWHA2GoaW8ruK6iuxUU/IUtA sj2uXKMQkIGL3iol+weA2hXD+ZhMPkakqLHqR1UgGixJxO78C8CYqeP6babk8pPk7iYS/ eUJK/PLxXi4A90lyPIEwtAbyraqJ87LEnInUd88RfUrHMlA4TbslVlCGBZYIiI5yuivI5 uZr2YMtFadLSVtwmdm+tujh+X7Qr121yBJ4PwUmyZuCS6y2pw3a2nPSzr/ThvXcNrek84 4xL+nr12L8vE5IvnG91bXdsAekXqU5QzjuGxlCTChp3AP+8q55xNTtXRE3wVMUebasw== 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=cjkNWbNA; 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 58C64606A322 for ; Thu, 3 Dec 2026 14:20:36 +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=cjkNWbNA Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3982F1F00893; Thu, 3 Dec 2026 14:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796307635; bh=UbmS+kwPdu6FlDInJU0fFF4FHYbGn2StjhjbuPQgWrU=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=cjkNWbNA3009Tdj/EKngK1C9JrzXHK3OtBAwIAoFrhsK/46jI1RDdKBi4n7SL0+zI FlJmhoIkv2yBjKIfVHuaYojRmIrpJ4YCZeMlmvSThXJRcSsvt/ydvkxEXoMH4ZIvo6 v+IMxQbBiTdABE7B9PRWYTAnUECAlGRCgvUxpSa7A8tfdXLI8s0juYMqOs2wqktNnq k1IKbbCnSNICdS0mv2uxMmWr7/kxWYBk1f+7+DfrvjU9VtIDcgZAyp8jSoNGCyzGBq 4KxQLMOUV29ePyp8CjeHakH6IotvrZtW5emoNtf55WD8yOXJlVvj4iOB2IZFW9X/Vq a56PNGipuM/mQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v11 01/10] riscv: store percpu offset into thread_info Reply-To: sashiko-reviews@lists.linux.dev To: "Yunhui Cui" , pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, dennis@kernel.org, tj@kernel.org, cl@gentwo.org, oleg@redhat.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com, memxor@gmail.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, jolsa@kernel.org, emil@etsalapatis.com, ihor.solodrai@linux.dev, bjorn@kernel.org, pulehui@huawei.com, puranjay@kernel.org, broonie@kernel.org, dave@stgolabs.net, david.laight.linux@gmail.com, jszhang@kernel.org, tglx@kernel.org, conor.dooley@microchip.com, thuth@redhat.com, ajones@ventanamicro.com, ben.dooks@codethink.co.uk, rkrcmar@ventanamicro.com, samuel.holland@sifive.com, zong.li@sifive.com, debug@rivosinc.com, seanwascoding@gmail.com, andybnac@gmail.com, menglong8.dong@gmail.com, cyrilbur@tenstorrent.com, wangruikang@iscas.ac.cn, atishp@rivosinc.com, apatel@ventanamicro.com, arnd@arndb.de, nathan@kernel.org, nick.desaulniers+lkml@gmail.com, morbo@google.com, justinstitt@google.com, qingfang.deng@siflower.com.cn, linux-mm@kvack.org, bpf@vger.kernel.org In-Reply-To: <20261203135328.32990-2-cuiyunhui@bytedance.com> References: <20261203135328.32990-1-cuiyunhui@bytedance.com> <20261203135328.32990-2-cuiyunhui@bytedance.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 14:20:32 +0000 X-Mailing-List: bpf@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] riscv, bpf: emit_priv_stack_frame() still uses __per_cpu_offset[] -- commit 1b5c188eca72654acc3662013da85bb0d5d13b4f Author: Yunhui Cui riscv: store percpu offset into thread_info This commit caches the current CPU's per-CPU offset in thread_info, initializes it on boot and secondary CPUs, and propagates it across context switches so per-CPU accesses and the RV64 BPF JIT can load it directly. Link: https://lists.riscv.org/g/tech-privileged/topic/risc_v_tech_arch_revi= ew/113437553?page=3D2 Link: https://lore.kernel.org/r/20260826012457.ig3rfmji7vywf6kc@offworld > diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_com= p64.c > index a7a7d2f9da85a..23380d12f6163 100644 > --- a/arch/riscv/net/bpf_jit_comp64.c > +++ b/arch/riscv/net/bpf_jit_comp64.c > @@ -1466,15 +1466,8 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn,= struct rv_jit_context *ctx, > if (rd !=3D rs) > emit_mv(rd, rs, ctx); > #ifdef CONFIG_SMP > - /* Load current CPU number in T1 */ > - emit_lw(RV_REG_T1, offsetof(struct thread_info, cpu), > + emit_ld(RV_REG_T1, offsetof(struct thread_info, pcpu_offset), > RV_REG_TP, ctx); > - /* Load address of __per_cpu_offset array in T2 */ > - emit_addr(RV_REG_T2, (u64)&__per_cpu_offset, extra_pass, ctx); > - /* Get address of __per_cpu_offset[cpu] in T1 */ > - emit_sh3add(RV_REG_T1, RV_REG_T1, RV_REG_T2, ctx); > - /* Load __per_cpu_offset[cpu] in T1 */ > - emit_ld(RV_REG_T1, 0, RV_REG_T1, ctx); > /* Add the offset to Rd */ > emit_add(rd, rd, RV_REG_T1, ctx); > #endif [Severity: Low] Should emit_priv_stack_frame() in the same file also be updated to load thread_info.pcpu_offset directly? arch/riscv/net/bpf_jit_comp64.c:emit_priv_stack_frame() { ... #ifdef CONFIG_SMP emit_lw(RV_REG_T1, offsetof(struct thread_info, cpu), RV_REG_TP, ctx); emit_imm(RV_REG_T2, (u64)__per_cpu_offset, ctx); emit_sh3add(RV_REG_T1, RV_REG_T1, RV_REG_T2, ctx); emit_ld(RV_REG_T1, 0, RV_REG_T1, ctx); emit_add(RV_REG_S5, RV_REG_S5, RV_REG_T1, ctx); #endif } As written, every RV64 BPF program or subprogram using a private stack still emits the multi-instruction __per_cpu_offset[] lookup in its prologue instead of a single load from thread_info.pcpu_offset. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203135328.3299= 0-1-cuiyunhui@bytedance.com?part=3D1 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B84D606A322 for ; Thu, 3 Dec 2026 14:20:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; 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=cjkNWbNA Received: by kanga.kvack.org (Postfix) id 981C66B05B6; Thu, 3 Dec 2026 09:20:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 931CE6B05BC; Thu, 3 Dec 2026 09:20:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 847E86B05BD; Thu, 3 Dec 2026 09:20:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 629D86B05B6 for ; Thu, 3 Dec 2026 09:20:39 -0500 (EST) Received: from smtpin20.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 5E0D4C0752 for ; Thu, 3 Dec 2026 14:20:38 +0000 (UTC) X-FDA: 85502882556.20.DA3B311 Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf20.hostedemail.com (Postfix) with ESMTP id CE1271C000A for ; Thu, 3 Dec 2026 14:20:36 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=cjkNWbNA; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf20.hostedemail.com: domain of sashiko-bot@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sashiko-bot@kernel.org ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1796307636; b=a0Tf5N+bNwhlKYJ1FHtaKypk/oDqO1nt93drncufc5HlEZ1eg8u8ZV0eJ28a3CTnFWX3xu bnrSjfriFtE1N2jMvcXuxjTeqkxFTS0GyNp38w8IsuPBY085B2rc0aQIsyvNEIs7G11kNO DgXgjC5StfemzPfKe4ZxNjoMgASN3h0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1796307636; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=UbmS+kwPdu6FlDInJU0fFF4FHYbGn2StjhjbuPQgWrU=; b=MYbhcyszbei5CydW+HAEQEgDfAzwXGsyJdm9+m4vJqbzC5gWfNqXAgiGwcSb8kp8AbatPP CGfel6rvcQAd+jFAyJiEoEe1ChimFum3JpdLy+SuubfY24psDTqhfbXU6Ngrc2r5bCjQuB ERxLmczJSfQmEz4HitjwsStH3FWI5fs= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20260515 header.b=cjkNWbNA; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf20.hostedemail.com: domain of sashiko-bot@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sashiko-bot@kernel.org Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 38CF361B34; Thu, 3 Dec 2026 14:20:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3982F1F00893; Thu, 3 Dec 2026 14:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796307635; bh=UbmS+kwPdu6FlDInJU0fFF4FHYbGn2StjhjbuPQgWrU=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=cjkNWbNA3009Tdj/EKngK1C9JrzXHK3OtBAwIAoFrhsK/46jI1RDdKBi4n7SL0+zI FlJmhoIkv2yBjKIfVHuaYojRmIrpJ4YCZeMlmvSThXJRcSsvt/ydvkxEXoMH4ZIvo6 v+IMxQbBiTdABE7B9PRWYTAnUECAlGRCgvUxpSa7A8tfdXLI8s0juYMqOs2wqktNnq k1IKbbCnSNICdS0mv2uxMmWr7/kxWYBk1f+7+DfrvjU9VtIDcgZAyp8jSoNGCyzGBq 4KxQLMOUV29ePyp8CjeHakH6IotvrZtW5emoNtf55WD8yOXJlVvj4iOB2IZFW9X/Vq a56PNGipuM/mQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v11 01/10] riscv: store percpu offset into thread_info Reply-To: sashiko-reviews@lists.linux.dev To: "Yunhui Cui" , pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, dennis@kernel.org, tj@kernel.org, cl@gentwo.org, oleg@redhat.com, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, eddyz87@gmail.com, memxor@gmail.com, martin.lau@linux.dev, song@kernel.org, yonghong.song@linux.dev, jolsa@kernel.org, emil@etsalapatis.com, ihor.solodrai@linux.dev, bjorn@kernel.org, pulehui@huawei.com, puranjay@kernel.org, broonie@kernel.org, dave@stgolabs.net, david.laight.linux@gmail.com, jszhang@kernel.org, tglx@kernel.org, conor.dooley@microchip.com, thuth@redhat.com, ajones@ventanamicro.com, ben.dooks@codethink.co.uk, rkrcmar@ventanamicro.com, samuel.holland@sifive.com, zong.li@sifive.com, debug@rivosinc.com, seanwascoding@gmail.com, andybnac@gmail.com, menglong8.dong@gmail.com, cyrilbur@tenstorrent.com, wangruikang@iscas.ac.cn, atishp@rivosinc.com, apatel@ventanamicro.com, arnd@arndb.de, nathan@kernel.org, nick.desaulniers+lkml@gma il.com, morbo@google.com, justinstitt@google.com, qingfang.deng@siflower.com.cn, linux-mm@kvack.org, bpf@vger.kernel.org In-Reply-To: <20261203135328.32990-2-cuiyunhui@bytedance.com> References: <20261203135328.32990-1-cuiyunhui@bytedance.com> <20261203135328.32990-2-cuiyunhui@bytedance.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 14:20:32 +0000 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: CE1271C000A X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Stat-Signature: s38caiuhgyzx7pews8ibhrmr585dwhbi X-Rspam-User: X-HE-Tag: 1796307636-251361 X-HE-Meta: U2FsdGVkX1/tJngUnS6U08u1OsE23qZ6Wju6GJZMIBn7p8uPUHxRSMJXGpS1C9wC5kqtIugm3CCTknHuNe3Cya0cm8/XJog7cSZnoTN2wlbIp2LR0gON6SYl4tl1NEXsIMsjMg6SaXBFBnLNwpRh/6yKiUOuC0fgkiXKQ36NCvd3bRuLuEwbC4+z1o/Lh/c6LheEleVaAu0REuwpsHxtn/cWuGAqCXzobr8psCMGf3x4R5YvsaVpB4lIp9mnaj3zzuGlPKTw7hvpiswsoNizL97Ty4rBz4bk3CuzYYOI8pdZMPLNKfNslzIW+7D6QwuZkeD3ou5l/BYPdQ8oofIMn4iOcCFTuq72dzt7N9KIIeue/Om9M5ac3jRirXrvmg+Balo4sXZsOtWwLinA7o26OPl/5poqlv4STfD29iKHnfR/ZNHwHxjlzcUaGdmUX7EZjG8404AjE2lgmdZCAuuCKLU6URlQ9OLwOAL9acRhmoAIDT1lehmErzdeUsF35S+N4l4WOYVmw3b4icbfSjNgi3tnHgWuxM8tiNR0ioBV350ObZdloIEJyQnl54IhhpDK08d2PN88hbFMKapEqOADJkW/QZLvIZjlbBlhWHmDVwCg/QFtw7goqgRX1uUJQlsaVdkOA7kzgRz253f+9wn3qArM2oMmN1dNiY35vZKgTauLwCd5AKrZhO7ZPyDWePZacKwqDim4Z84IG0OAvaEw3tZutNJ0Wv/5t+c1iQDFlcuqXdppQbV3Mp6CzEJt9pjtp/tDo5H3eEXeJ8s/QZoqBQr8QDGpBBmdQ4odXYXpPOJ7ADuBY2HAbr8yBt7IQSZ/mGOKJk47MnRtV5nPvEKsXemHWvSmPUl63ErzCEIMGBKy48SYhWG00VfdXCdv/rdowj6kR3RTeVUCsii0I7ggZ1UsCZPMXLPpmyDjKUNzFSH55Ltdni1MRX+dxwuQ8xZIWKsaWVXAZXTdxcb26/m 25y5m2/D nUTGa0yKFPcuZiJ3Q6A9dnVXiAdMPpSrlW+1ZmqK2DyYT2cGiAsXNBOwyJM4B1tgV48QYnRjZZfLwRIXOgFT3omFIgiU3x/Wd1oURC0npwSPTGZDMZd6gcBGTnHkcJ2Mhcb/+2S3AdzyRIXlzrqqRZfsT6YgdxFEtVrz0eP/j/cKj/5RiczbQ8wjisfG7+nRMxbhFokMjgcRwwGnFRu9jPYpDhaJ9cqkGK7PgLkwhPl1wgoWAM94vZ951Kpu97HLRTIG+rsWEohw+gjXWAiZO0gU6d4VbCco9tAT10Ll77ncWU763KnFfGKBBiWLsLXQLHhTHfH9VK6TqkCcSJ/4Otw27HP6ZjzWkEAg18ULzajvIBH1xLGH8W0iGo5ptBSflOdxZd7pLnVlKOr2HDuH+ngoWlzsoIwbWZq7KoCyUEYkpPX49fBBIDLIgOys62XHRpFuD4MBa6qB0coZdhFAjZfc0++SOqbidlaBpeUiYtsLE9GNhge4w05qb5A66Z98E78x9+BDSB2hEY6AoaXGXLpsnbmuD6sXqcP5Z8F2x9r4hGB0qbLneAJ/wr1s++rzjM7KA6ZNxNUfuprzKVStgK+X8U40g6xDk/rQmPeoj2bNTbhFDgWcMtLUanrkwmfTtrikVPT2N0P2fcQlRYXL68S00YViHAy3f8AJw/a1lIz63XcF4GJV+fe2LBIpzJugfvwtDTP61zhJ8W/FqSmjwqIHHyDXC1BGaDJeejk+jhsz9EFeUrmcrYrjhO9HC7UL7oxJ1rGTXh7cndohzrjWo9gA6os4nnRL+yzXHVaCjCC4ZofBusX6hBEJOehF9sbYpdWjQgC6MwUeab4QyOzRgAu+3e/fm1YAmc0tB2mbyKFERHO2hcb5vWSo+LfV4fCWncuMBn9UeJXRwFnivMi/oXzZFow1R+Qqkdd3sh+Y1uRMFtMgVKVoFmlZ8KklP5PgL5fkK+9pnbNEWNV46hoS4WMqrtn9o YKRt61T7 UHzVPprzt2fX4jAaIYuh7wXwqnaM7LVZXzAqVnPxaY4SvS4BX0mDOfCDI0FfQDleLTQQxutLfrE= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] riscv, bpf: emit_priv_stack_frame() still uses __per_cpu_offset[] -- commit 1b5c188eca72654acc3662013da85bb0d5d13b4f Author: Yunhui Cui riscv: store percpu offset into thread_info This commit caches the current CPU's per-CPU offset in thread_info, initializes it on boot and secondary CPUs, and propagates it across context switches so per-CPU accesses and the RV64 BPF JIT can load it directly. Link: https://lists.riscv.org/g/tech-privileged/topic/risc_v_tech_arch_revi= ew/113437553?page=3D2 Link: https://lore.kernel.org/r/20260826012457.ig3rfmji7vywf6kc@offworld > diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_com= p64.c > index a7a7d2f9da85a..23380d12f6163 100644 > --- a/arch/riscv/net/bpf_jit_comp64.c > +++ b/arch/riscv/net/bpf_jit_comp64.c > @@ -1466,15 +1466,8 @@ int bpf_jit_emit_insn(const struct bpf_insn *insn,= struct rv_jit_context *ctx, > if (rd !=3D rs) > emit_mv(rd, rs, ctx); > #ifdef CONFIG_SMP > - /* Load current CPU number in T1 */ > - emit_lw(RV_REG_T1, offsetof(struct thread_info, cpu), > + emit_ld(RV_REG_T1, offsetof(struct thread_info, pcpu_offset), > RV_REG_TP, ctx); > - /* Load address of __per_cpu_offset array in T2 */ > - emit_addr(RV_REG_T2, (u64)&__per_cpu_offset, extra_pass, ctx); > - /* Get address of __per_cpu_offset[cpu] in T1 */ > - emit_sh3add(RV_REG_T1, RV_REG_T1, RV_REG_T2, ctx); > - /* Load __per_cpu_offset[cpu] in T1 */ > - emit_ld(RV_REG_T1, 0, RV_REG_T1, ctx); > /* Add the offset to Rd */ > emit_add(rd, rd, RV_REG_T1, ctx); > #endif [Severity: Low] Should emit_priv_stack_frame() in the same file also be updated to load thread_info.pcpu_offset directly? arch/riscv/net/bpf_jit_comp64.c:emit_priv_stack_frame() { ... #ifdef CONFIG_SMP emit_lw(RV_REG_T1, offsetof(struct thread_info, cpu), RV_REG_TP, ctx); emit_imm(RV_REG_T2, (u64)__per_cpu_offset, ctx); emit_sh3add(RV_REG_T1, RV_REG_T1, RV_REG_T2, ctx); emit_ld(RV_REG_T1, 0, RV_REG_T1, ctx); emit_add(RV_REG_S5, RV_REG_S5, RV_REG_T1, ctx); #endif } As written, every RV64 BPF program or subprogram using a private stack still emits the multi-instruction __per_cpu_offset[] lookup in its prologue instead of a single load from thread_info.pcpu_offset. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203135328.3299= 0-1-cuiyunhui@bytedance.com?part=3D1