1. 24 Apr, 2018 3 commits
    • Kan Liang's avatar
      perf evsel: Only fall back group read for leader · 121f325f
      Kan Liang authored
      Perf doesn't support mixed events from different PMUs (except software
      event) in a group. The perf stat should output <not counted>/<not
      supported> for all events, but it doesn't. For example,
      
        perf stat -e '{cycles,uncore_imc_5/umask=0xF,event=0x4/,instructions}'
             <not counted>      cycles
             <not supported>    uncore_imc_5/umask=0xF,event=0x4/
                 1,024,300      instructions
      
      If perf fails to open an event, it doesn't error out directly. It will
      disable some features and retry, until the event is opened or all
      features are disabled. The disabled features will not be re-enabled. The
      group read is one of these features.
      
      For the example as above, the IMC event and the leader event "cycles"
      are from different PMUs. Opening the IMC event must fail. The group read
      feature must be disabled for IMC event and the followed event
      "instructions". The "instructions" event has the same PMU as the leader
      "cycles". It can be opened successfully. Since the group read feature
      has been disabled, the "instructions" event will be read as a single
      event, which definitely has a value.
      
      The group read fallback is still useful for the case which kernel
      doesn't support group read. It is good enough to be handled only by the
      leader.
      
      For the fallback request from members, it must be caused by an error.
      The fallback only breaks the semantics of group.  Limit the group read
      fallback only for the leader.
      
      Committer testing:
      
      On a broadwell t450s notebook:
      
      Before:
      
        # perf stat -e '{cycles,unc_cbo_cache_lookup.read_i,instructions}' sleep 1
      
        Performance counter stats for 'sleep 1':
      
           <not counted>      cycles
         <not supported>      unc_cbo_cache_lookup.read_i
                 818,206      instructions
      
             1.003170887 seconds time elapsed
      
        Some events weren't counted. Try disabling the NMI watchdog:
      	echo 0 > /proc/sys/kernel/nmi_watchdog
      	perf stat ...
      	echo 1 > /proc/sys/kernel/nmi_watchdog
      
      After:
      
        # perf stat -e '{cycles,unc_cbo_cache_lookup.read_i,instructions}' sleep 1
      
        Performance counter stats for 'sleep 1':
      
           <not counted>      cycles
         <not supported>      unc_cbo_cache_lookup.read_i
           <not counted>      instructions
      
             1.001380511 seconds time elapsed
      
        Some events weren't counted. Try disabling the NMI watchdog:
      	echo 0 > /proc/sys/kernel/nmi_watchdog
      	perf stat ...
      	echo 1 > /proc/sys/kernel/nmi_watchdog
        #
      Reported-by: default avatarAndi Kleen <ak@linux.intel.com>
      Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Agustin Vega-Frias <agustinv@codeaurora.org>
      Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Fixes:  82bf311e ("perf stat: Use group read for event groups")
      Link: http://lkml.kernel.org/r/1524594014-79243-3-git-send-email-kan.liang@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      121f325f
    • Kan Liang's avatar
      perf stat: Print out hint for mixed PMU group error · 30060eae
      Kan Liang authored
      Perf doesn't support mixed events from different PMUs (except software
      event) in a group. For this case, only "<not counted>" or "<not
      supported>" are printed out. There is no hint which guides users to fix
      the issue.
      
      Checking the PMU type of events to determine if they are from the same
      PMU. There may be false alarm for the checking. E.g. the core PMU has
      different PMU type. But it should not happen often.
      
      The false alarm can also be tolerated, because:
      
      - It only happens on error path.
      - It just provides a possible solution for the issue.
      Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Cc: Agustin Vega-Frias <agustinv@codeaurora.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Link: http://lkml.kernel.org/r/1524594014-79243-2-git-send-email-kan.liang@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      30060eae
    • Kan Liang's avatar
      perf pmu: Fix core PMU alias list for X86 platform · 292c34c1
      Kan Liang authored
      When counting uncore event with alias, core event is mistakenly
      involved, for example:
      
        perf stat --no-merge -e "unc_m_cas_count.all" -C0  sleep 1
      
        Performance counter stats for 'CPU(s) 0':
      
                       0      unc_m_cas_count.all [uncore_imc_4]
                       0      unc_m_cas_count.all [uncore_imc_2]
                       0      unc_m_cas_count.all [uncore_imc_0]
                 153,640      unc_m_cas_count.all [cpu]
                       0      unc_m_cas_count.all [uncore_imc_5]
                  25,026      unc_m_cas_count.all [uncore_imc_3]
                       0      unc_m_cas_count.all [uncore_imc_1]
      
             1.001447890 seconds time elapsed
      
      The reason is that current implementation doesn't check PMU name of a
      event when adding its alias into the alias list for core PMU. The
      uncore event aliases are mistakenly added.
      
      This bug was introduced in:
        commit 14b22ae0 ("perf pmu: Add helper function is_pmu_core to
        detect PMU CORE devices")
      
      Checking the PMU name for all PMUs on X86 and other architectures except
      ARM.
      There is no behavior change for ARM.
      Signed-off-by: default avatarKan Liang <kan.liang@linux.intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Agustin Vega-Frias <agustinv@codeaurora.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Shaokun Zhang <zhangshaokun@hisilicon.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Fixes: 14b22ae0 ("perf pmu: Add helper function is_pmu_core to detect PMU CORE devices")
      Link: http://lkml.kernel.org/r/1524594014-79243-1-git-send-email-kan.liang@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      292c34c1
  2. 23 Apr, 2018 8 commits
  3. 21 Apr, 2018 1 commit
    • Ingo Molnar's avatar
      Merge tag 'perf-urgent-for-mingo-4.17-20180420' of... · c042f7e9
      Ingo Molnar authored
      Merge tag 'perf-urgent-for-mingo-4.17-20180420' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/urgent fixes and improvements from Arnaldo Carvalho de Melo:
      
      - Store context switch out type in PERF_RECORD_SWITCH[_CPU_WIDE].
        The percentage of preempting and non-preempting context switches help
        understanding the nature of workloads (CPU or IO bound) that are running
        on a machine. This adds the kernel facility and userspace changes needed
        to show this information in 'perf script' and 'perf report -D' (Alexey Budankov)
      
      - Remove old error messages about things that unlikely to be the root cause
        in modern systems (Andi Kleen)
      
      - Synchronize kernel ABI headers, v4.17-rc1 (Ingo Molnar)
      
      - Support MAP_FIXED_NOREPLACE, noticed when updating the tools/include/
        copies (Arnaldo Carvalho de Melo)
      
      - Fixup BPF test using epoll_pwait syscall function probe, to cope with
        the syscall routines renames performed in this development cycle (Arnaldo Carvalho de Melo)
      
      - Fix sample_max_stack maximum check and do not proceed when an error
        has been detect, return them to avoid misidentifying errors (Jiri Olsa)
      
      - Add '\n' at the end of parse-options error messages (Ravi Bangoria)
      
      - Add s390 support for detailed/verbose PMU event description (Thomas Richter)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      c042f7e9
  4. 20 Apr, 2018 2 commits
  5. 19 Apr, 2018 1 commit
  6. 18 Apr, 2018 8 commits
  7. 17 Apr, 2018 9 commits
    • Jiri Olsa's avatar
      perf: Remove superfluous allocation error check · bfb3d7b8
      Jiri Olsa authored
      If the get_callchain_buffers fails to allocate the buffer it will
      decrease the nr_callchain_events right away.
      
      There's no point of checking the allocation error for
      nr_callchain_events > 1. Removing that check.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: syzkaller-bugs@googlegroups.com
      Cc: x86@kernel.org
      Link: http://lkml.kernel.org/r/20180415092352.12403-3-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      bfb3d7b8
    • Jiri Olsa's avatar
      perf: Fix sample_max_stack maximum check · 5af44ca5
      Jiri Olsa authored
      The syzbot hit KASAN bug in perf_callchain_store having the entry stored
      behind the allocated bounds [1].
      
      We miss the sample_max_stack check for the initial event that allocates
      callchain buffers. This missing check allows to create an event with
      sample_max_stack value bigger than the global sysctl maximum:
      
        # sysctl -a | grep perf_event_max_stack
        kernel.perf_event_max_stack = 127
      
        # perf record -vv -C 1 -e cycles/max-stack=256/ kill
        ...
        perf_event_attr:
          size                             112
          ...
          sample_max_stack                 256
        ------------------------------------------------------------
        sys_perf_event_open: pid -1  cpu 1  group_fd -1  flags 0x8 = 4
      
      Note the '-C 1', which forces perf record to create just single event.
      Otherwise it opens event for every cpu, then the sample_max_stack check
      fails on the second event and all's fine.
      
      The fix is to run the sample_max_stack check also for the first event
      with callchains.
      
      [1] https://marc.info/?l=linux-kernel&m=152352732920874&w=2
      
      Reported-by: syzbot+7c449856228b63ac951e@syzkaller.appspotmail.com
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: syzkaller-bugs@googlegroups.com
      Cc: x86@kernel.org
      Fixes: 97c79a38 ("perf core: Per event callchain limit")
      Link: http://lkml.kernel.org/r/20180415092352.12403-2-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      5af44ca5
    • Jiri Olsa's avatar
      perf: Return proper values for user stack errors · 78b562fb
      Jiri Olsa authored
      Return immediately when we find issue in the user stack checks. The
      error value could get overwritten by following check for
      PERF_SAMPLE_REGS_INTR.
      Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: syzkaller-bugs@googlegroups.com
      Cc: x86@kernel.org
      Fixes: 60e2364e ("perf: Add ability to sample machine state on interrupt")
      Link: http://lkml.kernel.org/r/20180415092352.12403-1-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      78b562fb
    • Thomas Richter's avatar
      perf list: Add s390 support for detailed/verbose PMU event description · 038586c3
      Thomas Richter authored
      'perf list' with flags -d and -v print a description (-d) or a very
      verbose explanation (-v) of CPU specific counter events.  These
      descriptions are provided with the json files in directory
      pmu-events/arch/s390/*.json.
      
      Display of these descriptions on s390 requires the corresponding json
      files.
      
      On s390 this does not work because function is_pmu_core() does not
      detect the s390 directory name where the CPU specific events are listed.
      On x86 it is:
      
        /sys/bus/event_source/devices/cpu
      
      whereas on s390 it is:
      
        /sys/bus/event_source/devices/cpum_cf
        /sys/bus/event_source/devices/cpum_sf
      
      Fix this by adding s390 directory name testing to function
      is_pmu_core(). This is the same approach as taken for the ARM platform.
      
      Output before:
      
      [root@s35lp76 perf]# ./perf list -d pmu
      List of pre-defined events (to be used in -e):
      
        cpum_cf/AES_BLOCKED_CYCLES/      [Kernel PMU event]
        cpum_cf/AES_BLOCKED_FUNCTIONS/   [Kernel PMU event]
        cpum_cf/AES_CYCLES/              [Kernel PMU event]
        cpum_cf/AES_FUNCTIONS/           [Kernel PMU event]
        ....
        cpum_cf/TX_NC_TEND/              [Kernel PMU event]
        cpum_cf/VX_BCD_EXECUTION_SLOTS/  [Kernel PMU event]
        cpum_sf/SF_CYCLES_BASIC/         [Kernel PMU event]
      
      Output after:
      
      [root@s35lp76 perf]# ./perf list -d pmu
      List of pre-defined events (to be used in -e):
      
        cpum_cf/AES_BLOCKED_CYCLES/      [Kernel PMU event]
        cpum_cf/AES_BLOCKED_FUNCTIONS/   [Kernel PMU event]
        cpum_cf/AES_CYCLES/              [Kernel PMU event]
        cpum_cf/AES_FUNCTIONS/           [Kernel PMU event]
        ....
        cpum_cf/TX_NC_TEND/              [Kernel PMU event]
        cpum_cf/VX_BCD_EXECUTION_SLOTS/  [Kernel PMU event]
        cpum_sf/SF_CYCLES_BASIC/         [Kernel PMU event]
      
      3906:
        bcd_dfp_execution_slots
             [BCD DFP Execution Slots]
        decimal_instructions
             [Decimal Instructions]
        dtlb2_gpage_writes
             [DTLB2 GPAGE Writes]
        dtlb2_hpage_writes
             [DTLB2 HPAGE Writes]
        dtlb2_misses
             [DTLB2 Misses]
        dtlb2_writes
             [DTLB2 Writes]
        itlb2_misses
             [ITLB2 Misses]
        itlb2_writes
             [ITLB2 Writes]
        l1c_tlb2_misses
             [L1C TLB2 Misses]
        .....
      
      cfvn 3:
        cpu_cycles
             [CPU Cycles]
        instructions
             [Instructions]
        l1d_dir_writes
             [L1D Directory Writes]
        l1d_penalty_cycles
             [L1D Penalty Cycles]
        l1i_dir_writes
             [L1I Directory Writes]
        l1i_penalty_cycles
             [L1I Penalty Cycles]
        problem_state_cpu_cycles
             [Problem State CPU Cycles]
        problem_state_instructions
             [Problem State Instructions]
        ....
      
      csvn generic:
        aes_blocked_cycles
             [AES Blocked Cycles]
        aes_blocked_functions
             [AES Blocked Functions]
        aes_cycles
             [AES Cycles]
        aes_functions
             [AES Functions]
        dea_blocked_cycles
             [DEA Blocked Cycles]
        dea_blocked_functions
             [DEA Blocked Functions]
        ....
      Signed-off-by: default avatarThomas Richter <tmricht@linux.vnet.ibm.com>
      Reviewed-by: default avatarHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Link: http://lkml.kernel.org/r/20180416132314.33249-1-tmricht@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      038586c3
    • Alexey Budankov's avatar
      perf script: Extend misc field decoding with switch out event type · bf30cc18
      Alexey Budankov authored
      Append 'p' sign to 'S' tag designating the type of context switch out event so
      'Sp' means preemption context switch. Documentation is extended to cover
      new presentation changes.
      
        $ perf script --show-switch-events -F +misc -I -i perf.data:
      
                hdparm 4073 [004] U  762.198265:     380194 cycles:ppp:      7faf727f5a23 strchr (/usr/lib64/ld-2.26.so)
                hdparm 4073 [004] K  762.198366:     441572 cycles:ppp:  ffffffffb9218435 alloc_set_pte (/lib/modules/4.16.0-rc6+/build/vmlinux)
                hdparm 4073 [004] S  762.198391: PERF_RECORD_SWITCH_CPU_WIDE OUT          next pid/tid:    0/0
               swapper    0 [004]    762.198392: PERF_RECORD_SWITCH_CPU_WIDE IN           prev pid/tid: 4073/4073
               swapper    0 [004] Sp 762.198477: PERF_RECORD_SWITCH_CPU_WIDE OUT preempt  next pid/tid: 4073/4073
                hdparm 4073 [004]    762.198478: PERF_RECORD_SWITCH_CPU_WIDE IN           prev pid/tid:    0/0
               swapper    0 [007] K  762.198514:    2303073 cycles:ppp:  ffffffffb98b0c66 intel_idle (/lib/modules/4.16.0-rc6+/build/vmlinux)
               swapper    0 [007] Sp 762.198561: PERF_RECORD_SWITCH_CPU_WIDE OUT preempt  next pid/tid: 1134/1134
        kworker/u16:18 1134 [007]    762.198562: PERF_RECORD_SWITCH_CPU_WIDE IN           prev pid/tid:    0/0
        kworker/u16:18 1134 [007] S  762.198567: PERF_RECORD_SWITCH_CPU_WIDE OUT          next pid/tid:    0/0
      Signed-off-by: default avatarAlexey Budankov <alexey.budankov@linux.intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/5fc65ce7-8ca5-53ae-8858-8ddd27290575@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      bf30cc18
    • Alexey Budankov's avatar
      perf report: Extend raw dump (-D) out with switch out event type · b3f35b5d
      Alexey Budankov authored
      Print additional 'preempt' tag for PERF_RECORD_SWITCH[_CPU_WIDE] OUT records when
      event header misc field contains PERF_RECORD_MISC_SWITCH_OUT_PREEMPT bit set
      designating preemption context switch out event:
      
      tools/perf/perf report -D -i perf.data | grep _SWITCH
      
      0 768361415226 0x27f076 [0x28]: PERF_RECORD_SWITCH_CPU_WIDE IN           prev pid/tid:     8/8
      4 768362216813 0x28f45e [0x28]: PERF_RECORD_SWITCH_CPU_WIDE OUT          next pid/tid:     0/0
      4 768362217824 0x28f486 [0x28]: PERF_RECORD_SWITCH_CPU_WIDE IN           prev pid/tid:  4073/4073
      0 768362414027 0x27f0ce [0x28]: PERF_RECORD_SWITCH_CPU_WIDE OUT preempt  next pid/tid:     8/8
      0 768362414367 0x27f0f6 [0x28]: PERF_RECORD_SWITCH_CPU_WIDE IN           prev pid/tid:     0/0
      Signed-off-by: default avatarAlexey Budankov <alexey.budankov@linux.intel.com>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/6f5aebb9-b96c-f304-f08f-8f046d38de4f@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      b3f35b5d
    • Alexey Budankov's avatar
      perf/core: Store context switch out type in PERF_RECORD_SWITCH[_CPU_WIDE] · 101592b4
      Alexey Budankov authored
      Store preempting context switch out event into Perf trace as a part of
      PERF_RECORD_SWITCH[_CPU_WIDE] record.
      
      Percentage of preempting and non-preempting context switches help
      understanding the nature of workloads (CPU or IO bound) that are running
      on a machine;
      
      The event is treated as preemption one when task->state value of the
      thread being switched out is TASK_RUNNING. Event type encoding is
      implemented using PERF_RECORD_MISC_SWITCH_OUT_PREEMPT bit;
      Signed-off-by: default avatarAlexey Budankov <alexey.budankov@linux.intel.com>
      Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
      Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: http://lkml.kernel.org/r/9ff84e83-a0ca-dd82-a6d0-cb951689be74@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      101592b4
    • Ingo Molnar's avatar
      tools/headers: Synchronize kernel ABI headers, v4.17-rc1 · e2f73a18
      Ingo Molnar authored
      Sync the following tooling headers with the latest kernel version:
      
        tools/arch/arm/include/uapi/asm/kvm.h
          - New ABI: KVM_REG_ARM_*
      
        tools/arch/x86/include/asm/required-features.h
          - Removal of NEED_LA57 dependency
      
        tools/arch/x86/include/uapi/asm/kvm.h
          - New KVM ABI: KVM_SYNC_X86_*
      
        tools/include/uapi/asm-generic/mman-common.h
          - New ABI: MAP_FIXED_NOREPLACE flag
      
        tools/include/uapi/linux/bpf.h
          - New ABI: BPF_F_SEQ_NUMBER functions
      
        tools/include/uapi/linux/if_link.h
          - New ABI: IFLA tun and rmnet support
      
        tools/include/uapi/linux/kvm.h
          - New ABI: hyperv eventfd and CONN_ID_MASK support plus header cleanups
      
        tools/include/uapi/sound/asound.h
          - New ABI: SNDRV_PCM_FORMAT_FIRST PCM format specifier
      
        tools/perf/arch/x86/entry/syscalls/syscall_64.tbl
          - The x86 system call table description changed due to the ptregs changes and the renames, in:
      
      	d5a00528: syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to __x64_sys_*()
      	5ac9efa3: syscalls/core, syscalls/x86: Clean up compat syscall stub naming convention
      	ebeb8c82: syscalls/x86: Use 'struct pt_regs' based syscall calling for IA32_EMULATION and x32
      
      Also fix the x86 syscall table warning:
      
        -Warning: Kernel ABI header at 'tools/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'
        +Warning: Kernel ABI header at 'tools/perf/arch/x86/entry/syscalls/syscall_64.tbl' differs from latest version at 'arch/x86/entry/syscalls/syscall_64.tbl'
      
      None of these changes impact existing tooling code, so we only have to copy the kernel version.
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Alexander Potapenko <glider@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
      Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Brian Robbins <brianrob@microsoft.com>
      Cc: Clark Williams <williams@redhat.com>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Dmitriy Vyukov <dvyukov@google.com> <dvyukov@google.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Cc: Jesper Dangaard Brouer <brouer@redhat.com>
      Cc: Jin Yao <yao.jin@linux.intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: Kan Liang <kan.liang@linux.intel.com>
      Cc: Kim Phillips <kim.phillips@arm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Li Zhijian <lizhijian@cn.fujitsu.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Martin Liška <mliska@suse.cz>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Matthias Kaehlcke <mka@chromium.org>
      Cc: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Sandipan Das <sandipan@linux.vnet.ibm.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Takuya Yamamoto <tkydevel@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Thomas Richter <tmricht@linux.ibm.com>
      Cc: Wang Nan <wangnan0@huawei.com>
      Cc: William Cohen <wcohen@redhat.com>
      Cc: Yonghong Song <yhs@fb.com>
      Link: http://lkml.kernel.org/r/20180416064024.ofjtrz5yuu3ykhvl@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      e2f73a18
    • Song Liu's avatar
      trace_kprobe: Remove warning message "Could not insert probe at..." · 5c8dad48
      Song Liu authored
      This warning message is not very helpful, as the return value should
      already show information about the error. Also, this message will
      spam dmesg if the user space does testing in a loop, like:
      
          for x in {0..5}
          do
              echo p:xx xx+$x >> /sys/kernel/debug/tracing/kprobe_events
          done
      Reported-by: default avatarVince Weaver <vincent.weaver@maine.edu>
      Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: kernel-team@fb.com
      Link: http://lkml.kernel.org/r/20180413185513.3626052-1-songliubraving@fb.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      5c8dad48
  8. 16 Apr, 2018 6 commits
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo-4.17-20180413' of... · aacd188a
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo-4.17-20180413' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull tooling improvements and fixes from Arnaldo Carvalho de Melo:
      
      perf annotate fixes and improvements:
      
      - Allow showing offsets in more than just jump targets, use the new
        'O' hotkey in the TUI, config ~/.perfconfig annotate.offset_level
        for it and for --stdio2 (Arnaldo Carvalho de Melo)
      
      - Use the resolved variable names from objdump disassembled lines to
        make them more compact, just like was already done for some instructions,
        like "mov", this eventually will be done more generally, but lets now add
        some more to the existing mechanism (Arnaldo Carvalho de Melo)
      
      perf record fixes:
      
      - Change warning for missing topology sysfs entry to debug, as not all
        architectures have those files, s390 being one of those (Thomas Richter)
      
      perf sched fixes:
      
      - Fix -g/--call-graph documentation (Takuya Yamamoto)
      
      perf stat:
      
      - Enable 1ms interval for printing event counters values in (Alexey Budankov)
      
      perf test fixes:
      
      - Run dwarf unwind  on arm32 (Kim Phillips)
      
      - Remove unused ptrace.h include from LLVM test, sidesteping older
        clang's lack of support for some asm constructs (Arnaldo Carvalho de Melo)
      
      perf version fixes:
      
      - Do not print info about HAVE_LIBAUDIT_SUPPORT in 'perf version --build-options'
        when HAVE_SYSCALL_TABLE_SUPPORT is true, as libaudit won't be used in that
        case, print info about syscall_table support instead (Jin Yao)
      
      Build system fixes:
      
      - Use HAVE_..._SUPPORT used consistently (Jin Yao)
      
      - Restore READ_ONCE() C++ compatibility in tools/include (Mark Rutland)
      
      - Give hints about package names needed to build jvmti (Arnaldo Carvalho de Melo)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      aacd188a
    • Linus Torvalds's avatar
      Linux 4.17-rc1 · 60cc43fc
      Linus Torvalds authored
      60cc43fc
    • Linus Torvalds's avatar
      Merge tag 'for-4.17-part2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · e37563bb
      Linus Torvalds authored
      Pull more btrfs updates from David Sterba:
       "We have queued a few more fixes (error handling, log replay,
        softlockup) and the rest is SPDX updates that touche almost all files
        so the diffstat is long"
      
      * tag 'for-4.17-part2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: Only check first key for committed tree blocks
        btrfs: add SPDX header to Kconfig
        btrfs: replace GPL boilerplate by SPDX -- sources
        btrfs: replace GPL boilerplate by SPDX -- headers
        Btrfs: fix loss of prealloc extents past i_size after fsync log replay
        Btrfs: clean up resources during umount after trans is aborted
        btrfs: Fix possible softlock on single core machines
        Btrfs: bail out on error during replay_dir_deletes
        Btrfs: fix NULL pointer dereference in log_dir_items
      e37563bb
    • Linus Torvalds's avatar
      Merge tag '4.17-rc1SMB3-Fixes' of git://git.samba.org/sfrench/cifs-2.6 · 09c9b0ea
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "SMB3 fixes, a few for stable, and some important cleanup work from
        Ronnie of the smb3 transport code"
      
      * tag '4.17-rc1SMB3-Fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: change validate_buf to validate_iov
        cifs: remove rfc1002 hardcoded constants from cifs_discard_remaining_data()
        cifs: Change SMB2_open to return an iov for the error parameter
        cifs: add resp_buf_size to the mid_q_entry structure
        smb3.11: replace a 4 with server->vals->header_preamble_size
        cifs: replace a 4 with server->vals->header_preamble_size
        cifs: add pdu_size to the TCP_Server_Info structure
        SMB311: Improve checking of negotiate security contexts
        SMB3: Fix length checking of SMB3.11 negotiate request
        CIFS: add ONCE flag for cifs_dbg type
        cifs: Use ULL suffix for 64-bit constant
        SMB3: Log at least once if tree connect fails during reconnect
        cifs: smb2pdu: Fix potential NULL pointer dereference
      09c9b0ea
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · f0d98d85
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "This is a set of minor (and safe changes) that didn't make the initial
        pull request plus some bug fixes.
      
        The status handling code is actually a running regression from the
        previous merge window which had an incomplete fix (now reverted) and
        most of the remaining bug fixes are for problems older than the
        current merge window"
      
      [ Side note: this merge also takes the base kernel git repository to 6+
        million objects for the first time. Technically we hit it a couple of
        merges ago already if you count all the tag objects, but now it
        reaches 6M+ objects reachable from HEAD.
      
        I was joking around that that's when I should switch to 5.0, because
        3.0 happened at the 2M mark, and 4.0 happened at 4M objects. But
        probably not, even if numerology is about as good a reason as any.
      
                                                                    - Linus ]
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: devinfo: Add Microsoft iSCSI target to 1024 sector blacklist
        scsi: cxgb4i: silence overflow warning in t4_uld_rx_handler()
        scsi: dpt_i2o: Use after free in I2ORESETCMD ioctl
        scsi: core: Make scsi_result_to_blk_status() recognize CONDITION MET
        scsi: core: Rename __scsi_error_from_host_byte() into scsi_result_to_blk_status()
        Revert "scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()"
        scsi: aacraid: Insure command thread is not recursively stopped
        scsi: qla2xxx: Correct setting of SAM_STAT_CHECK_CONDITION
        scsi: qla2xxx: correctly shift host byte
        scsi: qla2xxx: Fix race condition between iocb timeout and initialisation
        scsi: qla2xxx: Avoid double completion of abort command
        scsi: qla2xxx: Fix small memory leak in qla2x00_probe_one on probe failure
        scsi: scsi_dh: Don't look for NULL devices handlers by name
        scsi: core: remove redundant assignment to shost->use_blk_mq
      f0d98d85
    • Linus Torvalds's avatar
      Merge tag 'kbuild-v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild · ca71b3ba
      Linus Torvalds authored
      Pull more Kbuild updates from Masahiro Yamada:
      
       - pass HOSTLDFLAGS when compiling single .c host programs
      
       - build genksyms lexer and parser files instead of using shipped
         versions
      
       - rename *-asn1.[ch] to *.asn1.[ch] for suffix consistency
      
       - let the top .gitignore globally ignore artifacts generated by flex,
         bison, and asn1_compiler
      
       - let the top Makefile globally clean artifacts generated by flex,
         bison, and asn1_compiler
      
       - use safer .SECONDARY marker instead of .PRECIOUS to prevent
         intermediate files from being removed
      
       - support -fmacro-prefix-map option to make __FILE__ a relative path
      
       - fix # escaping to prepare for the future GNU Make release
      
       - clean up deb-pkg by using debian tools instead of handrolled
         source/changes generation
      
       - improve rpm-pkg portability by supporting kernel-install as a
         fallback of new-kernel-pkg
      
       - extend Kconfig listnewconfig target to provide more information
      
      * tag 'kbuild-v4.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kconfig: extend output of 'listnewconfig'
        kbuild: rpm-pkg: use kernel-install as a fallback for new-kernel-pkg
        Kbuild: fix # escaping in .cmd files for future Make
        kbuild: deb-pkg: split generating packaging and build
        kbuild: use -fmacro-prefix-map to make __FILE__ a relative path
        kbuild: mark $(targets) as .SECONDARY and remove .PRECIOUS markers
        kbuild: rename *-asn1.[ch] to *.asn1.[ch]
        kbuild: clean up *-asn1.[ch] patterns from top-level Makefile
        .gitignore: move *-asn1.[ch] patterns to the top-level .gitignore
        kbuild: add %.dtb.S and %.dtb to 'targets' automatically
        kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically
        genksyms: generate lexer and parser during build instead of shipping
        kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile
        .gitignore: move *.lex.c *.tab.[ch] patterns to the top-level .gitignore
        kbuild: use HOSTLDFLAGS for single .c executables
      ca71b3ba
  9. 15 Apr, 2018 2 commits
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 9fb71c2f
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A set of fixes and updates for x86:
      
         - Address a swiotlb regression which was caused by the recent DMA
           rework and made driver fail because dma_direct_supported() returned
           false
      
         - Fix a signedness bug in the APIC ID validation which caused invalid
           APIC IDs to be detected as valid thereby bloating the CPU possible
           space.
      
         - Fix inconsisten config dependcy/select magic for the MFD_CS5535
           driver.
      
         - Fix a corruption of the physical address space bits when encryption
           has reduced the address space and late cpuinfo updates overwrite
           the reduced bit information with the original value.
      
         - Dominiks syscall rework which consolidates the architecture
           specific syscall functions so all syscalls can be wrapped with the
           same macros. This allows to switch x86/64 to struct pt_regs based
           syscalls. Extend the clearing of user space controlled registers in
           the entry patch to the lower registers"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/apic: Fix signedness bug in APIC ID validity checks
        x86/cpu: Prevent cpuinfo_x86::x86_phys_bits adjustment corruption
        x86/olpc: Fix inconsistent MFD_CS5535 configuration
        swiotlb: Use dma_direct_supported() for swiotlb_ops
        syscalls/x86: Adapt syscall_wrapper.h to the new syscall stub naming convention
        syscalls/core, syscalls/x86: Rename struct pt_regs-based sys_*() to __x64_sys_*()
        syscalls/core, syscalls/x86: Clean up compat syscall stub naming convention
        syscalls/core, syscalls/x86: Clean up syscall stub naming convention
        syscalls/x86: Extend register clearing on syscall entry to lower registers
        syscalls/x86: Unconditionally enable 'struct pt_regs' based syscalls on x86_64
        syscalls/x86: Use 'struct pt_regs' based syscall calling for IA32_EMULATION and x32
        syscalls/core: Prepare CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y for compat syscalls
        syscalls/x86: Use 'struct pt_regs' based syscall calling convention for 64-bit syscalls
        syscalls/core: Introduce CONFIG_ARCH_HAS_SYSCALL_WRAPPER=y
        x86/syscalls: Don't pointlessly reload the system call number
        x86/mm: Fix documentation of module mapping range with 4-level paging
        x86/cpuid: Switch to 'static const' specifier
      9fb71c2f
    • Linus Torvalds's avatar
      Merge branch 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 6b0a02e8
      Linus Torvalds authored
      Pull x86 pti updates from Thomas Gleixner:
       "Another series of PTI related changes:
      
         - Remove the manual stack switch for user entries from the idtentry
           code. This debloats entry by 5k+ bytes of text.
      
         - Use the proper types for the asm/bootparam.h defines to prevent
           user space compile errors.
      
         - Use PAGE_GLOBAL for !PCID systems to gain back performance
      
         - Prevent setting of huge PUD/PMD entries when the entries are not
           leaf entries otherwise the entries to which the PUD/PMD points to
           and are populated get lost"
      
      * 'x86-pti-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/pgtable: Don't set huge PUD/PMD on non-leaf entries
        x86/pti: Leave kernel text global for !PCID
        x86/pti: Never implicitly clear _PAGE_GLOBAL for kernel image
        x86/pti: Enable global pages for shared areas
        x86/mm: Do not forbid _PAGE_RW before init for __ro_after_init
        x86/mm: Comment _PAGE_GLOBAL mystery
        x86/mm: Remove extra filtering in pageattr code
        x86/mm: Do not auto-massage page protections
        x86/espfix: Document use of _PAGE_GLOBAL
        x86/mm: Introduce "default" kernel PTE mask
        x86/mm: Undo double _PAGE_PSE clearing
        x86/mm: Factor out pageattr _PAGE_GLOBAL setting
        x86/entry/64: Drop idtentry's manual stack switch for user entries
        x86/uapi: Fix asm/bootparam.h userspace compilation errors
      6b0a02e8