1. 24 Oct, 2012 15 commits
    • Jiri Olsa's avatar
      perf/x86: Filter out undefined events from sysfs events attribute · 8300daa2
      Jiri Olsa authored
      The sysfs events group attribute currently shows all hw events,
      including also undefined ones.
      
      This patch filters out all undefined events out of the sysfs events
      group attribute, so they don't even show up.
      Suggested-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Stephane Eranian <eranian@google.com>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1349873598-12583-3-git-send-email-jolsa@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      8300daa2
    • Jiri Olsa's avatar
      perf/x86: Make hardware event translations available in sysfs · a4747393
      Jiri Olsa authored
      Add support to display hardware events translations available
      through the sysfs. Add 'events' group attribute under the sysfs
      x86 PMU record with attribute/file for each hardware event.
      
      This patch adds only backbone for PMUs to display config under
      'events' directory. The specific PMU support itself will come
      in next patches, however this is how the sysfs group will look
      like:
      
        # ls  /sys/devices/cpu/events/
        branch-instructions
        branch-misses
        bus-cycles
        cache-misses
        cache-references
        cpu-cycles
        instructions
        ref-cycles
        stalled-cycles-backend
        stalled-cycles-frontend
      
      The file - hw event ID mapping is:
      
        file                      hw event ID
        ---------------------------------------------------------------
        cpu-cycles                PERF_COUNT_HW_CPU_CYCLES
        instructions              PERF_COUNT_HW_INSTRUCTIONS
        cache-references          PERF_COUNT_HW_CACHE_REFERENCES
        cache-misses              PERF_COUNT_HW_CACHE_MISSES
        branch-instructions       PERF_COUNT_HW_BRANCH_INSTRUCTIONS
        branch-misses             PERF_COUNT_HW_BRANCH_MISSES
        bus-cycles                PERF_COUNT_HW_BUS_CYCLES
        stalled-cycles-frontend   PERF_COUNT_HW_STALLED_CYCLES_FRONTEND
        stalled-cycles-backend    PERF_COUNT_HW_STALLED_CYCLES_BACKEND
        ref-cycles                PERF_COUNT_HW_REF_CPU_CYCLES
      
      Each file in the 'events' directory contains the term translation
      for the symbolic hw event for the currently running cpu model.
      
        # cat /sys/devices/cpu/events/stalled-cycles-backend
        event=0xb1,umask=0x01,inv,cmask=0x01
      Suggested-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Signed-off-by: default avatarJiri Olsa <jolsa@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/1349873598-12583-2-git-send-email-jolsa@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      a4747393
    • Ingo Molnar's avatar
      Merge branch 'perf/urgent' into perf/core · ef8c029f
      Ingo Molnar authored
      Pick up v3.7-rc2 and fixes before applying more patches.
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      ef8c029f
    • Srivatsa S. Bhat's avatar
      perf, cpu hotplug: Use cached value of smp_processor_id() · c13d38e4
      Srivatsa S. Bhat authored
      The perf_cpu_notifier() macro invokes smp_processor_id()
      multiple times. Optimize it by using a local variable.
      Signed-off-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Reviewed-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: peterz@infradead.org
      Cc: acme@ghostprotocols.net
      Link: http://lkml.kernel.org/r/20121016075817.3572.76733.stgit@srivatsabhat.in.ibm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      c13d38e4
    • Srivatsa S. Bhat's avatar
      perf, cpu hotplug: Run CPU_STARTING notifiers with irqs disabled · 6760bca9
      Srivatsa S. Bhat authored
      The CPU_STARTING notifiers are supposed to be run with irqs
      disabled. But the perf_cpu_notifier() macro invokes them without
      doing that. Fix it.
      Signed-off-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Reviewed-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: peterz@infradead.org
      Cc: acme@ghostprotocols.net
      Link: http://lkml.kernel.org/r/20121016075809.3572.47848.stgit@srivatsabhat.in.ibm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      6760bca9
    • Andre Przywara's avatar
      x86/perf: Fix virtualization sanity check · bffd5fc2
      Andre Przywara authored
      In check_hw_exists() we try to detect non-emulated MSR accesses
      by writing an arbitrary value into one of the PMU registers
      and check if it's value after a readout is still the same.
      This algorithm silently assumes that the register does not contain
      the magic value already, which is wrong in at least one situation.
      
      Fix the algorithm to really do a read-modify-write cycle. This fixes
      a warning under Xen under some circumstances on AMD family 10h CPUs.
      
      The reasons in more details actually sound like a story from
      Believe It or Not!:
      
      First you need an AMD family 10h/12h CPU. These do not reset the
      PERF_CTR registers on a reboot.
      Now you boot bare metal Linux, which goes successfully through this
      check, but leaves the magic value of 0xabcd in the register. You
      don't use the performance counters, but do a reboot (warm reset).
      Then you choose to boot Xen. The check will be triggered with a
      recent Linux kernel as Dom0 again, trying to write 0xabcd into the
      MSR. Xen silently drops the write (expected), but the subsequent read
      will return the value in the register, which just happens to be the
      expected magic value. Thus the test misleadingly succeeds, leaving
      the kernel in the belief that the PMU is available. This will trigger
      the following message:
      
      [    0.020294] ------------[ cut here ]------------
      [    0.020311] WARNING: at arch/x86/xen/enlighten.c:730 xen_apic_write+0x15/0x17()
      [    0.020318] Hardware name: empty
      [    0.020323] Modules linked in:
      [    0.020334] Pid: 1, comm: swapper/0 Not tainted 3.3.8 #7
      [    0.020340] Call Trace:
      [    0.020354]  [<ffffffff81050379>] warn_slowpath_common+0x80/0x98
      [    0.020369]  [<ffffffff810503a6>] warn_slowpath_null+0x15/0x17
      [    0.020378]  [<ffffffff810034df>] xen_apic_write+0x15/0x17
      [    0.020392]  [<ffffffff8101cb2b>] perf_events_lapic_init+0x2e/0x30
      [    0.020410]  [<ffffffff81ee4dd0>] init_hw_perf_events+0x250/0x407
      [    0.020419]  [<ffffffff81ee4b80>] ? check_bugs+0x2d/0x2d
      [    0.020430]  [<ffffffff81002181>] do_one_initcall+0x7a/0x131
      [    0.020444]  [<ffffffff81edbbf9>] kernel_init+0x91/0x15d
      [    0.020456]  [<ffffffff817caaa4>] kernel_thread_helper+0x4/0x10
      [    0.020471]  [<ffffffff817c347c>] ? retint_restore_args+0x5/0x6
      [    0.020481]  [<ffffffff817caaa0>] ? gs_change+0x13/0x13
      [    0.020500] ---[ end trace a7919e7f17c0a725 ]---
      
      The new code will change every of the 16 low bits read from the
      register and tries to write and read-back that modified number
      from the MSR.
      Signed-off-by: default avatarAndre Przywara <andre.przywara@amd.com>
      Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Avi Kivity <avi@redhat.com>
      Link: http://lkml.kernel.org/r/1349797115-28346-2-git-send-email-andre.przywara@amd.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      bffd5fc2
    • Ingo Molnar's avatar
      Merge tag 'perf-urgent-for-mingo' of... · c1264a4a
      Ingo Molnar authored
      Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Pull perf/urgent fixes from Arnaldo Carvalho de Melo:
      
       * Validate syscall id before growing syscall table in 'trace', fixing potential
         excessive memory usage.
      
       * Validate perf_sample.raw_data, making 'trace' more robust, avoiding some
         potential SEGFAULTs when reading tracepoint fields.
      
       * Fix exclude_guest parse events 'perf test's, from Jiri Olsa.
      
       * Do not flush maps on COMM, that is sent by the kernel when a process is
         exec'ed, but also when a process changes its name. Since we were assuming
         a COMM always meant an EXEC, we were losing track of a process maps by
         flushing its maps. Fix from Luigi Semenzato.
      
       * A recent patch introduced a problem by not initializing what should be
         the first kind of pager to use, 'man', instead it was being left as zero
         which means no pager. This caused 'perf subcmd --help' to produce no output.
         Fix from Namhyung Kim.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      c1264a4a
    • Linus Torvalds's avatar
      Merge tag 'stable/for-linus-3.7-rc2-tag' of... · 0e9e3e30
      Linus Torvalds authored
      Merge tag 'stable/for-linus-3.7-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
      
      Pull xen bug-fixes from Konrad Rzeszutek Wilk:
       - Fix mysterious SIGSEGV or SIGKILL in applications due to corrupting
         of the %eip when returning from a signal handler.
       - Fix various ARM compile issues after the merge fallout.
       - Continue on making more of the Xen generic code usable by ARM
         platform.
       - Fix SR-IOV passthrough to mirror multifunction PCI devices.
       - Fix various compile warnings.
       - Remove hypercalls that don't exist anymore.
      
      * tag 'stable/for-linus-3.7-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
        xen: dbgp: Fix warning when CONFIG_PCI is not enabled.
        xen: arm: comment on why 64-bit xen_pfn_t is safe even on 32 bit
        xen: balloon: use correct type for frame_list
        xen/x86: don't corrupt %eip when returning from a signal handler
        xen: arm: make p2m operations NOPs
        xen: balloon: don't include e820.h
        xen: grant: use xen_pfn_t type for frame_list.
        xen: events: pirq_check_eoi_map is X86 specific
        xen: XENMEM_translate_gpfn_list was remove ages ago and is unused.
        xen: sysfs: fix build warning.
        xen: sysfs: include err.h for PTR_ERR etc
        xen: xenbus: quirk uses x86 specific cpuid
        xen PV passthru: assign SR-IOV virtual functions to separate virtual slots
        xen/xenbus: Fix compile warning.
        xen/x86: remove duplicated include from enlighten.c
      0e9e3e30
    • Al Viro's avatar
      alpha: separate thread-synchronous flags · 3185bd26
      Al Viro authored
      ... and fix the race in updating unaligned control ones
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3185bd26
    • Linus Torvalds's avatar
      Merge tag 'kvm-3.7-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 3d0ceac1
      Linus Torvalds authored
      Pull kvm fixes from Avi Kivity:
       "KVM updates for 3.7-rc2"
      
      * tag 'kvm-3.7-2' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM guest: exit idleness when handling KVM_PV_REASON_PAGE_NOT_PRESENT
        KVM: apic: fix LDR calculation in x2apic mode
        KVM: MMU: fix release noslot pfn
      3d0ceac1
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e17b1315
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "Most of these are uprobes race fixes from Oleg, and their preparatory
        cleanups.  (It's larger than what I'd normally send for an -rc kernel,
        but they looked significant enough to not delay them.)
      
        There's also an oprofile fix and an uncore PMU fix."
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (22 commits)
        perf/x86: Disable uncore on virtualized CPUs
        oprofile, x86: Fix wrapping bug in op_x86_get_ctrl()
        ring-buffer: Check for uninitialized cpu buffer before resizing
        uprobes: Fix the racy uprobe->flags manipulation
        uprobes: Fix prepare_uprobe() race with itself
        uprobes: Introduce prepare_uprobe()
        uprobes: Fix handle_swbp() vs unregister() + register() race
        uprobes: Do not delete uprobe if uprobe_unregister() fails
        uprobes: Don't return success if alloc_uprobe() fails
        uprobes/x86: Only rep+nop can be emulated correctly
        uprobes: Simplify is_swbp_at_addr(), remove stale comments
        uprobes: Kill set_orig_insn()->is_swbp_at_addr()
        uprobes: Introduce copy_opcode(), kill read_opcode()
        uprobes: Kill set_swbp()->is_swbp_at_addr()
        uprobes: Restrict valid_vma(false) to skip VM_SHARED vmas
        uprobes: Change valid_vma() to demand VM_MAYEXEC rather than VM_EXEC
        uprobes: Change write_opcode() to use FOLL_FORCE
        uprobes: Move clear_thread_flag(TIF_UPROBE) to uprobe_notify_resume()
        uprobes: Kill UTASK_BP_HIT state
        uprobes: Fix UPROBE_SKIP_SSTEP checks in handle_swbp()
        ...
      e17b1315
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 684baeb1
      Linus Torvalds authored
      Pull core kernel fixes from Ingo Molnar:
       "Two small fixes"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        Documentation: Reflect the new location of the NMI watchdog info
        nohz: Fix idle ticks in cpu summary line of /proc/stat
      684baeb1
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 4e3ab74c
      Linus Torvalds authored
      Pull s390 fixes from Martin Schwidefsky:
       "Among the usual minor bug fixes the more interesting patches are the
        perf counters for the latest machine, the missing select to enable
        transparent huge pages and a build fix for the UAPI rework."
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390,uapi: do not use uapi/asm-generic/kvm_para.h
        s390/cache: fix data/instruction cache output
        s390: fix linker script for 31 bit builds
        s390/thp: select HAVE_ARCH_TRANSPARENT_HUGEPAGE
        s390/kdump: Use 64 bit mode for 0x10000 entry point
        perf_cpum_cf: Add support for counters available with IBM zEC12
        s390/css: stop stsch loop after cc 3
        s390/cio: use generic bitmap functions
        s390/chpid: make headers usable (again)
      4e3ab74c
    • Linus Torvalds's avatar
      Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile · 4a09cbce
      Linus Torvalds authored
      Pull tile fixes from Chris Metcalf:
       "This fixes one issue with compiler flags that can cause modules not to
        load, and cleans up some warnings with ELF_R_xxx defines."
      
      * 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
        arch/tile: avoid build warnings from duplicate ELF_R_xxx #defines
        arch/tile: avoid generating .eh_frame information in modules
      4a09cbce
    • Linus Torvalds's avatar
      Merge tag 'please-pull-uapi-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux · 62472efe
      Linus Torvalds authored
      Pull ia64 fix from Tony Luck:
       "Fix from dhowells for UAPI fallout"
      
      * tag 'please-pull-uapi-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
        UAPI: Make arch/ia64/include/asm/kvm_para.h generic
      62472efe
  2. 23 Oct, 2012 13 commits
  3. 22 Oct, 2012 12 commits