From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF57A620; Mon, 18 Sep 2023 00:32:46 +0000 (UTC) Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57AD811F; Sun, 17 Sep 2023 17:32:45 -0700 (PDT) Received: from kwepemi500020.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Rplzw07rpzVkHc; Mon, 18 Sep 2023 08:29:47 +0800 (CST) Received: from [10.67.109.184] (10.67.109.184) by kwepemi500020.china.huawei.com (7.221.188.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Mon, 18 Sep 2023 08:32:41 +0800 Message-ID: <1708aa5b-78d1-486c-99b1-44d35b4c2f5e@huawei.com> Date: Mon, 18 Sep 2023 08:32:41 +0800 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH bpf-next 3/6] riscv, bpf: Simplify sext and zext logics in branch instructions To: Simon Horman , Pu Lehui CC: , , , =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Palmer Dabbelt , Luke Nelson References: <20230913153413.1446068-1-pulehui@huaweicloud.com> <20230913153413.1446068-4-pulehui@huaweicloud.com> <20230916144742.GB1125562@kernel.org> Content-Language: en-US From: Pu Lehui In-Reply-To: <20230916144742.GB1125562@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.109.184] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500020.china.huawei.com (7.221.188.8) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net On 2023/9/16 22:47, Simon Horman wrote: > On Wed, Sep 13, 2023 at 11:34:10PM +0800, Pu Lehui wrote: >> From: Pu Lehui >> >> There are many extension helpers in the current branch instructions, and >> the implementation is a bit complicated. We simplify this logic through >> two simple extension helpers with alternate register. >> >> Signed-off-by: Pu Lehui >> --- >> arch/riscv/net/bpf_jit_comp64.c | 82 +++++++++++++-------------------- >> 1 file changed, 31 insertions(+), 51 deletions(-) >> >> diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c >> index 4a649e195..1728ce16d 100644 >> --- a/arch/riscv/net/bpf_jit_comp64.c >> +++ b/arch/riscv/net/bpf_jit_comp64.c >> @@ -141,6 +141,19 @@ static bool in_auipc_jalr_range(s64 val) >> val < ((1L << 31) - (1L << 11)); >> } >> >> +/* Modify rd pointer to alternate reg to avoid corrupting orignal reg */ > > Hi Pu Lehui, > > nit: original > > I suggest running checkpatch --codespell over this series before submitting > v2. Thanks Simon, will check this in next.