Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 577EDC61DA3 for ; Tue, 21 Feb 2023 13:40:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234068AbjBUNkC (ORCPT ); Tue, 21 Feb 2023 08:40:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233721AbjBUNkA (ORCPT ); Tue, 21 Feb 2023 08:40:00 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3F7029412; Tue, 21 Feb 2023 05:39:54 -0800 (PST) Received: from kwepemi500020.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4PLgM547Jhz16Nj4; Tue, 21 Feb 2023 21:37:21 +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.17; Tue, 21 Feb 2023 21:39:49 +0800 Message-ID: <1a02055f-deff-649f-9564-417ae916ddb3@huawei.com> Date: Tue, 21 Feb 2023 21:39:48 +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: [PATCH bpf-next v2] riscv, bpf: Add kfunc support for RV64 Content-Language: en-US To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= , Pu Lehui , , , CC: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa References: <87h6vffqlo.fsf@all.your.base.are.belong.to.us> From: Pu Lehui In-Reply-To: <87h6vffqlo.fsf@all.your.base.are.belong.to.us> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.109.184] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemi500020.china.huawei.com (7.221.188.8) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/2/21 15:02, Björn Töpel wrote: > Pu Lehui writes: > >> On 2023/2/20 22:34, Björn Töpel wrote: >>> Pu Lehui writes: >>> >>>> From: Pu Lehui >>>> >>>> As another important missing piece of RV64 JIT, kfunc allow bpf programs >>>> call kernel functions. For now, RV64 is sufficient to enable it. >>> >>> Thanks Lehui! >>> >>> Maybe we can reword/massage the commit message a bit? What do you think >>> about something like: >>> >>> "Now that the BPF trampoline is supported by RISC-V, it is possible to >>> use BPF programs with kfunc calls. >>> >> >> kfunc and bpf trampoline are functionally independent. kfunc [1], like >> bpf helper functions, allows bpf programs to call exported kernel >> functions, while bpf trampoline provides a more efficient way than >> kprobe to act as a mediator between kernel functions and bpf programs, >> and between bpf programs. >> >> In fact, it was already supported before the bpf trampoline >> implementation, I just turned it on. > > Good point. I guess my (incorrect) kfunc mental model was that > struct_ops and kfunc were tightly coupled. (Then again, w/o struct_ops > working kfunc is a bit half-working in my view.) > > Fair enough. I'm still a bit confused about the commit message, but > happy with the patch. > > Acked-by: Björn Töpel Thanks Bjorn, will rewrite commit message to make more sense, and send new soon.