02 Oct, 2017

1 commit

  • Pull perf fixes from Thomas Gleixner:

    - Prevent a division by zero in the perf aux buffer handling

    - Sync kernel headers with perf tool headers

    - Fix a build failure in the syscalltbl code

    - Make the debug messages of perf report --call-graph work correctly

    - Make sure that all required perf files are in the MANIFEST for
    container builds

    - Fix the atrr.exclude kernel handling so it respects the
    perf_event_paranoid and the user permissions

    - Make perf test on s390x work correctly

    * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    perf/aux: Only update ->aux_wakeup in non-overwrite mode
    perf test: Fix vmlinux failure on s390x part 2
    perf test: Fix vmlinux failure on s390x
    perf tools: Fix syscalltbl build failure
    perf report: Fix debug messages with --call-graph option
    perf evsel: Fix attr.exclude_kernel setting for default cycles:p
    tools include: Sync kernel ABI headers with tooling headers
    perf tools: Get all of tools/{arch,include}/ in the MANIFEST

    Linus Torvalds
     

30 Sep, 2017

1 commit

  • …linux/kernel/git/acme/linux into perf/urgent

    Pull perf/urgent fixes from Arnaldo Carvalho de Melo:

    - Fix syscalltbl build failure (Akemi Yagi)

    - Fix attr.exclude_kernel setting for default cycles:p, this time for
    !root with kernel.perf_event_paranoid = -1 (Arnaldo Carvalho de Melo)

    - Sync kernel ABI headers with tooling headers (Ingo Molnar)

    - Remove misleading debug messages with --call-graph option (Mengting Zhang)

    - Revert vmlinux symbol resolution patches for s390x (Thomas Richter)

    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

    Ingo Molnar
     

29 Sep, 2017

2 commits

  • On s390x perf test 1 failed. It turned out that commit cf6383f73cf2
    ("perf report: Fix kernel symbol adjustment for s390x") was incorrect.

    The previous implementation in dso__load_sym() is also suitable for
    s390x.

    Therefore this patch undoes commit cf6383f73cf2

    Signed-off-by: Thomas-Mich Richter
    Cc: Zvonko Kosic
    Cc: Hendrik Brueckner
    Fixes: cf6383f73cf2 ("perf report: Fix kernel symbol adjustment for s390x")
    LPU-Reference: 20170915071404.58398-2-tmricht@linux.vnet.ibm.com
    Link: http://lkml.kernel.org/n/tip-v101o8k25vuja2ogosgf15yy@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Thomas Richter
     
  • On s390x perf test 1 failed. It turned out that commit 4a084ecfc821
    ("perf report: Fix module symbol adjustment for s390x") was incorrect.
    The previous implementation in dso__load_sym() is also suitable for
    s390x.

    Therefore this patch undoes commit 4a084ecfc821.

    Signed-off-by: Thomas-Mich Richter
    Cc: Hendrik Brueckner
    Cc: Zvonko Kosic
    Fixes: 4a084ecfc821 ("perf report: Fix module symbol adjustment for s390x")
    LPU-Reference: 20170915071404.58398-1-tmricht@linux.vnet.ibm.com
    Link: http://lkml.kernel.org/n/tip-5ani7ly57zji7s0hmzkx416l@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Thomas Richter
     

28 Sep, 2017

2 commits

  • Arnd Bergmann reported a bunch of warnings like:

    crypto/jitterentropy.o: warning: objtool: jent_fold_time()+0x3b: call without frame pointer save/setup
    crypto/jitterentropy.o: warning: objtool: jent_stuck()+0x1d: call without frame pointer save/setup
    crypto/jitterentropy.o: warning: objtool: jent_unbiased_bit()+0x15: call without frame pointer save/setup
    crypto/jitterentropy.o: warning: objtool: jent_read_entropy()+0x32: call without frame pointer save/setup
    crypto/jitterentropy.o: warning: objtool: jent_entropy_collector_free()+0x19: call without frame pointer save/setup

    and

    arch/x86/events/core.o: warning: objtool: collect_events uses BP as a scratch register
    arch/x86/events/core.o: warning: objtool: events_ht_sysfs_show()+0x22: call without frame pointer save/setup

    With certain rare configurations, GCC sometimes sets up the frame
    pointer with:

    lea (%rsp),%rbp

    instead of:

    mov %rsp,%rbp

    The instructions are equivalent, so treat the former like the latter.

    Reported-by: Arnd Bergmann
    Signed-off-by: Josh Poimboeuf
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/a468af8b28a69b83fffc6d7668be9b6fcc873699.1506526584.git.jpoimboe@redhat.com
    Signed-off-by: Ingo Molnar

    Josh Poimboeuf
     
  • …/kernel/git/shuah/linux-kselftest

    Pull kselftest fixes from Shuah Khan:
    "This update consists of:

    - fixes to several existing tests

    - a test for regression introduced by b9470c27607b ("inet: kill
    smallest_size and smallest_port")

    - seccomp support for glibc 2.26 siginfo_t.h

    - fixes to kselftest framework and tests to run make O=dir use-case

    - fixes to silence unnecessary test output to de-clutter test results"

    * tag 'linux-kselftest-4.14-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest: (28 commits)
    selftests: timers: set-timer-lat: Fix hang when testing unsupported alarms
    selftests: timers: set-timer-lat: fix hang when std out/err are redirected
    selftests/memfd: correct run_tests.sh permission
    selftests/seccomp: Support glibc 2.26 siginfo_t.h
    selftests: futex: Makefile: fix for loops in targets to run silently
    selftests: Makefile: fix for loops in targets to run silently
    selftests: mqueue: Use full path to run tests from Makefile
    selftests: futex: copy sub-dir test scripts for make O=dir run
    selftests: lib.mk: copy test scripts and test files for make O=dir run
    selftests: sync: kselftest and kselftest-clean fail for make O=dir case
    selftests: sync: use TEST_CUSTOM_PROGS instead of TEST_PROGS
    selftests: lib.mk: add TEST_CUSTOM_PROGS to allow custom test run/install
    selftests: watchdog: fix to use TEST_GEN_PROGS and remove clean
    selftests: lib.mk: fix test executable status check to use full path
    selftests: Makefile: clear LDFLAGS for make O=dir use-case
    selftests: lib.mk: kselftest and kselftest-clean fail for make O=dir case
    Makefile: kselftest and kselftest-clean fail for make O=dir case
    selftests/net: msg_zerocopy enable build with older kernel headers
    selftests: actually run the various net selftests
    selftest: add a reuseaddr test
    ...

    Linus Torvalds
     

26 Sep, 2017

8 commits

  • When timer_create() fails on a bootime or realtime clock, setup_timer()
    returns 0 as if timer has been set. Callers wait forever for the timer
    to expire.

    This hang is seen on a system that doesn't have support for:

    CLOCK_REALTIME_ALARM ABSTIME missing CAP_WAKE_ALARM? : [UNSUPPORTED]

    Test hangs waiting for a timer that hasn't been set to expire. Fix
    setup_timer() to return 1, add handling in callers to detect the
    unsupported case and return 0 without waiting to not fail the test.

    Signed-off-by: Shuah Khan

    Shuah Khan
     
  • do_timer_oneshot() uses select() as a timer with FD_SETSIZE and readfs
    is cleared with FD_ZERO without FD_SET.

    When stdout and stderr are redirected, the test hangs in select forever.
    Fix the problem calling select() with readfds empty and nfds zero. This
    is sufficient for using select() for timer.

    With this fix "./set-timer-lat > /dev/null 2>&1" no longer hangs.

    Signed-off-by: Shuah Khan
    Acked-by: Greg Hackmann
    Signed-off-by: Shuah Khan

    Shuah Khan
     
  • to fix the following issue:
    ------------------
    TAP version 13
    selftests: run_tests.sh
    ========================================
    selftests: Warning: file run_tests.sh is not executable, correct this.
    not ok 1..1 selftests: run_tests.sh [FAIL]
    ------------------

    Signed-off-by: Li Zhijian
    Signed-off-by: Shuah Khan

    Li Zhijian
     
  • The 2.26 release of glibc changed how siginfo_t is defined, and the earlier
    work-around to using the kernel definition are no longer needed. The old
    way needs to stay around for a while, though.

    Reported-by: Seth Forshee
    Cc: Andy Lutomirski
    Cc: Will Drewry
    Cc: Shuah Khan
    Cc: linux-kselftest@vger.kernel.org
    Cc: stable@vger.kernel.org
    Signed-off-by: Kees Cook
    Tested-by: Seth Forshee
    Signed-off-by: Shuah Khan

    Kees Cook
     
  • Fix for loops in targets to run silently to avoid cluttering the test
    results.

    Suppresses the following from targets:

    for DIR in functional; do \
    BUILD_TARGET=./tools/testing/selftests/futex/$DIR; \
    mkdir $BUILD_TARGET -p; \
    make OUTPUT=$BUILD_TARGET -C $DIR all;\
    done

    ./tools/testing/selftests/futex/run.sh

    Signed-off-by: Shuah Khan
    Reviewed-by: Darren Hart (VMware)
    Signed-off-by: Shuah Khan

    Shuah Khan
     
  • Fix for loops in targets to run silently to avoid cluttering the test
    results.

    Suppresses the following from targets: e.g run from breakpoints

    for TARGET in breakpoints; do \
    BUILD_TARGET=$BUILD/$TARGET; \
    mkdir $BUILD_TARGET -p; \
    make OUTPUT=$BUILD_TARGET -C $TARGET;\
    done;

    Signed-off-by: Shuah Khan

    Shuah Khan
     
  • Use full path including $(OUTPUT) to run tests from Makefile for
    normal case when objects reside in the source tree as well as when
    objects are relocated with make O=dir. In both cases $(OUTPUT) will
    be set correctly by lib.mk.

    Signed-off-by: Shuah Khan

    Shuah Khan
     
  • For make O=dir run_tests to work, test scripts from sub-directories
    need to be copied over to the object directory. Running tests from the
    object directory is necessary to avoid making the source tree dirty.

    Signed-off-by: Shuah Khan
    Reviewed-by: Darren Hart (VMware)
    Signed-off-by: Shuah Khan

    Shuah Khan
     

25 Sep, 2017

6 commits

  • The build of kernel v4.14-rc1 for i686 fails on RHEL 6 with the error
    in tools/perf:

    util/syscalltbl.c:157: error: expected ';', ',' or ')' before '__maybe_unused'
    mv: cannot stat `util/.syscalltbl.o.tmp': No such file or directory

    Fix it by placing/moving:

    #include

    outside of #ifdef HAVE_SYSCALL_TABLE block.

    Signed-off-by: Akemi Yagi
    Cc: Alan Bartlett
    Link: http://lkml.kernel.org/r/oq41r8$1v9$1@blaine.gmane.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Akemi Yagi
     
  • With --call-graph option, perf report can display call chains using
    type, min percent threshold, optional print limit and order. And the
    default call-graph parameter is 'graph,0.5,caller,function,percent'.

    Before this patch, 'perf report --call-graph' shows incorrect debug
    messages as below:

    # perf report --call-graph
    Invalid callchain mode: 0.5
    Invalid callchain order: 0.5
    Invalid callchain sort key: 0.5
    Invalid callchain config key: 0.5
    Invalid callchain mode: caller
    Invalid callchain mode: function
    Invalid callchain order: function
    Invalid callchain mode: percent
    Invalid callchain order: percent
    Invalid callchain sort key: percent

    That is because in function __parse_callchain_report_opt(),each field of
    the call-graph parameter is passed to parse_callchain_{mode,order,
    sort_key,value} in turn until it meets the matching value.

    For example, the order field "caller" is passed to
    parse_callchain_mode() firstly and obviously it doesn't match any mode
    field. Therefore parse_callchain_mode() will shows the debug message
    "Invalid callchain mode: caller", which could confuse users.

    The patch fixes this issue by moving the warning out of the function
    parse_callchain_{mode,order,sort_key,value}.

    Signed-off-by: Mengting Zhang
    Acked-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Alexander Shishkin
    Cc: Andi Kleen
    Cc: Krister Johansen
    Cc: Li Bin
    Cc: Milian Wolff
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Wang Nan
    Cc: Yao Jin
    Link: http://lkml.kernel.org/r/1506154694-39691-1-git-send-email-zhangmengting@huawei.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Mengting Zhang
     
  • Yet another fix for probing the max attr.precise_ip setting: it is not
    enough settting attr.exclude_kernel for !root users, as they _can_
    profile the kernel if the kernel.perf_event_paranoid sysctl is set to
    -1, so check that as well.

    Testing it:

    As non root:

    $ sysctl kernel.perf_event_paranoid
    kernel.perf_event_paranoid = 2
    $ perf record sleep 1
    $ perf evlist -v
    cycles:uppp: ..., exclude_kernel: 1, ... precise_ip: 3, ...

    Now as non-root, but with kernel.perf_event_paranoid set set to the
    most permissive value, -1:

    $ sysctl kernel.perf_event_paranoid
    kernel.perf_event_paranoid = -1
    $ perf record sleep 1
    $ perf evlist -v
    cycles:ppp: ..., exclude_kernel: 0, ... precise_ip: 3, ...
    $

    I.e. non-root, default kernel.perf_event_paranoid: :uppp modifier = not allowed to sample the kernel,
    non-root, most permissible kernel.perf_event_paranoid: :ppp = allowed to sample the kernel.

    In both cases, use the highest available precision: attr.precise_ip = 3.

    Reported-and-Tested-by: Ingo Molnar
    Cc: Adrian Hunter
    Cc: Andy Lutomirski
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Fixes: d37a36979077 ("perf evsel: Fix attr.exclude_kernel setting for default cycles:p")
    Link: http://lkml.kernel.org/n/tip-nj2qkf75xsd6pw6hhjzfqqdx@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Time for a sync with ABI/uapi headers with the upcoming v4.14 kernel.

    None of the ABI changes require any source code level changes to our
    existing in-kernel tooling code:

    - tools/arch/s390/include/uapi/asm/kvm.h:

    New KVM_S390_VM_TOD_EXT ABI, not used by in-kernel tooling.

    - tools/arch/x86/include/asm/cpufeatures.h:
    tools/arch/x86/include/asm/disabled-features.h:

    New PCID, SME and VGIF x86 CPU feature bits defined.

    - tools/include/asm-generic/hugetlb_encode.h:
    tools/include/uapi/asm-generic/mman-common.h:
    tools/include/uapi/linux/mman.h:

    Two new madvise() flags, plus a hugetlb system call mmap flags
    restructuring/extension changes.

    - tools/include/uapi/drm/drm.h:
    tools/include/uapi/drm/i915_drm.h:

    New drm_syncobj_create flags definitions, new drm_syncobj_wait
    and drm_syncobj_array ABIs. DRM_I915_PERF_* calls and a new
    I915_PARAM_HAS_EXEC_FENCE_ARRAY ABI for the Intel driver.

    - tools/include/uapi/linux/bpf.h:

    New bpf_sock fields (::mark and ::priority), new XDP_REDIRECT
    action, new kvm_ppc_smmu_info fields (::data_keys, instr_keys)

    Signed-off-by: Ingo Molnar
    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Milian Wolff
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Taeung Song
    Cc: Wang Nan
    Cc: Yao Jin
    Link: http://lkml.kernel.org/r/20170913073823.lxmi4c7ejqlfabjx@gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo

    Ingo Molnar
     
  • Now that I'm switching the container builds from using a local volume
    pointing to the kernel repository with the perf sources, instead getting
    a detached tarball to be able to use a container cluster, some places
    broke because I forgot to put some of the required files in
    tools/perf/MANIFEST, namely some bitsperlong.h files.

    So, to fix it do the same as for tools/build/ and pack the whole
    tools/arch/ directory.

    Cc: Adrian Hunter
    Cc: David Ahern
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-wmenpjfjsobwdnfde30qqncj@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Pull x86 fixes from Ingo Molnar:
    "Another round of CR3/PCID related fixes (I think this addresses all
    but one of the known problems with PCID support), an objtool fix plus
    a Clang fix that (finally) solves all Clang quirks to build a bootable
    x86 kernel as-is"

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/asm: Fix inline asm call constraints for Clang
    objtool: Handle another GCC stack pointer adjustment bug
    x86/mm/32: Load a sane CR3 before cpu_init() on secondary CPUs
    x86/mm/32: Move setup_clear_cpu_cap(X86_FEATURE_PCID) earlier
    x86/mm/64: Stop using CR3.PCID == 0 in ASID-aware code
    x86/mm: Factor out CR3-building code

    Linus Torvalds
     

23 Sep, 2017

3 commits

  • For inline asm statements which have a CALL instruction, we list the
    stack pointer as a constraint to convince GCC to ensure the frame
    pointer is set up first:

    static inline void foo()
    {
    register void *__sp asm(_ASM_SP);
    asm("call bar" : "+r" (__sp))
    }

    Unfortunately, that pattern causes Clang to corrupt the stack pointer.

    The fix is easy: convert the stack pointer register variable to a global
    variable.

    It should be noted that the end result is different based on the GCC
    version. With GCC 6.4, this patch has exactly the same result as
    before:

    defconfig defconfig-nofp distro distro-nofp
    before 9820389 9491555 8816046 8516940
    after 9820389 9491555 8816046 8516940

    With GCC 7.2, however, GCC's behavior has changed. It now changes its
    behavior based on the conversion of the register variable to a global.
    That somehow convinces it to *always* set up the frame pointer before
    inserting *any* inline asm. (Therefore, listing the variable as an
    output constraint is a no-op and is no longer necessary.) It's a bit
    overkill, but the performance impact should be negligible. And in fact,
    there's a nice improvement with frame pointers disabled:

    defconfig defconfig-nofp distro distro-nofp
    before 9796316 9468236 9076191 8790305
    after 9796957 9464267 9076381 8785949

    So in summary, while listing the stack pointer as an output constraint
    is no longer necessary for newer versions of GCC, it's still needed for
    older versions.

    Suggested-by: Andrey Ryabinin
    Reported-by: Matthias Kaehlcke
    Signed-off-by: Josh Poimboeuf
    Cc: Alexander Potapenko
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Dmitriy Vyukov
    Cc: Linus Torvalds
    Cc: Miguel Bernal Marin
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Link: http://lkml.kernel.org/r/3db862e970c432ae823cf515c52b54fec8270e0e.1505942196.git.jpoimboe@redhat.com
    Signed-off-by: Ingo Molnar

    Josh Poimboeuf
     
  • The kbuild bot reported the following warning with GCC 4.4 and a
    randconfig:

    net/socket.o: warning: objtool: compat_sock_ioctl()+0x1083: stack state mismatch: cfa1=7+160 cfa2=-1+0

    This is caused by another GCC non-optimization, where it backs up and
    restores the stack pointer for no apparent reason:

    2f91: 48 89 e0 mov %rsp,%rax
    2f94: 4c 89 e7 mov %r12,%rdi
    2f97: 4c 89 f6 mov %r14,%rsi
    2f9a: ba 20 00 00 00 mov $0x20,%edx
    2f9f: 48 89 c4 mov %rax,%rsp

    This issue would have been happily ignored before the following commit:

    dd88a0a0c861 ("objtool: Handle GCC stack pointer adjustment bug")

    But now that objtool is paying attention to such stack pointer writes
    to/from a register, it needs to understand them properly. In this case
    that means recognizing that the "mov %rsp, %rax" instruction is
    potentially a backup of the stack pointer.

    Reported-by: kbuild test robot
    Signed-off-by: Josh Poimboeuf
    Cc: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Dmitriy Vyukov
    Cc: Linus Torvalds
    Cc: Matthias Kaehlcke
    Cc: Miguel Bernal Marin
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Fixes: dd88a0a0c861 ("objtool: Handle GCC stack pointer adjustment bug")
    Link: http://lkml.kernel.org/r/8c7aa8e9a36fbbb6655d9d8e7cea58958c912da8.1505942196.git.jpoimboe@redhat.com
    Signed-off-by: Ingo Molnar

    Josh Poimboeuf
     
  • Pull seccomp updates from Kees Cook:
    "Major additions:

    - sysctl and seccomp operation to discover available actions
    (tyhicks)

    - new per-filter configurable logging infrastructure and sysctl
    (tyhicks)

    - SECCOMP_RET_LOG to log allowed syscalls (tyhicks)

    - SECCOMP_RET_KILL_PROCESS as the new strictest possible action

    - self-tests for new behaviors"

    [ This is the seccomp part of the security pull request during the merge
    window that was nixed due to unrelated problems - Linus ]

    * tag 'seccomp-v4.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
    samples: Unrename SECCOMP_RET_KILL
    selftests/seccomp: Test thread vs process killing
    seccomp: Implement SECCOMP_RET_KILL_PROCESS action
    seccomp: Introduce SECCOMP_RET_KILL_PROCESS
    seccomp: Rename SECCOMP_RET_KILL to SECCOMP_RET_KILL_THREAD
    seccomp: Action to log before allowing
    seccomp: Filter flag to log all actions except SECCOMP_RET_ALLOW
    seccomp: Selftest for detection of filter flag support
    seccomp: Sysctl to configure actions that are allowed to be logged
    seccomp: Operation for checking if an action is available
    seccomp: Sysctl to display available actions
    seccomp: Provide matching filter for introspection
    selftests/seccomp: Refactor RET_ERRNO tests
    selftests/seccomp: Add simple seccomp overhead benchmark
    selftests/seccomp: Add tests for basic ptrace actions

    Linus Torvalds
     

22 Sep, 2017

1 commit

  • Pull libnvdimm fixes from Dan Williams:
    "A crash fix and corresponding regression test enabling for the crash
    scenario. The unit test for this crash is available in ndctl-v58.2.

    This branch has received a build success notification from the
    0day-kbuild robot over 148 configs. The fix is tagged for -stable /
    backport to 4.13"

    * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
    libnvdimm, namespace: fix btt claim class crash
    tools/testing/nvdimm: disable labels for nfit_test.1

    Linus Torvalds
     

21 Sep, 2017

8 commits


20 Sep, 2017

4 commits


19 Sep, 2017

4 commits