1. 25 2月, 2017 2 次提交
  2. 23 2月, 2017 7 次提交
  3. 16 2月, 2017 1 次提交
  4. 14 2月, 2017 5 次提交
    • M
      selftests/powerpc: Fix remaining fallout from recent changes · 68bd42d9
      Michael Ellerman 提交于
      In benchmarks we need to use $(TEST_GEN_PROGS) after we include lib.mk,
      because lib.mk does the substitution to add $(OUTPUT).
      
      In math the vmx and fpu names were typoed so they no longer matched
      correctly, put back the 'v' and 'f'.
      
      In tm we need to substitute $(OUTPUT) into SIGNAL_CONTEXT_CHK_TESTS so
      that the rule matches.
      
      In pmu there is an extraneous ':' on the end of $$BUILD_TARGET for the
      clean and install rules, which breaks the logic in the child Makefiles.
      
      Fixes: a8ba798b ("selftests: enable O and KBUILD_OUTPUT")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      68bd42d9
    • M
      selftests/powerpc: Fix the clean rule since recent changes · 2e8ec87d
      Michael Ellerman 提交于
      The clean rule is broken for the powerpc tests:
      
        make[1]: Entering directory 'tools/testing/selftests/powerpc'
        Makefile:63: warning: overriding recipe for target 'clean'
        ../lib.mk:51: warning: ignoring old recipe for target 'clean'
        /bin/sh: 3: Syntax error: end of file unexpected (expecting "done")
        Makefile:63: recipe for target 'clean' failed
      
      Fixes: a8ba798b ("selftests: enable O and KBUILD_OUTPUT")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      2e8ec87d
    • M
      selftests: Fix the .S and .S -> .o rules · 634ce97c
      Michael Ellerman 提交于
      Both these rules incorrectly use $< (first prerequisite) rather than
      $^ (all prerequisites), meaning they don't work if we're using more than
      one .S file as input. Switch them to using $^.
      
      They also don't include $(CPPFLAGS) and other variables used in the
      default rules, which breaks targets that require those. Fix that by
      using the builtin $(COMPILE.S) and $(LINK.S) rules.
      
      Fixes: a8ba798b ("selftests: enable O and KBUILD_OUTPUT")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Tested by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      634ce97c
    • M
      selftests: Fix the .c linking rule · 2047f1d8
      Michael Ellerman 提交于
      Currently we can't build some tests, for example:
      
        $ make -C tools/testing/selftests/ TARGETS=vm
        ...
        gcc -Wall -I ../../../../usr/include   -lrt -lpthread ../../../../usr/include/linux/kernel.h userfaultfd.c -o tools/testing/selftests/vm/userfaultfd
        /tmp/ccmOkQSM.o: In function `stress':
        userfaultfd.c:(.text+0xc60): undefined reference to `pthread_create'
        userfaultfd.c:(.text+0xca5): undefined reference to `pthread_create'
        userfaultfd.c:(.text+0xcee): undefined reference to `pthread_create'
        userfaultfd.c:(.text+0xd30): undefined reference to `pthread_create'
        userfaultfd.c:(.text+0xd77): undefined reference to `pthread_join'
        userfaultfd.c:(.text+0xe7d): undefined reference to `pthread_join'
        userfaultfd.c:(.text+0xe9f): undefined reference to `pthread_cancel'
        userfaultfd.c:(.text+0xec6): undefined reference to `pthread_join'
        userfaultfd.c:(.text+0xf14): undefined reference to `pthread_join'
        /tmp/ccmOkQSM.o: In function `userfaultfd_stress':
        userfaultfd.c:(.text+0x13e2): undefined reference to `pthread_attr_setstacksize'
        collect2: error: ld returned 1 exit status
      
      This is because the rule for linking .c files to binaries is incorrect.
      
      The first bug is that it uses $< (first prerequisite) instead of $^ (all
      preqrequisites), fix it by using ^$.
      
      Secondly the ordering of the prerequisites vs $(LDLIBS) is wrong,
      meaning on toolchains that use --as-needed we fail to link (as above).
      Fix that by placing $(LDLIBS) *after* ^$.
      
      Finally switch to using the default rule $(LINK.c), so that we get
      $(CPPFLAGS) etc. included.
      
      Fixes: a8ba798b ("selftests: enable O and KBUILD_OUTPUT")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Tested by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      2047f1d8
    • M
      selftests: Fix selftests build to just build, not run tests · d83c3ba0
      Michael Ellerman 提交于
      In commit 88baa78d ("selftests: remove duplicated all and clean
      target"), the "all" target was removed from individual Makefiles and
      added to lib.mk.
      
      However the "all" target was added to lib.mk *after* the existing
      "runtests" target. This means "runtests" becomes the first (default)
      target for most of our Makefiles.
      
      This has the effect of causing a plain "make" to build *and run* the
      tests. Which is at best rude, but depending on which tests are run could
      oops someone's build machine.
      
        $ make -C tools/testing/selftests/
        ...
        make[1]: Entering directory 'tools/testing/selftests/bpf'
        gcc -Wall -O2 -I../../../../usr/include   test_verifier.c -o tools/testing/selftests/bpf/test_verifier
        gcc -Wall -O2 -I../../../../usr/include   test_maps.c -o tools/testing/selftests/bpf/test_maps
        gcc -Wall -O2 -I../../../../usr/include   test_lru_map.c -o tools/testing/selftests/bpf/test_lru_map
        #0 add+sub+mul FAIL
        Failed to load prog 'Function not implemented'!
        #1 unreachable FAIL
        Unexpected error message!
        #2 unreachable2 FAIL
        ...
      
      Fix it by moving the "all" target to the start of lib.mk, making it the
      default target.
      
      Fixes: 88baa78d ("selftests: remove duplicated all and clean target")
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Tested by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
      Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
      d83c3ba0
  5. 11 2月, 2017 10 次提交
  6. 09 2月, 2017 2 次提交
  7. 07 2月, 2017 2 次提交
  8. 02 2月, 2017 1 次提交
  9. 26 1月, 2017 2 次提交
  10. 25 1月, 2017 6 次提交
    • L
      test_firmware: add test custom fallback trigger · 061132d2
      Luis R. Rodriguez 提交于
      We have no custom fallback mechanism test interface. Provide one.
      This tests both the custom fallback mechanism and cancelling the
      it.
      Signed-off-by: NLuis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      061132d2
    • L
      tools: firmware: add fallback cancelation testing · eb67bc3f
      Luis R. Rodriguez 提交于
      Add a test case for cancelling the sync fallback mechanism.
      Signed-off-by: NLuis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eb67bc3f
    • L
      tools: firmware: rename fallback mechanism script · 823b0221
      Luis R. Rodriguez 提交于
      Calling it user mode helper only creates confusion.
      Signed-off-by: NLuis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      823b0221
    • L
      tools: firmware: check for distro fallback udev cancel rule · afb999cd
      Luis R. Rodriguez 提交于
      Some distributions (Debian, OpenSUSE) have a udev rule in place to cancel
      all fallback mechanism uevents immediately. This would obviously
      make it hard to test against the fallback mechanism test interface,
      so we need to check for this.
      Signed-off-by: NLuis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      afb999cd
    • D
      bpf: enable verifier to better track const alu ops · 3fadc801
      Daniel Borkmann 提交于
      William reported couple of issues in relation to direct packet
      access. Typical scheme is to check for data + [off] <= data_end,
      where [off] can be either immediate or coming from a tracked
      register that contains an immediate, depending on the branch, we
      can then access the data. However, in case of calculating [off]
      for either the mentioned test itself or for access after the test
      in a more "complex" way, then the verifier will stop tracking the
      CONST_IMM marked register and will mark it as UNKNOWN_VALUE one.
      
      Adding that UNKNOWN_VALUE typed register to a pkt() marked
      register, the verifier then bails out in check_packet_ptr_add()
      as it finds the registers imm value below 48. In the first below
      example, that is due to evaluate_reg_imm_alu() not handling right
      shifts and thus marking the register as UNKNOWN_VALUE via helper
      __mark_reg_unknown_value() that resets imm to 0.
      
      In the second case the same happens at the time when r4 is set
      to r4 &= r5, where it transitions to UNKNOWN_VALUE from
      evaluate_reg_imm_alu(). Later on r4 we shift right by 3 inside
      evaluate_reg_alu(), where the register's imm turns into 3. That
      is, for registers with type UNKNOWN_VALUE, imm of 0 means that
      we don't know what value the register has, and for imm > 0 it
      means that the value has [imm] upper zero bits. F.e. when shifting
      an UNKNOWN_VALUE register by 3 to the right, no matter what value
      it had, we know that the 3 upper most bits must be zero now.
      This is to make sure that ALU operations with unknown registers
      don't overflow. Meaning, once we know that we have more than 48
      upper zero bits, or, in other words cannot go beyond 0xffff offset
      with ALU ops, such an addition will track the target register
      as a new pkt() register with a new id, but 0 offset and 0 range,
      so for that a new data/data_end test will be required. Is the source
      register a CONST_IMM one that is to be added to the pkt() register,
      or the source instruction is an add instruction with immediate
      value, then it will get added if it stays within max 0xffff bounds.
      >From there, pkt() type, can be accessed should reg->off + imm be
      within the access range of pkt().
      
        [...]
        from 28 to 30: R0=imm1,min_value=1,max_value=1
          R1=pkt(id=0,off=0,r=22) R2=pkt_end
          R3=imm144,min_value=144,max_value=144
          R4=imm0,min_value=0,max_value=0
          R5=inv48,min_value=2054,max_value=2054 R10=fp
        30: (bf) r5 = r3
        31: (07) r5 += 23
        32: (77) r5 >>= 3
        33: (bf) r6 = r1
        34: (0f) r6 += r5
        cannot add integer value with 0 upper zero bits to ptr_to_packet
      
        [...]
        from 52 to 80: R0=imm1,min_value=1,max_value=1
          R1=pkt(id=0,off=0,r=34) R2=pkt_end R3=inv
          R4=imm272 R5=inv56,min_value=17,max_value=17
          R6=pkt(id=0,off=26,r=34) R10=fp
        80: (07) r4 += 71
        81: (18) r5 = 0xfffffff8
        83: (5f) r4 &= r5
        84: (77) r4 >>= 3
        85: (0f) r1 += r4
        cannot add integer value with 3 upper zero bits to ptr_to_packet
      
      Thus to get above use-cases working, evaluate_reg_imm_alu() has
      been extended for further ALU ops. This is fine, because we only
      operate strictly within realm of CONST_IMM types, so here we don't
      care about overflows as they will happen in the simulated but also
      real execution and interaction with pkt() in check_packet_ptr_add()
      will check actual imm value once added to pkt(), but it's irrelevant
      before.
      
      With regards to 06c1c049 ("bpf: allow helpers access to variable
      memory") that works on UNKNOWN_VALUE registers, the verifier becomes
      now a bit smarter as it can better resolve ALU ops, so we need to
      adapt two test cases there, as min/max bound tracking only becomes
      necessary when registers were spilled to stack. So while mask was
      set before to track upper bound for UNKNOWN_VALUE case, it's now
      resolved directly as CONST_IMM, and such contructs are only necessary
      when f.e. registers are spilled.
      
      For commit 6b173873 ("bpf: recognize 64bit immediate loads as
      consts") that initially enabled dw load tracking only for nfp jit/
      analyzer, I did couple of tests on large, complex programs and we
      don't increase complexity badly (my tests were in ~3% range on avg).
      I've added a couple of tests similar to affected code above, and
      it works fine with verifier now.
      Reported-by: NWilliam Tu <u9012063@gmail.com>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Cc: Gianluca Borello <g.borello@gmail.com>
      Cc: William Tu <u9012063@gmail.com>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3fadc801
    • D
      bpf: add prog tag test case to bpf selftests · 62b64660
      Daniel Borkmann 提交于
      Add the test case used to compare the results from fdinfo with
      af_alg's output on the tag. Tests are from min to max sized
      programs, with and without maps included.
      
        # ./test_tag
        test_tag: OK (40945 tests)
      
      Tested on x86_64 and s390x.
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NAlexei Starovoitov <ast@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      62b64660
  11. 24 1月, 2017 1 次提交
  12. 20 1月, 2017 1 次提交