1. 08 Jun, 2016 15 commits
    • Dave Hansen's avatar
      perf/x86/cstate: Use Intel Model name macros · bf4ad541
      Dave Hansen authored
      This should be getting old by now.  Use the new macros intead of
      open-coded magic numbers.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave@sr71.net>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      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>
      Cc: jacob.jun.pan@intel.com
      Link: http://lkml.kernel.org/r/20160603001940.FE69D646@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      bf4ad541
    • Dave Hansen's avatar
      perf/x86/msr: Add missing Intel models · 5134596c
      Dave Hansen authored
      This patch presumes that Kabylake and Skylake Server will be the
      same as the existing Skylake parts and adds them to the MSR
      events code.
      
      Also add handling for "WESTMERE2".
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave@sr71.net>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      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>
      Cc: jacob.jun.pan@intel.com
      Link: http://lkml.kernel.org/r/20160603001935.FE6B3847@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      5134596c
    • Dave Hansen's avatar
      perf/x86/msr: Use Intel family macros for MSR events code · 353bf605
      Dave Hansen authored
      Use the new INTEL_MODEL_* macros for arch/x86/events/msr.c.
      
      This code appears to be missing handling for "WESTMERE2" and
      "SKYLAKE_X".
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave@sr71.net>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      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>
      Cc: jacob.jun.pan@intel.com
      Link: http://lkml.kernel.org/r/20160603001933.99A402B0@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      353bf605
    • Dave Hansen's avatar
      perf/x86/rapl: Use Intel family macros for RAPL · 7f2236d0
      Dave Hansen authored
      Use the new INTEL_FAM6_* macros for rapl.c.
      
      Note that this is missing at least one Westmere model and Skylake
      Server which will we fixed later in this series.
      
      The resulting binary structure 'rapl_cpu_match' is the same
      before and after this patch.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave@sr71.net>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Cc: jacob.jun.pan@intel.com
      Link: http://lkml.kernel.org/r/20160603001930.6AC50BE3@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      7f2236d0
    • Dave Hansen's avatar
      perf/x86/intel: Use Intel family macros for core perf events · ef5f9f47
      Dave Hansen authored
      Use the new model number macros instead of spelling things out
      in the comments.
      
      Note that this is missing a Nehalem model that is mentioned in
      intel_idle which is fixed up in a later patch.
      
      The resulting binary (arch/x86/events/intel/core.o) is exactly
      the same with and without this patch modulo some harmless changes
      to restoring %esi in the return path of functions, even those
      untouched by this patch.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Dave Hansen <dave@sr71.net>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      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>
      Cc: jacob.jun.pan@intel.com
      Link: http://lkml.kernel.org/r/20160603001929.C5F1C079@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      ef5f9f47
    • Ingo Molnar's avatar
      Merge branch 'x86/urgent' into perf/core, to pick up dependency · 020d704c
      Ingo Molnar authored
      We are going to clean up perf's use of magic Intel model numbers,
      so merge in the prerequisite commit that adds the model number
      defines.
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      020d704c
    • Dave Hansen's avatar
      x86/cpu/intel: Introduce macros for Intel family numbers · 970442c5
      Dave Hansen authored
      Problem:
      
      We have a boatload of open-coded family-6 model numbers.  Half of
      them have these model numbers in hex and the other half in
      decimal.  This makes grepping for them tons of fun, if you were
      to try.
      
      Solution:
      
      Consolidate all the magic numbers.  Put all the definitions in
      one header.
      
      The names here are closely derived from the comments describing
      the models from arch/x86/events/intel/core.c.  We could easily
      make them shorter by doing things like s/SANDYBRIDGE/SNB/, but
      they seemed fine even with the longer versions to me.
      
      Do not take any of these names too literally, like "DESKTOP"
      or "MOBILE".  These are all colloquial names and not precise
      descriptions of everywhere a given model will show up.
      Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Darren Hart <dvhart@infradead.org>
      Cc: Dave Hansen <dave@sr71.net>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Doug Thompson <dougthompson@xmission.com>
      Cc: Eduardo Valentin <edubezval@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Rajneesh Bhardwaj <rajneesh.bhardwaj@intel.com>
      Cc: Souvik Kumar Chakravarty <souvik.k.chakravarty@intel.com>
      Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: Vishwanath Somayaji <vishwanath.somayaji@intel.com>
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: jacob.jun.pan@intel.com
      Cc: linux-acpi@vger.kernel.org
      Cc: linux-edac@vger.kernel.org
      Cc: linux-mmc@vger.kernel.org
      Cc: linux-pm@vger.kernel.org
      Cc: platform-driver-x86@vger.kernel.org
      Link: http://lkml.kernel.org/r/20160603001927.F2A7D828@viggo.jf.intel.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      970442c5
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo-20160607' of... · b8ab9220
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo-20160607' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      User visible changes:
      
      - Support cross unwinding, i.e. collecting '--call-graph dwarf' perf.data files
        in one machine and then doing analysis in another machine of a different
        hardware architecture. This enables, for instance, to do:
      
      	perf record -a --call-graph dwarf
      
        on a x86-32 or aarch64 system and then do 'perf report' on it on a
        x86_64 workstation. (He Kuang)
      
      - Fix crash in build_id_cache__kallsyms_path(), recent regression (Wang Nan)
      
      Infrastructure changes:
      
      - Make tools/lib/bpf use the IS_ERR return facility consistently and also stop
        using the _get_ term for non-reference count methods (Arnaldo Carvalho de Melo)
      
      - 'perf config' refactorings (Taeung Song)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      b8ab9220
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo-20160606' of... · aa3a655b
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo-20160606' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/core
      
      Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo:
      
      User visible changes:
      
      - Tooling support for TopDown counters, recently added to the kernel (Andi Kleen)
      
      - Show call graphs in 'perf script' when 1st event doesn't have it but some other has (He Kuang)
      
      - Fix terminal cleanup when handling invalid .perfconfig files in 'perf top' (Taeung Song)
      
      Build fixes:
      
      - Respect CROSS_COMPILE for the linker in libapi (Lucas Stach)
      
      Infrastructure changes:
      
      - Fix perf_evlist__alloc_mmap() failure path (Wang Nan)
      
      - Provide way to extract integer value from format_field (Arnaldo Carvalho de Melo)
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      aa3a655b
    • Ingo Molnar's avatar
      616d1c1b
    • David Carrillo-Cisneros's avatar
      perf/core: Fix crash due to account/unaccount_sb_event() inconsistency · a4f144eb
      David Carrillo-Cisneros authored
      unaccount_pmu_sb_event() did not check for attributes in event->attr
      before calling detach_sb_event(), while account_pmu_event() did.
      
      This caused NULL pointer reference in cgroup events that did not
      have any of the attributes checked by account_pmu_event().
      
      To trigger the bug just wait for a cgroup event to terminate, e.g.:
      
        $ mkdir /dev/cgroup/devices/test
        $ perf stat -e cycles -a -G test sleep 0
      
      ... see crash ...
      Signed-off-by: default avatarDavid Carrillo-Cisneros <davidcc@google.com>
      Reviewed-by: default avatarStephane Eranian <eranian@google.com>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Kan Liang <kan.liang@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Zheng <zheng.z.yan@intel.com>
      Link: http://lkml.kernel.org/r/1464809585-66072-1-git-send-email-davidcc@google.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a4f144eb
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · c8ae067f
      Linus Torvalds authored
      Pull vfs fixes from Al Viro:
       "Fixes for crap of assorted ages: EOPENSTALE one is 4.2+, autofs one is
        4.6, d_walk - 3.2+.
      
        The atomic_open() and coredump ones are regressions from this window"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        coredump: fix dumping through pipes
        fix a regression in atomic_open()
        fix d_walk()/non-delayed __d_free() race
        autofs braino fix for do_last()
        fix EOPENSTALE bug in do_last()
      c8ae067f
    • Mateusz Guzik's avatar
      coredump: fix dumping through pipes · 1607f09c
      Mateusz Guzik authored
      The offset in the core file used to be tracked with ->written field of
      the coredump_params structure. The field was retired in favour of
      file->f_pos.
      
      However, ->f_pos is not maintained for pipes which leads to breakage.
      
      Restore explicit tracking of the offset in coredump_params. Introduce
      ->pos field for this purpose since ->written was already reused.
      
      Fixes: a0083939 ("get rid of coredump_params->written").
      Reported-by: default avatarZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
      Signed-off-by: default avatarMateusz Guzik <mguzik@redhat.com>
      Reviewed-by: default avatarOmar Sandoval <osandov@fb.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      1607f09c
    • Al Viro's avatar
      fix a regression in atomic_open() · a01e718f
      Al Viro authored
      open("/foo/no_such_file", O_RDONLY | O_CREAT) on should fail with
      EACCES when /foo is not writable; failing with ENOENT is obviously
      wrong.  That got broken by a braino introduced when moving the
      creat_error logics from atomic_open() to lookup_open().  Easy to
      fix, fortunately.
      Spotted-by: default avatar"Yan, Zheng" <ukernel@gmail.com>
      Tested-by: default avatar"Yan, Zheng" <ukernel@gmail.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      a01e718f
    • Al Viro's avatar
      fix d_walk()/non-delayed __d_free() race · 3d56c25e
      Al Viro authored
      Ascend-to-parent logics in d_walk() depends on all encountered child
      dentries not getting freed without an RCU delay.  Unfortunately, in
      quite a few cases it is not true, with hard-to-hit oopsable race as
      the result.
      
      Fortunately, the fix is simiple; right now the rule is "if it ever
      been hashed, freeing must be delayed" and changing it to "if it
      ever had a parent, freeing must be delayed" closes that hole and
      covers all cases the old rule used to cover.  Moreover, pipes and
      sockets remain _not_ covered, so we do not introduce RCU delay in
      the cases which are the reason for having that delay conditional
      in the first place.
      
      Cc: stable@vger.kernel.org # v3.2+ (and watch out for __d_materialise_dentry())
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      3d56c25e
  2. 07 Jun, 2016 22 commits
  3. 06 Jun, 2016 3 commits