1. 25 Mar, 2018 1 commit
    • Nicholas Piggin's avatar
      kbuild: rename built-in.o to built-in.a · f49821ee
      Nicholas Piggin authored
      Incremental linking is gone, so rename built-in.o to built-in.a, which
      is the usual extension for archive files.
      
      This patch does two things, first is a simple search/replace:
      
      git grep -l 'built-in\.o' | xargs sed -i 's/built-in\.o/built-in\.a/g'
      
      The second is to invert nesting of nested text manipulations to avoid
      filtering built-in.a out from libs-y2:
      
      -libs-y2 := $(filter-out %.a, $(patsubst %/, %/built-in.a, $(libs-y)))
      +libs-y2 := $(patsubst %/, %/built-in.a, $(filter-out %.a, $(libs-y)))
      Signed-off-by: 's avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: 's avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      f49821ee
  2. 10 Mar, 2018 3 commits
  3. 28 Feb, 2018 1 commit
    • Eric Dumazet's avatar
      test_bpf: reduce MAX_TESTRUNS · 9960d766
      Eric Dumazet authored
      For tests that are using the maximal number of BPF instruction, each
      run takes 20 usec. Looping 10,000 times on them totals 200 ms, which
      is bad when the loop is not preemptible.
      
      test_bpf: #264 BPF_MAXINSNS: Call heavy transformations jited:1 19248
      18548 PASS
      test_bpf: #269 BPF_MAXINSNS: ld_abs+get_processor_id jited:1 20896 PASS
      
      Lets divide by ten the number of iterations, so that max latency is
      20ms. We could use need_resched() to break the loop earlier if we
      believe 20 ms is too much.
      Signed-off-by: 's avatarEric Dumazet <edumazet@google.com>
      Signed-off-by: 's avatarDaniel Borkmann <daniel@iogearbox.net>
      9960d766
  4. 26 Feb, 2018 2 commits
  5. 22 Feb, 2018 1 commit
  6. 21 Feb, 2018 2 commits
  7. 12 Feb, 2018 2 commits
  8. 08 Feb, 2018 1 commit
    • Adam Borowski's avatar
      vsprintf: avoid misleading "(null)" for %px · 3a129cc2
      Adam Borowski authored
      Like %pK already does, print "00000000" instead.
      
      This confused people -- the convention is that "(null)" means you tried to
      dereference a null pointer as opposed to printing the address.
      
      Link: http://lkml.kernel.org/r/20180204174521.21383-1-kilobyte@angband.pl
      To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
      To: Steven Rostedt <rostedt@goodmis.org>
      To: linux-kernel@vger.kernel.org
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Joe Perches <joe@perches.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: "Roberts, William C" <william.c.roberts@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: David Laight <David.Laight@ACULAB.COM>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: 's avatarAdam Borowski <kilobyte@angband.pl>
      Signed-off-by: 's avatarPetr Mladek <pmladek@suse.com>
      3a129cc2
  9. 07 Feb, 2018 19 commits
  10. 06 Feb, 2018 6 commits
    • Matthew Wilcox's avatar
      idr: Make 1-based IDRs more efficient · 6ce711f2
      Matthew Wilcox authored
      About 20% of the IDR users in the kernel want the allocated IDs to start
      at 1.  The implementation currently searches all the way down the left
      hand side of the tree, finds no free ID other than ID 0, walks all the
      way back up, and then all the way down again.  This patch 'rebases' the
      ID so we fill the entire radix tree, rather than leave a gap at 0.
      
      Chris Wilson says: "I did the quick hack of allocating index 0 of the
      idr and that eradicated idr_get_free() from being at the top of the
      profiles for the many-object stress tests. This improvement will be
      much appreciated."
      Signed-off-by: 's avatarMatthew Wilcox <mawilcox@microsoft.com>
      6ce711f2
    • Matthew Wilcox's avatar
      idr: Warn if old iterators see large IDs · 72fd6c7b
      Matthew Wilcox authored
      Now that the IDR can be used to store large IDs, it is possible somebody
      might only partially convert their old code and use the iterators which
      can only handle IDs up to INT_MAX.  It's probably unwise to show them a
      truncated ID, so settle for spewing warnings to dmesg, and terminating
      the iteration.
      Signed-off-by: 's avatarMatthew Wilcox <mawilcox@microsoft.com>
      72fd6c7b
    • Matthew Wilcox's avatar
      idr: Rename idr_for_each_entry_ext · 7a457577
      Matthew Wilcox authored
      Most places in the kernel that we need to distinguish functions by the
      type of their arguments, we use '_ul' as a suffix for the unsigned long
      variant, not '_ext'.  Also add kernel-doc.
      Signed-off-by: 's avatarMatthew Wilcox <mawilcox@microsoft.com>
      7a457577
    • Matthew Wilcox's avatar
      idr: Remove idr_alloc_ext · 460488c5
      Matthew Wilcox authored
      It has no more users, so remove it.  Move idr_alloc() back into idr.c,
      move the guts of idr_alloc_cmn() into idr_alloc_u32(), remove the
      wrappers around idr_get_free_cmn() and rename it to idr_get_free().
      While there is now no interface to allocate IDs larger than a u32,
      the IDR internals remain ready to handle a larger ID should a need arise.
      
      These changes make it possible to provide the guarantee that, if the
      nextid pointer points into the object, the object's ID will be initialised
      before a concurrent lookup can find the object.
      Signed-off-by: 's avatarMatthew Wilcox <mawilcox@microsoft.com>
      460488c5
    • Matthew Wilcox's avatar
      idr: Add idr_alloc_u32 helper · e096f6a7
      Matthew Wilcox authored
      All current users of idr_alloc_ext() actually want to allocate a u32
      and idr_alloc_u32() fits their needs better.
      
      Like idr_get_next(), it uses a 'nextid' argument which serves as both
      a pointer to the start ID and the assigned ID (instead of a separate
      minimum and pointer-to-assigned-ID argument).  It uses a 'max' argument
      rather than 'end' because the semantics that idr_alloc has for 'end'
      don't work well for unsigned types.
      
      Since idr_alloc_u32() returns an errno instead of the allocated ID, mark
      it as __must_check to help callers use it correctly.  Include copious
      kernel-doc.  Chris Mi <chrism@mellanox.com> has promised to contribute
      test-cases for idr_alloc_u32.
      Signed-off-by: 's avatarMatthew Wilcox <mawilcox@microsoft.com>
      e096f6a7
    • Matthew Wilcox's avatar
      idr: Delete idr_replace_ext function · 234a4624
      Matthew Wilcox authored
      Changing idr_replace's 'id' argument to 'unsigned long' works for all
      callers.  Callers which passed a negative ID now get -ENOENT instead of
      -EINVAL.  No callers relied on this error value.
      Signed-off-by: 's avatarMatthew Wilcox <mawilcox@microsoft.com>
      234a4624
  11. 04 Feb, 2018 1 commit
    • Yonghong Song's avatar
      bpf: fix selftests/bpf test_kmod.sh failure when CONFIG_BPF_JIT_ALWAYS_ON=y · 09584b40
      Yonghong Song authored
      With CONFIG_BPF_JIT_ALWAYS_ON is defined in the config file,
      tools/testing/selftests/bpf/test_kmod.sh failed like below:
        [root@localhost bpf]# ./test_kmod.sh
        sysctl: setting key "net.core.bpf_jit_enable": Invalid argument
        [ JIT enabled:0 hardened:0 ]
        [  132.175681] test_bpf: #297 BPF_MAXINSNS: Jump, gap, jump, ... FAIL to prog_create err=-524 len=4096
        [  132.458834] test_bpf: Summary: 348 PASSED, 1 FAILED, [340/340 JIT'ed]
        [ JIT enabled:1 hardened:0 ]
        [  133.456025] test_bpf: #297 BPF_MAXINSNS: Jump, gap, jump, ... FAIL to prog_create err=-524 len=4096
        [  133.730935] test_bpf: Summary: 348 PASSED, 1 FAILED, [340/340 JIT'ed]
        [ JIT enabled:1 hardened:1 ]
        [  134.769730] test_bpf: #297 BPF_MAXINSNS: Jump, gap, jump, ... FAIL to prog_create err=-524 len=4096
        [  135.050864] test_bpf: Summary: 348 PASSED, 1 FAILED, [340/340 JIT'ed]
        [ JIT enabled:1 hardened:2 ]
        [  136.442882] test_bpf: #297 BPF_MAXINSNS: Jump, gap, jump, ... FAIL to prog_create err=-524 len=4096
        [  136.821810] test_bpf: Summary: 348 PASSED, 1 FAILED, [340/340 JIT'ed]
        [root@localhost bpf]#
      
      The test_kmod.sh load/remove test_bpf.ko multiple times with different
      settings for sysctl net.core.bpf_jit_{enable,harden}. The failed test #297
      of test_bpf.ko is designed such that JIT always fails.
      
      Commit 290af866 (bpf: introduce BPF_JIT_ALWAYS_ON config)
      introduced the following tightening logic:
          ...
              if (!bpf_prog_is_dev_bound(fp->aux)) {
                      fp = bpf_int_jit_compile(fp);
          #ifdef CONFIG_BPF_JIT_ALWAYS_ON
                      if (!fp->jited) {
                              *err = -ENOTSUPP;
                              return fp;
                      }
          #endif
          ...
      With this logic, Test #297 always gets return value -ENOTSUPP
      when CONFIG_BPF_JIT_ALWAYS_ON is defined, causing the test failure.
      
      This patch fixed the failure by marking Test #297 as expected failure
      when CONFIG_BPF_JIT_ALWAYS_ON is defined.
      
      Fixes: 290af866 (bpf: introduce BPF_JIT_ALWAYS_ON config)
      Signed-off-by: 's avatarYonghong Song <yhs@fb.com>
      Signed-off-by: 's avatarDaniel Borkmann <daniel@iogearbox.net>
      09584b40
  12. 02 Feb, 2018 1 commit