linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
To: Christophe Leroy <christophe.leroy@csgroup.eu>,
	Saket Kumar Bhaskar <skb99@linux.ibm.com>,
	bpf@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: hbathini@linux.ibm.com, sachinpb@linux.ibm.com,
	andrii@kernel.org, eddyz87@gmail.com, mykolal@fb.com,
	ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev,
	song@kernel.org, yonghong.song@linux.dev,
	john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me,
	haoluo@google.com, jolsa@kernel.org, naveen@kernel.org,
	maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
	memxor@gmail.com, iii@linux.ibm.com, shuah@kernel.org
Subject: Re: [bpf-next 1/6] bpf,powerpc: Introduce bpf_jit_emit_probe_mem_store() to emit store instructions
Date: Tue, 5 Aug 2025 17:29:47 +0530	[thread overview]
Message-ID: <8cfa1cb2-57bf-4984-a64e-53c82440e87f@linux.ibm.com> (raw)
In-Reply-To: <e65548d0-14aa-4b9c-8051-7c91c5dffd1f@csgroup.eu>


On 05/08/25 1:04 pm, Christophe Leroy wrote:
>
>
> Le 05/08/2025 à 08:27, Saket Kumar Bhaskar a écrit :
>> bpf_jit_emit_probe_mem_store() is introduced to emit instructions for
>> storing memory values depending on the size (byte, halfword,
>> word, doubleword).
>
> Build break with this patch
>
>   CC      arch/powerpc/net/bpf_jit_comp64.o
> arch/powerpc/net/bpf_jit_comp64.c:395:12: error: 
> 'bpf_jit_emit_probe_mem_store' defined but not used 
> [-Werror=unused-function]
>  static int bpf_jit_emit_probe_mem_store(struct codegen_context *ctx, 
> u32 src_reg, s16 off,
>             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> make[4]: *** [scripts/Makefile.build:287: 
> arch/powerpc/net/bpf_jit_comp64.o] Error 1
>
I tried this on top of bpf-next, and for me build passed.

Note: I applied 
https://lore.kernel.org/bpf/20250717202935.29018-2-puranjay@kernel.org/ 
before applying current patch.

gcc version 14.2.1 20250110

uname -r: 6.16.0-gf2844c7fdb07

bpf-next repo: 
https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next

HEAD:

commit f3af62b6cee8af9f07012051874af2d2a451f0e5 (origin/master, origin/HEAD)
Author: Tao Chen <chen.dylane@linux.dev>
Date:   Wed Jul 23 22:44:42 2025 +0800

     bpftool: Add bash completion for token argument


Build Success logs:

   TEST-OBJ [test_progs-cpuv4] xdp_vlan.test.o
   TEST-OBJ [test_progs-cpuv4] xdpwall.test.o
   TEST-OBJ [test_progs-cpuv4] xfrm_info.test.o
   BINARY   bench
   BINARY   test_maps
   BINARY   test_progs
   BINARY   test_progs-no_alu32
   BINARY   test_progs-cpuv4


Regards,

Venkat.

>
>>
>> Signed-off-by: Saket Kumar Bhaskar <skb99@linux.ibm.com>
>> ---
>>   arch/powerpc/net/bpf_jit_comp64.c | 30 ++++++++++++++++++++++++++++++
>>   1 file changed, 30 insertions(+)
>>
>> diff --git a/arch/powerpc/net/bpf_jit_comp64.c 
>> b/arch/powerpc/net/bpf_jit_comp64.c
>> index 025524378443..489de21fe3d6 100644
>> --- a/arch/powerpc/net/bpf_jit_comp64.c
>> +++ b/arch/powerpc/net/bpf_jit_comp64.c
>> @@ -409,6 +409,36 @@ asm (
>>   "        blr                ;"
>>   );
>>   +static int bpf_jit_emit_probe_mem_store(struct codegen_context 
>> *ctx, u32 src_reg, s16 off,
>> +                    u32 code, u32 *image)
>> +{
>> +    u32 tmp1_reg = bpf_to_ppc(TMP_REG_1);
>> +    u32 tmp2_reg = bpf_to_ppc(TMP_REG_2);
>> +
>> +    switch (BPF_SIZE(code)) {
>> +    case BPF_B:
>> +        EMIT(PPC_RAW_STB(src_reg, tmp1_reg, off));
>> +        break;
>> +    case BPF_H:
>> +        EMIT(PPC_RAW_STH(src_reg, tmp1_reg, off));
>> +        break;
>> +    case BPF_W:
>> +        EMIT(PPC_RAW_STW(src_reg, tmp1_reg, off));
>> +        break;
>> +    case BPF_DW:
>> +        if (off % 4) {
>> +            EMIT(PPC_RAW_LI(tmp2_reg, off));
>> +            EMIT(PPC_RAW_STDX(src_reg, tmp1_reg, tmp2_reg));
>> +        } else {
>> +            EMIT(PPC_RAW_STD(src_reg, tmp1_reg, off));
>> +        }
>> +        break;
>> +    default:
>> +        return -EINVAL;
>> +    }
>> +    return 0;
>> +}
>> +
>>   static int emit_atomic_ld_st(const struct bpf_insn insn, struct 
>> codegen_context *ctx, u32 *image)
>>   {
>>       u32 code = insn.code;
>

  reply	other threads:[~2025-08-05 12:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-05  6:27 [bpf-next 0/6] bpf,powerpc: Add support for bpf arena and arena atomics Saket Kumar Bhaskar
2025-08-05  6:27 ` [bpf-next 1/6] bpf,powerpc: Introduce bpf_jit_emit_probe_mem_store() to emit store instructions Saket Kumar Bhaskar
2025-08-05  7:34   ` Christophe Leroy
2025-08-05 11:59     ` Venkat Rao Bagalkote [this message]
2025-08-06  6:59       ` Christophe Leroy
2025-08-07 10:29         ` Saket Kumar Bhaskar
2025-08-05  6:27 ` [bpf-next 2/6] bpf,powerpc: Implement PROBE_MEM32 pseudo instructions Saket Kumar Bhaskar
2025-08-05  7:41   ` Christophe Leroy
2025-08-07 13:25     ` Saket Kumar Bhaskar
2025-08-14  8:54   ` Hari Bathini
2025-08-05  6:27 ` [bpf-next 3/6] bpf,powerpc: Implement bpf_addr_space_cast instruction Saket Kumar Bhaskar
2025-08-05  7:29   ` Christophe Leroy
2025-08-07 10:24     ` Saket Kumar Bhaskar
2025-08-05  6:27 ` [bpf-next 4/6] bpf,powerpc: Introduce bpf_jit_emit_atomic_ops() to emit atomic instructions Saket Kumar Bhaskar
2025-08-05  6:27 ` [bpf-next 5/6] bpf,powerpc: Implement PROBE_ATOMIC instructions Saket Kumar Bhaskar
2025-08-05  6:27 ` [bpf-next 6/6] selftests/bpf: Fix arena_spin_lock selftest failure Saket Kumar Bhaskar
2025-08-07 22:21   ` Alexei Starovoitov
2025-08-08 15:28     ` Saket Kumar Bhaskar
2025-08-08 16:27       ` Alexei Starovoitov
2025-08-05  7:45 ` [bpf-next 0/6] bpf,powerpc: Add support for bpf arena and arena atomics Christophe Leroy
2025-08-07 10:26   ` Saket Kumar Bhaskar
2025-08-05 12:07 ` Venkat Rao Bagalkote
2025-08-07 13:17   ` Saket Kumar Bhaskar

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=8cfa1cb2-57bf-4984-a64e-53c82440e87f@linux.ibm.com \
    --to=venkat88@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=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=hbathini@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=mpe@ellerman.id.au \
    --cc=mykolal@fb.com \
    --cc=naveen@kernel.org \
    --cc=npiggin@gmail.com \
    --cc=sachinpb@linux.ibm.com \
    --cc=sdf@fomichev.me \
    --cc=shuah@kernel.org \
    --cc=skb99@linux.ibm.com \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).