1. 02 4月, 2017 3 次提交
  2. 23 3月, 2017 2 次提交
    • M
      bpf: Add tests for map-in-map · fb30d4b7
      Martin KaFai Lau 提交于
      Test cases for array of maps and hash of maps.
      Signed-off-by: NMartin KaFai Lau <kafai@fb.com>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fb30d4b7
    • A
      bpf: fix hashmap extra_elems logic · 8c290e60
      Alexei Starovoitov 提交于
      In both kmalloc and prealloc mode the bpf_map_update_elem() is using
      per-cpu extra_elems to do atomic update when the map is full.
      There are two issues with it. The logic can be misused, since it allows
      max_entries+num_cpus elements to be present in the map. And alloc_extra_elems()
      at map creation time can fail percpu alloc for large map values with a warn:
      WARNING: CPU: 3 PID: 2752 at ../mm/percpu.c:892 pcpu_alloc+0x119/0xa60
      illegal size (32824) or align (8) for percpu allocation
      
      The fixes for both of these issues are different for kmalloc and prealloc modes.
      For prealloc mode allocate extra num_possible_cpus elements and store
      their pointers into extra_elems array instead of actual elements.
      Hence we can use these hidden(spare) elements not only when the map is full
      but during bpf_map_update_elem() that replaces existing element too.
      That also improves performance, since pcpu_freelist_pop/push is avoided.
      Unfortunately this approach cannot be used for kmalloc mode which needs
      to kfree elements after rcu grace period. Therefore switch it back to normal
      kmalloc even when full and old element exists like it was prior to
      commit 6c905981 ("bpf: pre-allocate hash map elements").
      
      Add tests to check for over max_entries and large map values.
      Reported-by: NDave Jones <davej@codemonkey.org.uk>
      Fixes: 6c905981 ("bpf: pre-allocate hash map elements")
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NMartin KaFai Lau <kafai@fb.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8c290e60
  3. 22 3月, 2017 1 次提交
  4. 13 3月, 2017 1 次提交
  5. 10 3月, 2017 1 次提交
  6. 09 3月, 2017 1 次提交
    • C
      selftests/powerpc: Replace stxvx and lxvx with stxvd2x/lxvd2x · 605df8d6
      Cyril Bur 提交于
      On POWER8 (ISA 2.07) lxvx and stxvx are defined to be extended mnemonics
      of lxvd2x and stxvd2x. For POWER9 (ISA 3.0) the HW architects in their
      infinite wisdom made lxvx and stxvx instructions in their own right.
      
      POWER9 aware GCC will use the POWER9 instruction for lxvx and stxvx
      causing these selftests to fail on POWER8. Further compounding the
      issue, because of the way -mvsx works it will cause the power9
      instructions to be used regardless of -mcpu=power8 to GCC or -mpower8 to
      AS.
      
      The safest way to address the problem for now is to not use the extended
      mnemonic. We don't care how the CPU loads the values from memory since
      the tests only performs register comparisons, so using stdvd2x/lxvd2x
      does not impact the test.
      Signed-off-by: NCyril Bur <cyrilbur@gmail.com>
      Acked-by: Balbir Singh<bsingharora@gmail.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      605df8d6
  7. 08 3月, 2017 13 次提交
  8. 03 3月, 2017 1 次提交
    • S
      selftest/powerpc: Fix false failures for skipped tests · a6d8a215
      Sachin Sant 提交于
      Tests under alignment subdirectory are skipped when executed on previous
      generation hardware, but harness still marks them as failed.
      
        test: test_copy_unaligned
        tags: git_version:unknown
        [SKIP] Test skipped on line 26
        skip: test_copy_unaligned
        selftests: copy_unaligned [FAIL]
      
      The MAGIC_SKIP_RETURN_VALUE value assigned to rc variable is retained till
      the program exit which causes the test to be marked as failed.
      
      This patch resets the value before returning to the main() routine.
      With this patch the test o/p is as follows:
      
        test: test_copy_unaligned
        tags: git_version:unknown
        [SKIP] Test skipped on line 26
        skip: test_copy_unaligned
        selftests: copy_unaligned [PASS]
      Signed-off-by: NSachin Sant <sachinp@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      a6d8a215
  9. 02 3月, 2017 2 次提交
    • S
      selftests: lib.mk Fix individual test builds · e53aff45
      Shuah Khan 提交于
      In commit a8ba798b ("selftests: enable O and KBUILD_OUTPUT"), added
      support to generate compile targets in a user specified directory. OUTPUT
      variable controls the location which is undefined when tests are built in
      the test directory or with "make -C tools/testing/selftests/x86".
      
      make -C tools/testing/selftests/x86/
      make: Entering directory '/lkml/linux_4.11/tools/testing/selftests/x86'
      Makefile:44: warning: overriding recipe for target 'clean'
      ../lib.mk:51: warning: ignoring old recipe for target 'clean'
      gcc -m64 -o /single_step_syscall_64 -O2 -g -std=gnu99 -pthread -Wall  single_step_syscall.c -lrt -ldl
      /usr/bin/ld: cannot open output file /single_step_syscall_64: Permission denied
      collect2: error: ld returned 1 exit status
      Makefile:50: recipe for target '/single_step_syscall_64' failed
      make: *** [/single_step_syscall_64] Error 1
      make: Leaving directory '/lkml/linux_4.11/tools/testing/selftests/x86'
      
      Same failure with "cd tools/testing/selftests/x86/;make" run.
      
      Fix this with a change to lib.mk to define OUTPUT to be the pwd when
      MAKELEVEL is 0. This covers both cases mentioned above.
      Reported-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      e53aff45
    • A
      selftests/x86: Add a basic selftest for ioperm · 0eb1d0fa
      Andy Lutomirski 提交于
      This doesn't fully exercise the interaction between KVM and ioperm(),
      but it does test basic functionality.
      Signed-off-by: NAndy Lutomirski <luto@kernel.org>
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      0eb1d0fa
  10. 01 3月, 2017 2 次提交
  11. 28 2月, 2017 1 次提交
  12. 25 2月, 2017 2 次提交
  13. 23 2月, 2017 7 次提交
  14. 19 2月, 2017 1 次提交
  15. 16 2月, 2017 1 次提交
  16. 14 2月, 2017 1 次提交