1. 02 Oct, 2017 4 commits
    • Thomas Richter's avatar
      perf test attr: Fix ignored test case result · 22905582
      Thomas Richter authored
      Command perf test -v 16 (Setup struct perf_event_attr test) always
      reports success even if the test case fails.  It works correctly if you
      also specify -F (for don't fork).
      
         root@s35lp76 perf]# ./perf test -v 16
         15: Setup struct perf_event_attr               :
         --- start ---
         running './tests/attr/test-record-no-delay'
         [ perf record: Woken up 1 times to write data ]
         [ perf record: Captured and wrote 0.002 MB /tmp/tmp4E1h7R/perf.data
           (1 samples) ]
         expected task=0, got 1
         expected precise_ip=0, got 3
         expected wakeup_events=1, got 0
         FAILED './tests/attr/test-record-no-delay' - match failure
         test child finished with 0
         ---- end ----
         Setup struct perf_event_attr: Ok
      
      The reason for the wrong error reporting is the return value of the
      system() library call. It is called in run_dir() file tests/attr.c and
      returns the exit status, in above case 0xff00.
      
      This value is given as parameter to the exit() function which can only
      handle values 0-0xff.
      
      The child process terminates with exit value of 0 and the parent does
      not detect any error.
      
      This patch corrects the error reporting and prints the correct test
      result.
      Signed-off-by: default avatarThomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      LPU-Reference: 20170913081209.39570-2-tmricht@linux.vnet.ibm.com
      Link: http://lkml.kernel.org/n/tip-rdube6rfcjsr1nzue72c7lqn@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      22905582
    • Thomas Richter's avatar
      perf test attr: Fix python error on empty result · 3440fe27
      Thomas Richter authored
      Commit d78ada4a ("perf tests attr: Do not store failed events") does
      not create an event file in the /tmp directory when the
      perf_open_event() system call failed.
      
      This can lead to a situation where not /tmp/event-xx-yy-zz result file
      exists at all (for example on a s390x virtual machine environment) where
      no CPUMF hardware is available.
      
      The following command then fails with a python call back chain instead
      of printing failure:
      
        [root@s8360046 perf]# /usr/bin/python2 ./tests/attr.py -d ./tests/attr/ \
            -p ./perf -v -ttest-stat-basic
        running './tests/attr//test-stat-basic'
        Traceback (most recent call last):
          File "./tests/attr.py", line 379, in <module>
            main()
          File "./tests/attr.py", line 370, in main
            run_tests(options)
          File "./tests/attr.py", line 311, in run_tests
            Test(f, options).run()
          File "./tests/attr.py", line 300, in run
            self.compare(self.expect, self.result)
          File "./tests/attr.py", line 248, in compare
            exp_event.diff(res_event)
        UnboundLocalError: local variable 'res_event' referenced before assignment
        [root@s8360046 perf]#
      
      This patch catches this pitfall and prints an error message instead:
      
        [root@s8360047 perf]# /usr/bin/python2 ./tests/attr.py -d ./tests/attr/ \
             -p ./perf  -vvv -ttest-stat-basic
        running './tests/attr//test-stat-basic'
          loading expected events
            Event event:base-stat
              fd = 1
              group_fd = -1
              flags = 0|8
              [....]
              sample_regs_user = 0
              sample_stack_user = 0
          'PERF_TEST_ATTR=/tmp/tmpJbMQMP ./perf stat -o /tmp/tmpJbMQMP/perf.data -e cycles kill >/dev/null 2>&1' ret '1', expected '1'
          loading result events
          compare
            matching [event:base-stat]
            match: [event:base-stat] matches []
            res_event is empty
        FAILED './tests/attr//test-stat-basic' - match failure
        [root@s8360047 perf]#
      Signed-off-by: default avatarThomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      LPU-Reference: 20170913081209.39570-1-tmricht@linux.vnet.ibm.com
      Link: http://lkml.kernel.org/n/tip-04d63nn7svfgxdhi60gq2mlm@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      3440fe27
    • Jiri Olsa's avatar
      perf tests attr: Fix task term values · 10836d9f
      Jiri Olsa authored
      The perf_event_attr::task is 1 by default for first (tracking) event in
      the session. Setting task=1 as default and adding task=0 for cases that
      need it.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas-Mich Richter <tmricht@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/20170703145030.12903-16-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      10836d9f
    • Arnaldo Carvalho de Melo's avatar
  2. 29 Sep, 2017 5 commits
  3. 28 Sep, 2017 21 commits
  4. 27 Sep, 2017 10 commits
    • Tyler Baicar's avatar
      ACPI / APEI: clear error status before acknowledging the error · aaf2c2fb
      Tyler Baicar authored
      Currently we acknowledge errors before clearing the error status.
      This could cause a new error to be populated by firmware in-between
      the error acknowledgment and the error status clearing which would
      cause the second error's status to be cleared without being handled.
      So, clear the error status before acknowledging the errors.
      
      Also, make sure to acknowledge the error if the error status read
      fails.
      Signed-off-by: default avatarTyler Baicar <tbaicar@codeaurora.org>
      Reviewed-by: default avatarBorislav Petkov <bp@suse.de>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      aaf2c2fb
    • Linus Torvalds's avatar
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 9cd6681c
      Linus Torvalds authored
      Pull quota and isofs fixes from Jan Kara:
       "Two quota fixes (fallout of the quota locking changes) and an isofs
        build fix"
      
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        quota: Fix quota corruption with generic/232 test
        isofs: fix build regression
        quota: add missing lock into __dquot_transfer()
      9cd6681c
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-4.14-rc3-fixes' of... · 225d3b67
      Linus Torvalds authored
      Merge tag 'linux-kselftest-4.14-rc3-fixes' of git://git.kernel.org/pub/scm/linux/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 b9470c27 ("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
        ...
      225d3b67
    • Linus Torvalds's avatar
      Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7031b641
      Linus Torvalds authored
      Pull x86 fpu fixes and cleanups from Ingo Molnar:
       "This is _way_ more cleanups than fixes, but the bugs were subtle and
        hard to hit, and the primary reason for them existing was the
        unnecessary historical complexity of some of the x86/fpu interfaces.
      
        The first bunch of commits clean up and simplify the xstate user copy
        handling functions, in reaction to the collective head-scratching
        about the xstate user-copy handling code that leads up to the fix for
        this SkyLake xstate handling bug:
      
           0852b374: x86/fpu: Add FPU state copying quirk to handle XRSTOR failure on Intel Skylake CPUs
      
        The cleanups don't change any functionality, they just (hopefully)
        make it all clearer, more consistent, more debuggable and more robust.
      
        Note that most of the linecount increase comes from these commits,
        where we better split the user/kernel copy logic by having more
        variants, instead repeated fragile patterns of:
      
                     if (kbuf) {
                             memcpy(kbuf + pos, data, copy);
                     } else {
                             if (__copy_to_user(ubuf + pos, data, copy))
                                     return -EFAULT;
                     }
      
        The next bunch of commits simplify the FPU state-machine to get rid of
        old lazy-FPU idiosyncrasies - a defensive simplification to make all
        the code easier to review and fix. No change in functionality.
      
        Then there's a couple of additional debugging tweaks: static checker
        warning fix and move an FPU related warning to under WARN_ON_FPU(),
        followed by another bunch of commits that represent a finegrained
        split-up of the fixes from Eric Biggers to handle weird xstate bits
        properly.
      
        I did this finegrained split-up because some of these fixes also
        impact the ABI for weird xstate handling, for which we'd like to have
        good bisection results, should they cause any problems. (We also had
        one regression with the more monolithic fixes, so splitting it all up
        sounded prudent for robustness reasons as well.)
      
        About the whole series: the commits up to 03eaec81 have been in
        -next for months - but I've recently rebased them to remove a state
        machine clean-up commit that was objected to, and to make it more
        bisectable - so technically it's a new, rebased tree.
      
        Robustness history: this series had some regressions along the way,
        and all reported regressions have been fixed. All but one of the
        regressions manifested itself as easy to report warnings. The previous
        version of this latest series was also in linux-next, with one
        (warning-only) regression reported which is fixed in the latest
        version.
      
        Barring last minute brown paper bag bugs (and the commits are now
        older by a day which I'd hope helps paperbag reduction), I'm
        reasonably confident about its general robustness.
      
        Famous last words ..."
      
      * 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (42 commits)
        x86/fpu: Use using_compacted_format() instead of open coded X86_FEATURE_XSAVES
        x86/fpu: Use validate_xstate_header() to validate the xstate_header in copy_user_to_xstate()
        x86/fpu: Eliminate the 'xfeatures' local variable in copy_user_to_xstate()
        x86/fpu: Copy the full header in copy_user_to_xstate()
        x86/fpu: Use validate_xstate_header() to validate the xstate_header in copy_kernel_to_xstate()
        x86/fpu: Eliminate the 'xfeatures' local variable in copy_kernel_to_xstate()
        x86/fpu: Copy the full state_header in copy_kernel_to_xstate()
        x86/fpu: Use validate_xstate_header() to validate the xstate_header in __fpu__restore_sig()
        x86/fpu: Use validate_xstate_header() to validate the xstate_header in xstateregs_set()
        x86/fpu: Introduce validate_xstate_header()
        x86/fpu: Rename fpu__activate_fpstate_read/write() to fpu__prepare_[read|write]()
        x86/fpu: Rename fpu__activate_curr() to fpu__initialize()
        x86/fpu: Simplify and speed up fpu__copy()
        x86/fpu: Fix stale comments about lazy FPU logic
        x86/fpu: Rename fpu::fpstate_active to fpu::initialized
        x86/fpu: Remove fpu__current_fpstate_write_begin/end()
        x86/fpu: Fix fpu__activate_fpstate_read() and update comments
        x86/fpu: Reinitialize FPU registers if restoring FPU state fails
        x86/fpu: Don't let userspace set bogus xcomp_bv
        x86/fpu: Turn WARN_ON() in context switch into WARN_ON_FPU()
        ...
      7031b641
    • Harish Chegondi's avatar
      IB/hfi1: Unsuccessful PCIe caps tuning should not fail driver load · 828bcbdc
      Harish Chegondi authored
      Failure to tune PCIe capabilities should not fail driver load. This can
      cause the driver load to fail on systems with any of the following:
      1. HFI's parent is not root. Example: HFI card is behind a PCIe bridge.
      2. HFI's parent is not PCI Express capable.
      In these situations, failure to tune PCIe capabilities should be logged
      in the system message logs but not cause the driver load to fail.
      
      This patch also ensures pcie capability word DevCtl is written only
      after a successful read and the capability tuning process continues
      even if read/write of the pcie capability word DevCtl fails.
      
      Fixes: c53df62c ("IB/hfi1: Check return values from PCI config API calls")
      Fixes: bf70a775 ("staging/rdma/hfi1: Enable WFR PCIe extended tags from the driver")
      Reviewed-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
      Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
      Reviewed-by: default avatarJakub Byczkowski <jakub.byczkowski@intel.com>
      Signed-off-by: default avatarHarish Chegondi <harish.chegondi@intel.com>
      Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      828bcbdc
    • Michael J. Ruhl's avatar
      IB/hfi1: On error, fix use after free during user context setup · b8f42738
      Michael J. Ruhl authored
      During base context setup, if setup_base_ctxt() fails, the context is
      deallocated. This is incorrect because the context is referenced on
      return, to notify any waiting subcontext.  If there are no subcontexts
      the pointer will be invalid.
      
      Reorganize the error path so that deallocate_ctxt() is called after all
      the possible subcontexts have been notified.
      Reviewed-by: default avatarIra Weiny <ira.weiny@intel.com>
      Signed-off-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
      Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      b8f42738
    • Alex Estrin's avatar
      Revert "IB/ipoib: Update broadcast object if PKey value was changed in index 0" · 612601d0
      Alex Estrin authored
      commit 9a9b8112 will cause core to fail UD QP from being destroyed
      on ipoib unload, therefore cause resources leakage.
      On pkey change event above patch modifies mgid before calling underlying
      driver to detach it from QP. Drivers' detach_mcast() will fail to find
      modified mgid it was never given to attach in a first place.
      Core qp->usecnt will never go down, so ib_destroy_qp() will fail.
      
      IPoIB driver actually does take care of new broadcast mgid based on new
      pkey by destroying an old mcast object in ipoib_mcast_dev_flush())
      ....
      	if (priv->broadcast) {
      		rb_erase(&priv->broadcast->rb_node, &priv->multicast_tree);
      		list_add_tail(&priv->broadcast->list, &remove_list);
      		priv->broadcast = NULL;
      	}
      ...
      
      then in restarted ipoib_macst_join_task() creating a new broadcast mcast
      object, sending join request and on completion tells the driver to attach
      to reinitialized QP:
      ...
      if (!priv->broadcast) {
      ...
      	broadcast = ipoib_mcast_alloc(dev, 0);
      ...
      	memcpy(broadcast->mcmember.mgid.raw, priv->dev->broadcast + 4,
      	       sizeof (union ib_gid));
      	priv->broadcast = broadcast;
      ...
      
      Fixes: 9a9b8112 ("IB/ipoib: Update broadcast object if PKey value was changed in index 0")
      Cc: stable@vger.kernel.org
      Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
      Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: default avatarAlex Estrin <alex.estrin@intel.com>
      Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
      Reviewed-by: default avatarFeras Daoud <ferasda@mellanox.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      612601d0
    • Kamenee Arumugam's avatar
      IB/hfi1: Return correct value in general interrupt handler · 09592af5
      Kamenee Arumugam authored
      The general interrupt handler returns IRQ_HANDLED whether an IRQ
      was handled or not.
      Determine if an IRQ was handled and return the correct value.
      Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
      Reviewed-by: default avatarMichael J. Ruhl <michael.j.ruhl@intel.com>
      Signed-off-by: default avatarKamenee Arumugam <kamenee.arumugam@intel.com>
      Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      09592af5
    • Jan Sokolowski's avatar
      IB/hfi1: Check eeprom config partition validity · 753b19af
      Jan Sokolowski authored
      Relying on a trailing magic value is incorrect. There are instances where
      this is not present as trailing magic value has a specific purpose which is
      not partition validation. Instead use the header magic value which is
      present in all variants of the platform configuration and is intended for
      validation. This is also used in other locations in the driver.
      
      Fixes: bc5214ee (IB/hfi1: Handle missing magic values in config file)
      Reviewed-by: default avatarJakub Byczkowski <jakub.byczkowski@intel.com>
      Signed-off-by: default avatarJan Sokolowski <jan.sokolowski@intel.com>
      Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      753b19af
    • Sebastian Sanchez's avatar
      IB/hfi1: Only reset QSFP after link up and turn off AOC TX · 30e10527
      Sebastian Sanchez authored
      QSFP reset enables AOC transmitters by default. They should be off
      before moving to high power mode to complete the setup. There is no
      need to reset the QSFP during LNI failure as it was reset at link down.
      Reviewed-by: default avatarMike Marciniszyn <mike.marciniszyn@intel.com>
      Reviewed-by: default avatarJakub Byczkowski <jakub.byczkowski@intel.com>
      Signed-off-by: default avatarSebastian Sanchez <sebastian.sanchez@intel.com>
      Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      30e10527