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 CFD31C64EC7 for ; Tue, 21 Feb 2023 07:02:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233428AbjBUHC5 (ORCPT ); Tue, 21 Feb 2023 02:02:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232589AbjBUHCx (ORCPT ); Tue, 21 Feb 2023 02:02:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CF77252B6; Mon, 20 Feb 2023 23:02:47 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ABE9C60F06; Tue, 21 Feb 2023 07:02:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9FED7C433D2; Tue, 21 Feb 2023 07:02:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676962966; bh=KHMXE/LYnRNjuYWIFxQpGNwDw4WhCf5BXnM9jJyFYKc=; h=From:To:Cc:Subject:In-Reply-To:Date:From; b=Yhirujjn3Gs86md/vNl+4XmkPPjo94SNOAaKFnOQXjQX0yv6l93XMl4Rob/1p9Mz1 BildrxHwu/yefVQiDMIl7NerNxFloHYRyqcm2B4R4tbghBYAkiMhmCNPjpT1Od05VX amluMYPMkNK+MpZbAwYf/8YLhEMvqDTzgSe3GeTjwLDOTUyttUSxZ7IKckID//bHdy law45gIPLx1cUA8MzcuejYCUYm9QgN6v3pwGQeyhnP2oWDTUQKixA934HlVQ9vrnV2 eAmVeCjUaOlME832YphdHzsDFaUFjXu0u2WRsFWYtK5D31ISj2b1xYR7ciu0peUqlW v7vDwyZ5fr6JQ== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Pu Lehui , bpf@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Pu Lehui Subject: Re: [PATCH bpf-next v2] riscv, bpf: Add kfunc support for RV64 In-Reply-To: <80e69e73-b873-6717-fe45-a854dbdd5476@huaweicloud.com> Date: Tue, 21 Feb 2023 08:02:43 +0100 Message-ID: <87h6vffqlo.fsf@all.your.base.are.belong.to.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pu Lehui writes: > On 2023/2/20 22:34, Bj=C3=B6rn T=C3=B6pel wrote: >> Pu Lehui writes: >>=20 >>> 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. >>=20 >> Thanks Lehui! >>=20 >> Maybe we can reword/massage the commit message a bit? What do you think >> about something like: >>=20 >> "Now that the BPF trampoline is supported by RISC-V, it is possible to >> use BPF programs with kfunc calls. >>=20 > > kfunc and bpf trampoline are functionally independent. kfunc [1], like=20 > bpf helper functions, allows bpf programs to call exported kernel=20 > functions, while bpf trampoline provides a more efficient way than=20 > kprobe to act as a mediator between kernel functions and bpf programs,=20 > and between bpf programs. > > In fact, it was already supported before the bpf trampoline=20 > 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=C3=B6rn T=C3=B6pel