Re: [PATCH 01/14] bpf/tests: Add BPF_JMP32 test cases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 29, 2021 at 12:31 AM Yonghong Song <yhs@xxxxxx> wrote:
> > +     /* BPF_JMP32 | BPF_JGT | BPF_X */
> > +     {
> > +             "JMP32_JGT_X",
> > +             .u.insns_int = {
> > +                     BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
> > +                     BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
> > +                     BPF_JMP32_REG(BPF_JGT, R0, R1, 1),
>
> Maybe change the offset from 1 to 2? Otherwise, this may jump to
>    BPF_JMP32_REG(BPF_JGT, R0, R1, 1)
> which will just do the same comparison and jump to BTT_EXIT_INSN()
> which will also have R0 = 0xfffffffe at the end.

You are right. All BPF_X versions should have the first jump offset
incremented by one to account for the extra MOV that is not present in
the BPF_K version of the test. I'll correct it.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux