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=1796134765; b=omOHknABxzZOa2fu9rkRoV30X7UP1w8Byog7ai9+E+mPOmYRjgXyyEhzwwdK7CUOdy+0 OdUHmNHv0hmfWB+X/c8cPqaUn1QGhWULIztmDdfsrtB91jB4ymYQoxU8K0LPWRUmYqwWH qIfHfDFyn4CAer3bTeed4MxQwpYzjkNQY+F79R+n7AqOLZbofUC6Zsp+yd45NgArNy2UZ a/owme3zOY2gbeEHxB8JUrQzp5aRXyuBlQKy3k4kSmxXLRW4Fwsxyoh0MBRzkxaoVIyUX yLbxaC5HEWM8up9u6MAMIhK8kMiKpTXqRfZAbq6lZ2Bo/Wv0G1Kpvju7+SL89u2dJXQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796134765; h=Received:DKIM-Signature:Content-Type:MIME-Version:Message-Id: In-Reply-To:References:Subject:From:To:Cc:Date; bh=c+eq0Xvy3SDU4PNxtw7TQZHfBd9Y+mJvRbQVj3K1ZIk=; b=hpJFh+LEeioSv76KI4v6c8I95GGc5FgzYiJTZcKkeyu5KbgdAHIoucIZ4q/dvItUITOc hds+3Nmjz+izl26V0u/wBw/uQbP7nmVUyDXxCPwSCmpGlsWxfX6hiCT5W3075rvo6gEVu 1IEgqfY4Hkxoj7MgZgOTWOaJK00eKSXnUI4RsRrwY3q9DJwLA9IDz4c4bRHCPyairU9iC lh+IWVEZcZW4mR+adzwDQowkv/aZ4Qkb0y6k3XUmGuDmMTVRuvwx+oPMO4wVMMZS/CmbX H+VmzynYm7rTv+sINA9tA008SgiB2R3+UWxS+u4tfYZNev0XOYkPz+jqd2MU6DJhbqQ== 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=oxPqXelc; 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 41E92606A69E; Tue, 1 Dec 2026 14:19:24 +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=oxPqXelc Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEF881F00925; Tue, 1 Dec 2026 14:19:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796134764; bh=c+eq0Xvy3SDU4PNxtw7TQZHfBd9Y+mJvRbQVj3K1ZIk=; h=In-Reply-To:References:Subject:From:To:Cc:Date; b=oxPqXelcMJL3Ah86e36/Zv/bhZtQrspFahqWPaXQ5xLediKRyjjWr2N0zB1x8P8iv 8qqA7pD+2TMMCeJOXjTUtRbjVj60QmJvE6wxxjjfIXkHqB7omhMV7q+TGLfoJIWATH +h0aPfFEC95225wTtEo+eZQlfsGTKlDZGCFf/Bx+IqLaQlOpgicb8mKIkLP++v4HM9 Ky9BsXkp3D8XzigG8EtaJqCM9OaKpUJzr9XYx4NOYDTJEy9wbUiVyjgR/pgWsMI6T7 /w2VDv1wFGQYEZS57+68iiKPgTx35I0ghCaa7qxtFpZ1uvbf8kU5ffo2Q/2A6qctd4 bHesYKbGNAMHA== Content-Type: multipart/mixed; boundary="===============7326159753600941627==" X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: In-Reply-To: <20261201133404.2227100-4-pulehui@huaweicloud.com> References: <20261201133404.2227100-4-pulehui@huaweicloud.com> Subject: Re: [PATCH bpf-next 3/4] riscv, bpf: Eliminate stop_machine in bpf_arch_text_poke with per-image PLT From: bot+bpf-ci@kernel.org To: pulehui@huaweicloud.com,bjorn@kernel.org,bpf@vger.kernel.org,linux-riscv@lists.infradead.org,linux-kernel@vger.kernel.org Cc: 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,puranjay@kernel.org,pjw@kernel.org,palmer@dabbelt.com,alex@ghiti.fr,pulehui@huawei.com,pulehui@huaweicloud.com,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev Date: Tue, 1 Dec 2026 14:19:21 +0000 (UTC) --===============7326159753600941627== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit > riscv, bpf: Eliminate stop_machine in bpf_arch_text_poke with per-image PLT TL;DR: Nit only: the fentry slot layout comment writes "jalr t1, %pcrel_lo", but the code emits jalr with t0 as link register and t1 as base. > diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c > --- a/arch/riscv/net/bpf_jit_comp64.c > +++ b/arch/riscv/net/bpf_jit_comp64.c [ ... ] > +/* > + * fentry slot layout: > + * +0: auipc t1, %pcrel_hi(plt) (fixed at JIT compile time) > + * +4: nop | jal | jalr t1, %pcrel_lo (atomically patched at RV_FENTRY_POKE_OFF) > + */ This isn't a bug, but the long-jump form here reads as "jalr t1, ...", which by the convention used in the rest of this comment would make t1 the link register. gen_poke_insn() actually emits: /* link t0 even for JUMP so PLT switches to CALL stay safe */ *insn = rv_jalr(RV_REG_T0, RV_REG_T1, lower); so rd is t0 and t1 is the base. The trampoline saves t0 as the return address of the traced function and returns through it. Would something like "jalr t0, %pcrel_lo(t1)" match the code better? --- AI reviewed your patch. Please fix the bug or email reply why it's not a bug. See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md CI run summary: https://github.com/kernel-patches/bpf/actions/runs/46660875400 --===============7326159753600941627==--