LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Hari Bathini <hbathini@linux.ibm.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>
Cc: Song Liu <songliubraving@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
	Martin KaFai Lau <martin.lau@linux.dev>
Subject: Re: [PATCH v2 2/2] powerpc/bpf: enable kfunc call
Date: Thu, 15 Feb 2024 16:05:45 +0530	[thread overview]
Message-ID: <71d6f107-7fd5-45f9-b2cd-e2d1b018720a@linux.ibm.com> (raw)
In-Reply-To: <4dd99601-6990-444c-af23-95cb3f7b156b@csgroup.eu>



On 13/02/24 1:24 pm, Christophe Leroy wrote:
> 
> 
> Le 01/02/2024 à 18:12, Hari Bathini a écrit :
>> With module addresses supported, override bpf_jit_supports_kfunc_call()
>> to enable kfunc support. Module address offsets can be more than 32-bit
>> long, so override bpf_jit_supports_far_kfunc_call() to enable 64-bit
>> pointers.
> 
> What's the impact on PPC32 ? There are no 64-bit pointers on PPC32.

Yeah. Not required to return true for PPC32 case and probably not a
good thing to claim support for far kfunc calls for PPC32. Changing to:

+bool bpf_jit_supports_far_kfunc_call(void)
+{
+	return IS_ENABLED(CONFIG_PPC64);
+}

>>
>> Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
>> ---
>>
>> * No changes since v1.
>>
>>
>>    arch/powerpc/net/bpf_jit_comp.c | 10 ++++++++++
>>    1 file changed, 10 insertions(+)
>>
>> diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
>> index 7b4103b4c929..f896a4213696 100644
>> --- a/arch/powerpc/net/bpf_jit_comp.c
>> +++ b/arch/powerpc/net/bpf_jit_comp.c
>> @@ -359,3 +359,13 @@ void bpf_jit_free(struct bpf_prog *fp)
>>    
>>    	bpf_prog_unlock_free(fp);
>>    }
>> +
>> +bool bpf_jit_supports_kfunc_call(void)
>> +{
>> +	return true;
>> +}
>> +
>> +bool bpf_jit_supports_far_kfunc_call(void)
>> +{
>> +	return true;
>> +}

  reply	other threads:[~2024-02-15 10:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 17:12 [PATCH v2 1/2] powerpc/bpf: ensure module addresses are supported Hari Bathini
2024-02-01 17:12 ` [PATCH v2 2/2] powerpc/bpf: enable kfunc call Hari Bathini
2024-02-13  7:54   ` Christophe Leroy
2024-02-15 10:35     ` Hari Bathini [this message]
2024-02-15 10:44     ` Naveen N Rao
2024-02-13  7:53 ` [PATCH v2 1/2] powerpc/bpf: ensure module addresses are supported Christophe Leroy
2024-02-15 10:37   ` Hari Bathini
2024-02-15 10:37 ` Naveen N Rao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=71d6f107-7fd5-45f9-b2cd-e2d1b018720a@linux.ibm.com \
    --to=hbathini@linux.ibm.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=daniel@iogearbox.net \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=martin.lau@linux.dev \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=songliubraving@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox