From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=113.46.200.221 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796039842; b=VYOxIGSMd9V/2wW+QcLKZ2MiYat4d+otvuE9mxAhAK4LViRPQPnjLHl+VUevcGlIpkny /dkPxKq26yZIKHETo5HxW/TRkBX5WlYps04TG+8w7Vo3r7DCm56kNR4IsS2im19+vsznN RtNdtwDklFJkqVQEBxlJ1u6jFcFYga7vQQpuvGwoAKmTqwPaDnkLKyAeaJAn21/0KiyVE MroOqEmXyS7YNxbQbr+Ogv5b2fQz/5JQzE3ghjCb4pNyXk8mnRnspGsP9xvQEUuqDV/Vy qMyJbdB8xdXHDYTYA+xqXh8QurYBiSvUsarMHARqVe3ujipld2wy3XqR4QjXddL4XaA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796039842; h=DMARC-Filter:dkim-signature:Received:Received:Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:Content-Language:To: CC:References:From:In-Reply-To:Content-Type:Content-Transfer-Encoding: X-Originating-IP:X-ClientProxiedBy; bh=j5ceI7freBbErLWNQM1QCM3qhZ5NKUWbf3lS/dydGYE=; b=v4MybdbtEgv0S5ybiHk2qYSzxGvCLK6+EHOmNAlK+5g8ty7URJteoq9AJuJONidE8swr Zz3MJwOSgi+SYEf46jbJwFahwzGjG18x/5iNTIBuzmGpLMyztSesU+B3kKOdiQZfnz6kQ nQwQsWaJpY982AKQbvpcvH34zytKxC8i+xlHJ0xo8e6QCrWUxQxfdIcP0HEswTcNjajnx wCvopLPfiYf+TrHYY6uoMaoC0dH0iMhTIJSlDLSMgI0mLRtSwKhhclgfcH+5Sqho892YY 1fM4ZI821ngo9heM26/NKyCthA35yOmBd/snDuEP6/UOThyjpJ1XAsyGL93Y6rCKwpQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; dkim=pass header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=O1dyrC6I; arc=none smtp.remote-ip=113.46.200.221 Received: from canpmsgout06.his.huawei.com (canpmsgout06.his.huawei.com [113.46.200.221]) (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 E21B5606A31C; Mon, 30 Nov 2026 11:57:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E21B5606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=huawei.com header.i=@huawei.com header.a=rsa-sha256 header.s=dkim header.b=O1dyrC6I dkim-signature: v=1; a=rsa-sha256; d=huawei.com; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From; bh=j5ceI7freBbErLWNQM1QCM3qhZ5NKUWbf3lS/dydGYE=; b=O1dyrC6I5eda4uhlJRgoX6vCMQdPaa5zHzvjASAmxvoU/ZoIpfQub5lcpmJUoyzo1fQBr1WKd cg4IgYwj2VMCIEELpHqkxMqZ0hz428Cdc0hUkxi+roDMLHjaltQsAtUjadjuzUv75jrgRLFSVWc BH/aSM1WlluO+PcnrKhusJY= Received: from mail.maildlp.com (unknown [172.19.163.0]) by canpmsgout06.his.huawei.com (SkyGuard) with ESMTPS id 4jdMv84Gc9zRhQg; Mon, 30 Nov 2026 19:56:52 +0800 (CST) Received: from dggpemr500006.china.huawei.com (unknown [7.185.36.185]) by mail.maildlp.com (Postfix) with ESMTPS id 4FA1240561; Mon, 30 Nov 2026 19:57:14 +0800 (CST) Received: from whupemq100006.china.huawei.com (7.152.184.206) by dggpemr500006.china.huawei.com (7.185.36.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Mon, 30 Nov 2026 19:57:14 +0800 Received: from [10.67.110.154] (10.67.110.154) by whupemq100006.china.huawei.com (7.152.184.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.56; Mon, 30 Nov 2026 19:57:13 +0800 Message-ID: <676a79e8-2c68-4d04-85c1-ab94ea7656cf@huawei.com> Date: Mon, 30 Nov 2026 19:56:28 +0800 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH bpf-next v1] riscv, bpf: Remove invoke_bpf_mod_ret in code comment Content-Language: en-US To: Tiezhu Yang , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Puranjay Mohan CC: , , References: <20261130090000.2848-1-yangtiezhu@loongson.cn> From: Pu Lehui In-Reply-To: <20261130090000.2848-1-yangtiezhu@loongson.cn> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: kwepems100001.china.huawei.com (7.221.188.238) To whupemq100006.china.huawei.com (7.152.184.206) On 2026/11/30 17:00, Tiezhu Yang wrote: > There is no function invoke_bpf_mod_ret(), remove it in the code comment > 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: /* Update the branches saved in invoke_bpf_mod_ret with the > ./arch/arm64/net/bpf_jit_comp.c:3524: /* update the branches saved in invoke_bpf_mod_ret with cbnz */ > ./arch/powerpc/net/bpf_jit_comp.c:1150: /* Update branches saved in invoke_bpf_mod_ret with address of do_fexit */ > ./arch/riscv/net/bpf_jit_comp64.c:1300: /* update branches saved in invoke_bpf_mod_ret with bnez */ > > arch/riscv/net/bpf_jit_comp64.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/net/bpf_jit_comp64.c 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 bpf_tramp_image *im, > emit_sd(RV_REG_FP, -(retval_off - 8), regmap[BPF_REG_0], ctx); > } > > - /* update branches saved in invoke_bpf_mod_ret with bnez */ I think this is a bit vague. How about: /* patch fmod_ret nops with bnez to skip orig_call */ > + /* update branches with bnez */ > for (i = 0; ctx->insns && i < fmod_ret->nr_nodes; i++) { > offset = ninsns_rvoff(ctx->ninsns - branches_off[i]); > insn = rv_bne(RV_REG_T1, RV_REG_ZERO, offset >> 1);