1. 30 Aug, 2019 2 commits
    • Quentin Monnet's avatar
      tools: bpftool: ignore make built-in rules for getting kernel version · e0a43aa3
      Quentin Monnet authored
      Bpftool calls the toplevel Makefile to get the kernel version for the
      sources it is built from. But when the utility is built from the top of
      the kernel repository, it may dump the following error message for
      certain architectures (including x86):
      
          $ make tools/bpf
          [...]
          make[3]: *** [checkbin] Error 1
          [...]
      
      This does not prevent bpftool compilation, but may feel disconcerting.
      The "checkbin" arch-dependent target is not supposed to be called for
      target "kernelversion", which is a simple "echo" of the version number.
      
      It turns out this is caused by the make invocation in tools/bpf/bpftool,
      which attempts to find implicit rules to apply. Extract from debug
      output:
      
          Reading makefiles...
          Reading makefile 'Makefile'...
          Reading makefile 'scripts/Kbuild.include' (search path) (no ~ expansion)...
          Reading makefile 'scripts/subarch.include' (search path) (no ~ expansion)...
          Reading makefile 'arch/x86/Makefile' (search path) (no ~ expansion)...
          Reading makefile 'scripts/Makefile.kcov' (search path) (no ~ expansion)...
          Reading makefile 'scripts/Makefile.gcc-plugins' (search path) (no ~ expansion)...
          Reading makefile 'scripts/Makefile.kasan' (search path) (no ~ expansion)...
          Reading makefile 'scripts/Makefile.extrawarn' (search path) (no ~ expansion)...
          Reading makefile 'scripts/Makefile.ubsan' (search path) (no ~ expansion)...
          Updating makefiles....
           Considering target file 'scripts/Makefile.ubsan'.
            Looking for an implicit rule for 'scripts/Makefile.ubsan'.
            Trying pattern rule with stem 'Makefile.ubsan'.
          [...]
            Trying pattern rule with stem 'Makefile.ubsan'.
            Trying implicit prerequisite 'scripts/Makefile.ubsan.o'.
            Looking for a rule with intermediate file 'scripts/Makefile.ubsan.o'.
             Avoiding implicit rule recursion.
             Trying pattern rule with stem 'Makefile.ubsan'.
             Trying rule prerequisite 'prepare'.
             Trying rule prerequisite 'FORCE'.
            Found an implicit rule for 'scripts/Makefile.ubsan'.
              Considering target file 'prepare'.
               File 'prepare' does not exist.
                Considering target file 'prepare0'.
                 File 'prepare0' does not exist.
                  Considering target file 'archprepare'.
                   File 'archprepare' does not exist.
                    Considering target file 'archheaders'.
                     File 'archheaders' does not exist.
                     Finished prerequisites of target file 'archheaders'.
                    Must remake target 'archheaders'.
          Putting child 0x55976f4f6980 (archheaders) PID 31743 on the chain.
      
      To avoid that, pass the -r and -R flags to eliminate the use of make
      built-in rules (and while at it, built-in variables) when running
      command "make kernelversion" from bpftool's Makefile.
      Signed-off-by: default avatarQuentin Monnet <quentin.monnet@netronome.com>
      Reviewed-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      e0a43aa3
    • Yauheni Kaliuta's avatar
      bpf: s390: add JIT support for multi-function programs · 1c8f9b91
      Yauheni Kaliuta authored
      This adds support for bpf-to-bpf function calls in the s390 JIT
      compiler. The JIT compiler converts the bpf call instructions to
      native branch instructions. After a round of the usual passes, the
      start addresses of the JITed images for the callee functions are
      known. Finally, to fixup the branch target addresses, we need to
      perform an extra pass.
      
      Because of the address range in which JITed images are allocated on
      s390, the offsets of the start addresses of these images from
      __bpf_call_base are as large as 64 bits. So, for a function call,
      the imm field of the instruction cannot be used to determine the
      callee's address. Use bpf_jit_get_func_addr() helper instead.
      
      The patch borrows a lot from:
      
      commit 8c11ea5c ("bpf, arm64: fix getting subprog addr from aux
      for calls")
      
      commit e2c95a61 ("bpf, ppc64: generalize fetching subprog into
      bpf_jit_get_func_addr")
      
      commit 8484ce83 ("bpf: powerpc64: add JIT support for
      multi-function programs")
      
      (including the commit message).
      
      test_verifier (5.3-rc6 with CONFIG_BPF_JIT_ALWAYS_ON=y):
      
      without patch:
      Summary: 1501 PASSED, 0 SKIPPED, 47 FAILED
      
      with patch:
      Summary: 1540 PASSED, 0 SKIPPED, 8 FAILED
      Signed-off-by: default avatarYauheni Kaliuta <yauheni.kaliuta@redhat.com>
      Acked-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
      Tested-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
      Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
      1c8f9b91
  2. 27 Aug, 2019 11 commits
  3. 21 Aug, 2019 10 commits
  4. 20 Aug, 2019 10 commits
  5. 17 Aug, 2019 7 commits