1. 28 Apr, 2016 1 commit
    • Adam Borowski's avatar
      perf/x86/amd: Set the size of event map array to PERF_COUNT_HW_MAX · 0a25556f
      Adam Borowski authored
      The entry for PERF_COUNT_HW_REF_CPU_CYCLES is not used on AMD, but is
      referenced by filter_events() which expects undefined events to have a
      value of 0.
      
      Found via KASAN:
      
        UBSAN: Undefined behaviour in arch/x86/events/amd/core.c:132:30
        index 9 is out of range for type 'u64 [9]'
        UBSAN: Undefined behaviour in arch/x86/events/amd/core.c:132:9
        load of address ffffffff81c021c8 with insufficient space for an object of type 'const u64'
      Signed-off-by: default avatarAdam Borowski <kilobyte@angband.pl>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Link: http://lkml.kernel.org/r/1461749731-30979-1-git-send-email-kilobyte@angband.plSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      0a25556f
  2. 23 Apr, 2016 3 commits
  3. 19 Apr, 2016 1 commit
  4. 18 Apr, 2016 2 commits
    • Adrian Hunter's avatar
      perf intel-pt: Fix segfault tracing transactions · 1342e0b7
      Adrian Hunter authored
      Tracing a workload that uses transactions gave a seg fault as follows:
      
        perf record -e intel_pt// workload
        perf report
        Program received signal SIGSEGV, Segmentation fault.
        0x000000000054b58c in intel_pt_reset_last_branch_rb (ptq=0x1a36110)
        	at util/intel-pt.c:929
        929 ptq->last_branch_rb->nr = 0;
        (gdb) p ptq->last_branch_rb
        $1 = (struct branch_stack *) 0x0
        (gdb) up
        1148 intel_pt_reset_last_branch_rb(ptq);
        (gdb) l
        1143 if (ret)
        1144 pr_err("Intel Processor Trace: failed to deliver transaction event
        1145 ret);
        1146
        1147 if (pt->synth_opts.callchain)
        1148 intel_pt_reset_last_branch_rb(ptq);
        1149
        1150 return ret;
        1151 }
        1152
        (gdb) p pt->synth_opts.callchain
        $2 = true
        (gdb)
        (gdb) bt
         #0 0x000000000054b58c in intel_pt_reset_last_branch_rb (ptq=0x1a36110)
         #1 0x000000000054c1e0 in intel_pt_synth_transaction_sample (ptq=0x1a36110)
         #2 0x000000000054c5b2 in intel_pt_sample (ptq=0x1a36110)
      
      Caused by checking the 'callchain' flag when it should have been the
      'last_branch' flag.  Fix that.
      Reported-by: default avatarAndi Kleen <ak@linux.intel.com>
      Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: stable@vger.kernel.org # v4.4+
      Fixes: f14445ee ("perf intel-pt: Support generating branch stack")
      Link: http://lkml.kernel.org/r/1460977068-11566-1-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      1342e0b7
    • Linus Torvalds's avatar
      Linux 4.6-rc4 · c3b46c73
      Linus Torvalds authored
      c3b46c73
  5. 17 Apr, 2016 5 commits
  6. 16 Apr, 2016 7 commits
  7. 15 Apr, 2016 17 commits
  8. 14 Apr, 2016 4 commits
    • Mike Snitzer's avatar
      dm cache metadata: fix READ_LOCK macros and cleanup WRITE_LOCK macros · 9567366f
      Mike Snitzer authored
      The READ_LOCK macro was incorrectly returning -EINVAL if
      dm_bm_is_read_only() was true -- it will always be true once the cache
      metadata transitions to read-only by dm_cache_metadata_set_read_only().
      
      Wrap READ_LOCK and WRITE_LOCK multi-statement macros in do {} while(0).
      Also, all accesses of the 'cmd' argument passed to these related macros
      are now encapsulated in parenthesis.
      
      A follow-up patch can be developed to eliminate the use of macros in
      favor of pure C code.  Avoiding that now given that this needs to apply
      to stable@.
      Reported-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Fixes: d14fcf3d ("dm cache: make sure every metadata function checks fail_io")
      Cc: stable@vger.kernel.org
      9567366f
    • Keith Busch's avatar
      NVMe: Always use MSI/MSI-x interrupts · a5229050
      Keith Busch authored
      Multiple users have reported device initialization failure due the driver
      not receiving legacy PCI interrupts. This is not unique to any particular
      controller, but has been observed on multiple platforms.
      
      There have been no issues reported or observed when with message signaled
      interrupts, so this patch attempts to use MSI-x during initialization,
      falling back to MSI. If that fails, legacy would become the default.
      
      The setup_io_queues error handling had to change as a result: the admin
      queue's msix_entry used to be initialized to the legacy IRQ. The case
      where nr_io_queues is 0 would fail request_irq when setting up the admin
      queue's interrupt since re-enabling MSI-x fails with 0 vectors, leaving
      the admin queue's msix_entry invalid. Instead, return success immediately.
      Reported-by: default avatarTim Muhlemmer <muhlemmer@gmail.com>
      Reported-by: default avatarJon Derrick <jonathan.derrick@intel.com>
      Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
      Signed-off-by: default avatarJens Axboe <axboe@fb.com>
      a5229050
    • Linus Torvalds's avatar
      /proc/iomem: only expose physical resource addresses to privileged users · 51d7b120
      Linus Torvalds authored
      In commit c4004b02 ("x86: remove the kernel code/data/bss resources
      from /proc/iomem") I was hoping to remove the phyiscal kernel address
      data from /proc/iomem entirely, but that had to be reverted because some
      system programs actually use it.
      
      This limits all the detailed resource information to properly
      credentialed users instead.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      51d7b120
    • Linus Torvalds's avatar
      pci-sysfs: use proper file capability helper function · ab0fa82b
      Linus Torvalds authored
      The PCI config access checked the file capabilities correctly, but used
      the itnernal security capability check rather than the helper function
      that is actually meant for that.
      
      The security_capable() has unusual return values and is not meant to be
      used elsewhere (the only other use is in the capability checking
      functions that we actually intend people to use, and this odd PCI usage
      really stood out when looking around the capability code.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ab0fa82b