1. 03 Apr, 2024 1 commit
    • Puranjay Mohan's avatar
      bpf: Add arm64 JIT support for PROBE_MEM32 pseudo instructions. · 339af577
      Puranjay Mohan authored
      Add support for [LDX | STX | ST], PROBE_MEM32, [B | H | W | DW]
      instructions.  They are similar to PROBE_MEM instructions with the
      following differences:
      - PROBE_MEM32 supports store.
      - PROBE_MEM32 relies on the verifier to clear upper 32-bit of the
        src/dst register
      - PROBE_MEM32 adds 64-bit kern_vm_start address (which is stored in R28
        in the prologue). Due to bpf_arena constructions such R28 + reg +
        off16 access is guaranteed to be within arena virtual range, so no
        address check at run-time.
      - PROBE_MEM32 allows STX and ST. If they fault the store is a nop. When
        LDX faults the destination register is zeroed.
      
      To support these on arm64, we do tmp2 = R28 + src/dst reg and then use
      tmp2 as the new src/dst register. This allows us to reuse most of the
      code for normal [LDX | STX | ST].
      Signed-off-by: default avatarPuranjay Mohan <puranjay12@gmail.com>
      Link: https://lore.kernel.org/r/20240325150716.4387-2-puranjay12@gmail.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      339af577
  2. 02 Apr, 2024 11 commits
  3. 30 Mar, 2024 1 commit
    • Andrii Nakryiko's avatar
      selftests/bpf: make multi-uprobe tests work in RELEASE=1 mode · 623bdd58
      Andrii Nakryiko authored
      When BPF selftests are built in RELEASE=1 mode with -O2 optimization
      level, uprobe_multi binary, called from multi-uprobe tests is optimized
      to the point that all the thousands of target uprobe_multi_func_XXX
      functions are eliminated, breaking tests.
      
      So ensure they are preserved by using weak attribute.
      
      But, actually, compiling uprobe_multi binary with -O2 takes a really
      long time, and is quite useless (it's not a benchmark). So in addition
      to ensuring that uprobe_multi_func_XXX functions are preserved, opt-out
      of -O2 explicitly in Makefile and stick to -O0. This saves a lot of
      compilation time.
      
      With -O2, just recompiling uprobe_multi:
      
        $ touch uprobe_multi.c
        $ time make RELEASE=1 -j90
        make RELEASE=1 -j90  291.66s user 2.54s system 99% cpu 4:55.52 total
      
      With -O0:
        $ touch uprobe_multi.c
        $ time make RELEASE=1 -j90
        make RELEASE=1 -j90  22.40s user 1.91s system 99% cpu 24.355 total
      
      5 minutes vs (still slow, but...) 24 seconds.
      Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
      Link: https://lore.kernel.org/r/20240329190410.4191353-1-andrii@kernel.orgSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
      623bdd58
  4. 29 Mar, 2024 27 commits