Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp3422648rwj; Mon, 19 Dec 2022 18:39:12 -0800 (PST) X-Google-Smtp-Source: AA0mqf4UDfzhNjL4H5au7sUMwNqbjD4R6M6CSFqcnp8FAg+ZPC8yZBhGzMJkF067WrEaweudzjlI X-Received: by 2002:a05:6a20:d492:b0:a5:df86:f2c3 with SMTP id im18-20020a056a20d49200b000a5df86f2c3mr52515356pzb.32.1671503951773; Mon, 19 Dec 2022 18:39:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671503951; cv=none; d=google.com; s=arc-20160816; b=G/vrOflGuh4n1P6KMA85u/JfJw34ArjmTqz2SsUzvXI6d4BW4gBuvZ1Z7flCO5errk GbZVM+ftb+JMIOP1nC8KQCMnKAAC1Oa63WLE4UA1lT3wvlhYnVQoTAGRgUCXJNH/ACLs niNApdAOLvXKtRqdjryP+f6LYO3beTgoscvt7TtsmLnJ8ktDI9Oiz9Q2/9CalBCAj3+N q2rnNY6Zy9WBN7b2Fm6B2eDHYXMCF/sl6GQV4KNdvM7F1zUs9ynzYEpjhQNx7I8to6fJ 8NL6MjnbJ/e78dj8KgoZEaOKgwiB3f260Hy+zuJLt6VkSDRajZSL9vr11apYlsitxkif 1mQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=2mVCQ75luXmQgoyzSVR9ohX5VIpKSs2c+KI92mfxYDw=; b=XM4bHmUFgLqb2JjNdz94ygFPMx8yz7pqCI4SxEoW3h9Y6bt6ObWWZnz8b/M06iwD5x JC1vpUYRMXptx5DSC71SXA90isHlt+DWcW+roAQcGDk+/8n5f/ELWTP+wG3LrTmPhk3a urOiX0/m/ygsaNnFJeoM7cmYc3CWRIV8qie0kKLBVCDDOlct7ULtc6twxBZvO50vZdwe aJsliXPB73unNiC146qmpouFxHg9V+SoRRGg/5964VmSRAJMdacKDJfUWNPJfsoX/8q+ 9TXAMNaSaeXvABQ99fAOgRzwleaqqBeoyyo0VkTaQilQGGFl3brStYm/EfFrA7dVwHDB M7CA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t132-20020a635f8a000000b00477cd382329si575004pgb.56.2022.12.19.18.39.01; Mon, 19 Dec 2022 18:39:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229556AbiLTCQu (ORCPT + 71 others); Mon, 19 Dec 2022 21:16:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbiLTCQs (ORCPT ); Mon, 19 Dec 2022 21:16:48 -0500 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7E412DC2; Mon, 19 Dec 2022 18:16:47 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4NbgDp1FT1z4f3mLF; Tue, 20 Dec 2022 10:16:42 +0800 (CST) Received: from [10.67.109.184] (unknown [10.67.109.184]) by APP3 (Coremail) with SMTP id _Ch0CgAHAiALG6FjbzqlAA--.4009S2; Tue, 20 Dec 2022 10:16:45 +0800 (CST) Message-ID: <2509f619-15a4-84d6-d199-12e4526bf30e@huaweicloud.com> Date: Tue, 20 Dec 2022 10:16:43 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [RFC PATCH bpf-next 0/4] Support bpf trampoline for RV64 Content-Language: en-US To: bpf@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org 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 , Paul Walmsley , Palmer Dabbelt , Albert Ou , Pu Lehui References: <20221219133736.1387008-1-pulehui@huaweicloud.com> From: Pu Lehui In-Reply-To: <20221219133736.1387008-1-pulehui@huaweicloud.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CM-TRANSID: _Ch0CgAHAiALG6FjbzqlAA--.4009S2 X-Coremail-Antispam: 1UD129KBjvJXoW7tFW8WrWkGFWkJry5XF48Crg_yoW8XrWxpa y8Kry3ur1vqFy7CwnIq3WUXF1Fvr4kX3W3Gw13J3yxC3WYqry7Jr1Fgay3A3s5AF93ua4U tr4YvFn0kw1DAa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvSb4IE77IF4wAFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4 vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7Cj xVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x 0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG 6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFV Cjc4AY6r1j6r4UM4x0Y48IcVAKI48JM4IIrI8v6xkF7I0E8cxan2IY04v7Mxk0xIA0c2IE e2xFo4CEbIxvr21l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxV Aqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r4a 6rW5MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6x kF7I0E14v26r4UJVWxJr1lIxAIcVCF04k26cxKx2IYs7xG6Fyj6rWUJwCI42IY6I8E87Iv 67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r4UJVWxJrUvcSsGvfC2KfnxnUUI43 ZEXa7IU13rcDUUUUU== X-CM-SenderInfo: psxovxtxl6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/12/19 21:37, Pu Lehui wrote: > BPF trampoline is the critical infrastructure of the bpf > subsystem, acting as a mediator between kernel functions > and BPF programs. Numerous important features, such as > using ebpf program for zero overhead kernel introspection, > rely on this key component. We can't wait to support bpf > trampoline on RV64. The implementation of bpf trampoline > was closely to x86 and arm64 for future development. > > As most of riscv cpu support unaligned memory accesses, > we temporarily use patch [1] to facilitate testing. The > test results are as follow, and test_verifier with no > new failure ceses. > > - fexit_test:OK > - fentry_test:OK > - fentry_fexit:OK > - fexit_stress:OK > - fexit_bpf2bpf:OK > - dummy_st_ops:OK > - modify_return:OK > - get_func_ip_test:OK > - get_func_args_test:OK > - trampoline_count:OK > > [1] https://lore.kernel.org/linux-riscv/20210916130855.4054926-2-chenhuang5@huawei.com/ > > Pu Lehui (4): > bpf: Rollback to text_poke when arch not supported ftrace direct call > riscv, bpf: Factor out emit_call for kernel and bpf context > riscv, bpf: Add bpf_arch_text_poke support for RV64 > riscv, bpf: Add bpf trampoline support for RV64 > > arch/riscv/net/bpf_jit.h | 5 + > arch/riscv/net/bpf_jit_comp64.c | 484 ++++++++++++++++++++++++++++++-- > kernel/bpf/trampoline.c | 8 +- > 3 files changed, 472 insertions(+), 25 deletions(-) > sorry, small problem of this patchset, have been resend.