From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.180 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796097413; b=sHDb+NrAziwJnUWl2zR8sQVSSloGiWrmxxfyRDWk+egG2cHHBp8iCHF+bxVPDy5sxvJy T83ieEQgvtUtR8Zqczd4w3wrnfs5rvwGtbNpbLXXx7muPD2tW1VA0oou9PSgvInbGfCYe IuWaCz7QfBTDXov7HZjrpM8U4CK/bCz4z6n3gNSLXVZIzKviUX4R01KKHf9PaZ+miu3eM MMj17XyVARlXhMKgxSJIbaoEkCjXIMEQCZu68hyaHOmw8yFXgEWGkml1Soy3iyK8JDCFr t3Qn67qO2CviTQKEi8PBqzE+zdlffqNRyo/sTNaOzkFxU4gkqr5x/9tvRRdtC9LdNOA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796097413; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Mime-Version:Content-Transfer-Encoding:Content-Type:Date:Message-Id: Cc:Subject:From:To:X-Mailer:References:In-Reply-To; bh=wWu2M6fZPNuVhY4ixCygPV0kdsXUlehVTo+pmbxDmsM=; b=mQl2Zy2lc+4YFryvFwtrPbExnGHVgg8lNa6z+ON7tvaOjjsV0Nslkk3WkxKYi4TzbotD O/eiVmvW68iUJnsEd3rRpT8+12Z0YkOZhVO2XCfTnnZLrrnCL3mZoF6mGa/eeeLgFVJyM 7zPtP4GGVHHH0xsyabt6cuNiPffSS8lO2GVXoJLL3MIo1b5KcBu4pwLq1hBvixB3iuRBF cGFRY4y4SGzOCCsEfXxSFNk19f279qPwjKgrca6fWgC4+AIlZthG2/9PBjYVDOALVt7eP fvv8kPaG98oNdXdSrSdKh4iE567zt0GYObtwMJwdkETvgTy/rlIaCZEL+dqcxeavsRw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=b7XkPxYH; arc=none smtp.remote-ip=209.85.215.180 Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D71B606A320 for ; Tue, 1 Dec 2026 03:56:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5D71B606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=b7XkPxYH Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-ccca948203aso7633577a12.3 for ; Mon, 30 Nov 2026 19:56:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796097413; x=1796702213; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=wWu2M6fZPNuVhY4ixCygPV0kdsXUlehVTo+pmbxDmsM=; b=b7XkPxYHopQKSwtg8j2tWON+auk0LcObEgMvcHI5TEVT/XvfbgzB7mQJlFidPpkYzi 07A0EOJsxRZYGm4e0Kp9Ls2EATr1LA0hCTqPTYORdPDsuulc7SEhOabLpdViZt0IsM5L fFvxX1yh2PDrsZbA6OPteAIGbrFwc7mtTVgcWZBTIDKlKgOysrO+1CPOTgv9Pi3kQYQU XZsEU+e3be9FqJ+N6FCz93lRo5q+vA/6eUrSn0CeL+Ri63tP9cRLtClwKSR0u6HGOwcO KhmmZhlkyo+ivkpvWaO0P1BOcaVCG7um3DGe6yHrEVpNW8d9Hv+k3qxD2YcenNDdHce0 +GfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796097413; x=1796702213; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-type:content-transfer-encoding:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wWu2M6fZPNuVhY4ixCygPV0kdsXUlehVTo+pmbxDmsM=; b=Yv9humzQJqMdyJEloZZROf6PIE4z6rgJjM7NLFv7N4ad58Kvf7SgifFpiukQkelNY6 v+JnhS4JaiG4KyOIGuo7J5qvVByV3Fcq0mGU01FXTvjW/oQwDhNtq//xxq0yFDsVItUr ZVupU2ZDjhbpuRbsHP4/Byftfsq4d/5ASI1Ay5hHPSocmAM2HIvFcLJOOwo8iv6svLDu ddcWueDdK+qZNzipln9yKdYhWkHa+LIsRo27u0CoDvtB30g/kQkcjmTB7IUqt8panxcv 7froOdt335JtLBvQ4jaUDQ70ygt+gFcnx7gTgpN79GbTYrL0pWG3gBhwHc30DYHg1ErZ 0uxA== X-Forwarded-Encrypted: i=1; AL+hErGiPddgeluMfh2rfBI9gFNejRHUxc3XJumRhLahCFbxUWqUcxU7sMs8ukiJg2Kx/E6mbt16CigJ0IhEr08=@vger.kernel.org X-Gm-Message-State: APuU4Z9K4S8dY6gJriZJSUNME6zfoCptoTOQ9uLRk38a+Kag6UEyYAmR ar20rbKYsL7Ty8gdshjHd6alefHN4H0fPLe7GcnFXkiFQcAzcurHO7KX X-Gm-Gg: AZFdTZd/8qiaQxKMGUqKSSDofEQqsh22TlPC9u9Qwqpp1Od5zBAI+h7wz5zPBNnB9si Phj+B/aEOhm7Bec5loTSj/rwspEcrsvGFGvJlqTeEDQErEbb6lzrfAj+h04QgQzFtO53Sz+/d8H LIat+GAbpXS7YIkxVm8wBWqB8k3g/4jaIGKeOTd3aTbWC4Hd+Xlthu/H6Wn7o1MIdx/7mUOoohs B4CkvlPpz8UiAK5zfYDybZ8RciK8YyPrYRVrYmejP/9RuuEeHRMiRmxakvTN8APF2TkjYgNMr4u HbNjzRidbQj6qtYvrIBg8laP2jHg3Gyxu2xTtLzH+QMBMVfdsavzQkdhRWBJqcsY8Oitx+x/gfb pUfVh4XdhZD4ia+iejhkpWwVf3Ci8IpyYTb6dgoLytCuNxjoWt0dFg0339g35Bdf85x7tvujNh/ pEwAvI51ffhcDTJ1Q/u7E36+BsQjvbZJhRZ1dLUStSrphnN/Y1kiVagCTn3ffiLodAtlZbZH49Q LrjegDgQAetrw5YiFqLljN4G7ZeHQi4KCnQIqF8/C1c9yS9/yPD4zBXJqC0cRyuWeL5JAX99Kp+ V/d/FmWqA+EBt+qcyASZAs4bZGhhXi193vkXkOERtJU81JxSAQi8EoVQcYBMAiql9JtPRDWE1ep SjYZY2CugOZATYJEh0l7qEfIBSHqFtRyeXw== X-Received: by 2002:a05:6a21:6f11:b0:3f8:d7eb:1ac1 with SMTP id adf61e73a8af0-4014d456c18mr37532421637.53.1796097412457; Mon, 30 Nov 2026 19:56:52 -0800 (PST) Received: from localhost ([153.61.198.248]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c86d821637sm19299876b3a.0.2026.11.30.19.56.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Nov 2026 19:56:52 -0800 (PST) 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 01 Dec 2026 03:56:51 +0000 Message-Id: Cc: , , Subject: Re: [PATCH bpf-next v1] riscv, bpf: Remove invoke_bpf_mod_ret in code comment From: "Alexei Starovoitov" To: "Tiezhu Yang" , "Pu Lehui" , =?utf-8?q?Bj=C3=B6rn_T=C3=B6pel?= , "Puranjay Mohan" X-Mailer: aerc 0.20.1-355-gf870624f6c37 References: <20261130090000.2848-1-yangtiezhu@loongson.cn> <676a79e8-2c68-4d04-85c1-ab94ea7656cf@huawei.com> <0e7d9ed9-bfa2-a66d-c6b5-76427dddcf7d@loongson.cn> In-Reply-To: <0e7d9ed9-bfa2-a66d-c6b5-76427dddcf7d@loongson.cn> On Mon Nov 30, 2026 at 12:21 PM UTC, Tiezhu Yang wrote: > On 11/30/26 7:56 PM, Pu Lehui wrote: >>=20 >>=20 >> On 2026/11/30 17:00, Tiezhu Yang wrote: >>> There is no function invoke_bpf_mod_ret(), remove it in the code commen= t >>> to reflect the reality. >>> >>> Signed-off-by: Tiezhu Yang >>> --- >>> I guess this is a copy-paste issue from other architectures, >>> because there was already no invoke_bpf_mod_ret() in the initial >>> commit 49b5e77ae3e2 ("riscv, bpf: Add bpf trampoline support for RV64")= : >>> >>> $ grep -rn "branches saved in invoke_bpf_mod_ret with" . >>> ./arch/x86/net/bpf_jit_comp.c:4552:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 /* Update the branches=20 >>> saved in invoke_bpf_mod_ret with the >>> ./arch/arm64/net/bpf_jit_comp.c:3524:=C2=A0=C2=A0=C2=A0 /* update the b= ranches saved=20 >>> in invoke_bpf_mod_ret with cbnz */ >>> ./arch/powerpc/net/bpf_jit_comp.c:1150:=C2=A0=C2=A0=C2=A0 /* Update bra= nches saved in=20 >>> invoke_bpf_mod_ret with address of do_fexit */ >>> ./arch/riscv/net/bpf_jit_comp64.c:1300:=C2=A0=C2=A0=C2=A0 /* update bra= nches saved in=20 >>> invoke_bpf_mod_ret with bnez */ >>> >>> =C2=A0 arch/riscv/net/bpf_jit_comp64.c | 2 +- >>> =C2=A0 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/arch/riscv/net/bpf_jit_comp64.c=20 >>> b/arch/riscv/net/bpf_jit_comp64.c >>> index a7a7d2f9da85..fb58524cd095 100644 >>> --- a/arch/riscv/net/bpf_jit_comp64.c >>> +++ b/arch/riscv/net/bpf_jit_comp64.c >>> @@ -1297,7 +1297,7 @@ static int __arch_prepare_bpf_trampoline(struct= =20 >>> bpf_tramp_image *im, >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 emit_sd(RV_REG_F= P, -(retval_off - 8), regmap[BPF_REG_0], ctx); >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>> -=C2=A0=C2=A0=C2=A0 /* update branches saved in invoke_bpf_mod_ret with= bnez */ >>=20 >> I think this is a bit vague. How about: >> /* patch fmod_ret nops with bnez to skip orig_call */ >>=20 >>> +=C2=A0=C2=A0=C2=A0 /* update branches with bnez */ >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 for (i =3D 0; ctx->insns && i < fmod_ret= ->nr_nodes; i++) { >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 offset =3D ninsn= s_rvoff(ctx->ninsns - branches_off[i]); >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 insn =3D rv_bne(= RV_REG_T1, RV_REG_ZERO, offset >> 1); > > The reason I wrote > /* update branches with bnez */ > is to keep it symmetric with the earlier comment > /* update branch with beqz */ > in invoke_bpf_prog(), and also consistent with the LoongArch > BPF JIT implementation (arch/loongarch/net/bpf_jit.c), which > uses the exact same phrasing in both places. > > Also, branches_off[] is populated right above this loop with > the comment /* nop reserved for conditional jump */, so the > context is quite close and clear here. > > I am fine with either way, let's see what Bj=C3=B6rn and Puranjay > think, and I can send a v2 if the more descriptive comment is > preferred. Nack this patch and don't send patches like this anymore that tweak comment= s in the non obvious way. Steer your tokens to useful work. This patch is not helpful. Pure waste of tokens and human's time. pw-bot: cr