1. 21 2月, 2014 1 次提交
  2. 17 12月, 2013 1 次提交
  3. 09 10月, 2013 1 次提交
    • W
      ARM: perf: fix group validation for mixed software and hardware groups · 2dfcb802
      Will Deacon 提交于
      Since software events can always be scheduled, perf allows software and
      hardware events to be mixed together in the same event group. There are
      two ways in which this can come about:
      
        (1) A SW event is added to a HW group. This validates using the HW PMU
            of the group leader.
      
        (2) A HW event is added to a SW group. This inserts the SW events and
            the new HW event into a HW context, but the SW event remains the
            group leader.
      
      When validating the latter case, we would ideally compare the PMU of
      each event in the group with the relevant HW PMU. The problem is, in the
      face of potentially multiple HW PMUs, we don't have a handle on the
      relevant structure. Commit 7b9f72c6 ("ARM: perf: clean up event
      group validation") attempting to resolve this issue, but actually made
      things *worse* by comparing with the leader PMU. If the leader is a SW
      event, then we automatically `pass' all the HW events during validation!
      
      This patch removes the check against the leader PMU. Whilst this will
      allow events from multiple HW PMUs to be grouped together, that should
      probably be dealt with in perf core as the result of a later patch.
      Acked-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      2dfcb802
  4. 14 8月, 2013 3 次提交
    • S
      perf/arm: Fix armpmu_map_hw_event() · b88a2595
      Stephen Boyd 提交于
      Fix constraint check in armpmu_map_hw_event().
      Reported-and-tested-by: NVince Weaver <vincent.weaver@maine.edu>
      Cc: <stable@kernel.org>
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b88a2595
    • S
      ARM: 7810/1: perf: Fix array out of bounds access in armpmu_map_hw_event() · d9f96635
      Stephen Boyd 提交于
      Vince Weaver reports an oops in the ARM perf event code while
      running his perf_fuzzer tool on a pandaboard running v3.11-rc4.
      
      Unable to handle kernel paging request at virtual address 73fd14cc
      pgd = eca6c000
      [73fd14cc] *pgd=00000000
      Internal error: Oops: 5 [#1] SMP ARM
      Modules linked in: snd_soc_omap_hdmi omapdss snd_soc_omap_abe_twl6040 snd_soc_twl6040 snd_soc_omap snd_soc_omap_hdmi_card snd_soc_omap_mcpdm snd_soc_omap_mcbsp snd_soc_core snd_compress regmap_spi snd_pcm snd_page_alloc snd_timer snd soundcore
      CPU: 1 PID: 2790 Comm: perf_fuzzer Not tainted 3.11.0-rc4 #6
      task: eddcab80 ti: ed892000 task.ti: ed892000
      PC is at armpmu_map_event+0x20/0x88
      LR is at armpmu_event_init+0x38/0x280
      pc : [<c001c3e4>]    lr : [<c001c17c>]    psr: 60000013
      sp : ed893e40  ip : ecececec  fp : edfaec00
      r10: 00000000  r9 : 00000000  r8 : ed8c3ac0
      r7 : ed8c3b5c  r6 : edfaec00  r5 : 00000000  r4 : 00000000
      r3 : 000000ff  r2 : c0496144  r1 : c049611c  r0 : edfaec00
      Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
      Control: 10c5387d  Table: aca6c04a  DAC: 00000015
      Process perf_fuzzer (pid: 2790, stack limit = 0xed892240)
      Stack: (0xed893e40 to 0xed894000)
      3e40: 00000800 c001c17c 00000002 c008a748 00000001 00000000 00000000 c00bf078
      3e60: 00000000 edfaee50 00000000 00000000 00000000 edfaec00 ed8c3ac0 edfaec00
      3e80: 00000000 c073ffac ed893f20 c00bf180 00000001 00000000 c00bf078 ed893f20
      3ea0: 00000000 ed8c3ac0 00000000 00000000 00000000 c0cb0818 eddcab80 c00bf440
      3ec0: ed893f20 00000000 eddcab80 eca76800 00000000 eca76800 00000000 00000000
      3ee0: 00000000 ec984c80 eddcab80 c00bfe68 00000000 00000000 00000000 00000080
      3f00: 00000000 ed892000 00000000 ed892030 00000004 ecc7e3c8 ecc7e3c8 00000000
      3f20: 00000000 00000048 ecececec 00000000 00000000 00000000 00000000 00000000
      3f40: 00000000 00000000 00297810 00000000 00000000 00000000 00000000 00000000
      3f60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
      3f80: 00000002 00000002 000103a4 00000002 0000016c c00128e8 ed892000 00000000
      3fa0: 00090998 c0012700 00000002 000103a4 00090ab8 00000000 00000000 0000000f
      3fc0: 00000002 000103a4 00000002 0000016c 00090ab0 00090ab8 000107a0 00090998
      3fe0: bed92be0 bed92bd0 0000b785 b6e8f6d0 40000010 00090ab8 00000000 00000000
      [<c001c3e4>] (armpmu_map_event+0x20/0x88) from [<c001c17c>] (armpmu_event_init+0x38/0x280)
      [<c001c17c>] (armpmu_event_init+0x38/0x280) from [<c00bf180>] (perf_init_event+0x108/0x180)
      [<c00bf180>] (perf_init_event+0x108/0x180) from [<c00bf440>] (perf_event_alloc+0x248/0x40c)
      [<c00bf440>] (perf_event_alloc+0x248/0x40c) from [<c00bfe68>] (SyS_perf_event_open+0x4f4/0x8fc)
      [<c00bfe68>] (SyS_perf_event_open+0x4f4/0x8fc) from [<c0012700>] (ret_fast_syscall+0x0/0x48)
      Code: 0a000005 e3540004 0a000016 e3540000 (0791010c)
      
      This is because event->attr.config in armpmu_event_init()
      contains a very large number copied directly from userspace and
      is never checked against the size of the array indexed in
      armpmu_map_hw_event(). Fix the problem by checking the value of
      config before indexing the array and rejecting invalid config
      values.
      Reported-by: NVince Weaver <vincent.weaver@maine.edu>
      Tested-by: NVince Weaver <vincent.weaver@maine.edu>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      d9f96635
    • W
      ARM: 7809/1: perf: fix event validation for software group leaders · c95eb318
      Will Deacon 提交于
      It is possible to construct an event group with a software event as a
      group leader and then subsequently add a hardware event to the group.
      This results in the event group being validated by adding all members
      of the group to a fake PMU and attempting to allocate each event on
      their respective PMU.
      
      Unfortunately, for software events wthout a corresponding arm_pmu, this
      results in a kernel crash attempting to dereference the ->get_event_idx
      function pointer.
      
      This patch fixes the problem by checking explicitly for software events
      and ignoring those in event validation (since they can always be
      scheduled). We will probably want to revisit this for 3.12, since the
      validation checks don't appear to work correctly when dealing with
      multiple hardware PMUs anyway.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: NVince Weaver <vincent.weaver@maine.edu>
      Tested-by: NVince Weaver <vincent.weaver@maine.edu>
      Tested-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      c95eb318
  5. 24 6月, 2013 1 次提交
  6. 17 4月, 2013 1 次提交
  7. 07 3月, 2013 1 次提交
  8. 04 3月, 2013 1 次提交
  9. 19 1月, 2013 1 次提交
  10. 18 1月, 2013 1 次提交
    • M
      ARM: perf: remove unnecessary checks for idx < 0 · 8f3b90b5
      Mark Rutland 提交于
      We currently check for hwx->idx < 0 in armpmu_read and armpmu_del
      unnecessarily. The only case where hwc->idx < 0 is when armpmu_add
      fails, in which case the event's state is set to
      PERF_EVENT_STATE_INACTIVE.
      
      The perf core will not attempt to read from an event in
      PERF_EVENT_STATE_INACTIVE, and so the check in armpmu_read is
      unnecessary. Similarly, if perf core cannot add an event it will not
      attempt to delete it, so the WARN_ON in armpmu_del is unnecessary.
      
      This patch removes these two redundant checks.
      Signed-off-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      8f3b90b5
  11. 09 11月, 2012 4 次提交
    • J
      ARM: PMU: fix runtime PM enable · 2ac29a14
      Jon Hunter 提交于
      Commit 7be2958e (ARM: PMU: Add runtime PM Support) updated the ARM PMU code to
      use runtime PM which was prototyped and validated on the OMAP devices. In this
      commit, there is no call pm_runtime_enable() and for OMAP devices
      pm_runtime_enable() is currently being called from the OMAP PMU code when the
      PMU device is created. However, there are two problems with this:
      
      1. For any other ARM device wishing to use runtime PM for PMU they will need
         to call pm_runtime_enable() for runtime PM to work.
      2. When booting with device-tree and using device-tree to create the PMU
         device, pm_runtime_enable() needs to be called from within the ARM PERF
         driver as we are no longer calling any device specific code to create the
         device. Hence, PMU does not work on OMAP devices that use the runtime PM
         callbacks when using device-tree to create the PMU device.
      
      Therefore,  call pm_runtime_enable() directly from the ARM PMU driver when
      registering the device. For platforms that do not use runtime PM,
      pm_runtime_enable() does nothing and for platforms that do use runtime PM but
      may not require it specifically for PMU, this will just add a little overhead
      when initialising and uninitialising the PMU device.
      
      Tested with PERF on OMAP2420, OMAP3430 and OMAP4460.
      Acked-by: NKevin Hilman <khilman@ti.com>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      2ac29a14
    • W
      ARM: perf: consistently use arm_pmu->name for PMU name · 0305230a
      Will Deacon 提交于
      Perf has three ways to name a PMU: either by passing an explicit char *,
      reading arm_pmu->name or accessing arm_pmu->pmu.name.
      
      Just use arm_pmu->name consistently in the ARM backend.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      0305230a
    • S
      ARM: perf: consistently use struct perf_event in arm_pmu functions · ed6f2a52
      Sudeep KarkadaNagesha 提交于
      The arm_pmu functions have wildly varied parameters which can often be
      derived from struct perf_event.
      
      This patch changes the arm_pmu function prototypes so that struct
      perf_event pointers are passed in preference to fields that can be
      derived from the event.
      Signed-off-by: NSudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      ed6f2a52
    • M
      ARM: perf: add guest vs host discrimination · e50c5418
      Marc Zyngier 提交于
      Add minimal guest support to perf, so it can distinguish whether
      the PMU interrupt was in the host or the guest, as well as collecting
      some very basic information (guest PC, user vs kernel mode).
      
      This is not feature complete though, as it doesn't support backtracing
      in the guest.
      
      Based on the x86 implementation, tested with KVM/ARM.
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      e50c5418
  12. 18 10月, 2012 1 次提交
  13. 23 8月, 2012 8 次提交
    • S
      ARM: perf: move irq registration into pmu implementation · 051f1b13
      Sudeep KarkadaNagesha 提交于
      This patch moves the CPU-specific IRQ registration and parsing code into
      the CPU PMU backend. This is required because a PMU may have more than
      one interrupt, which in turn can be either PPI (per-cpu) or SPI
      (requiring strict affinity setting at the interrupt distributor).
      Signed-off-by: NSudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
      [will: cosmetic edits and reworked interrupt dispatching]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      051f1b13
    • W
      ARM: perf: move CPU-specific PMU handling code into separate file · 5505b206
      Will Deacon 提交于
      This patch moves the CPU-specific PMU handling code out of perf_event.c
      and into perf_event_cpu.c.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      5505b206
    • W
      ARM: perf: prepare for moving CPU PMU code into separate file · 6dbc0029
      Will Deacon 提交于
      The CPU PMU code is tightly coupled with generic ARM PMU handling code.
      This makes it cumbersome when trying to add support for other ARM PMUs
      (e.g. interconnect, L2 cache controller, bus) as the generic parts of
      the code are not readily reusable.
      
      This patch cleans up perf_event.c so that reusable code is exposed via
      header files to other potential PMU drivers. The CPU code is
      consistently named to identify it as such and also to prepare for moving
      it into a separate file.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      6dbc0029
    • W
      ARM: perf: probe devicetree in preference to current CPU · 04236f9f
      Will Deacon 提交于
      The CPU PMU is probed using the current cpuid information as part of the
      early_initcall initialising the architecture perf backend. For
      architectures without NMI (such as ARM), this does not need to be
      performed early and can be deferred to the driver probe callback. This
      also allows us to probe the devicetree in preference to parsing the
      current cpuid, which may be invalid on a big.LITTLE multi-cluster
      system.
      
      This patch defers the PMU probing and uses the devicetree information
      when available.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      04236f9f
    • W
      ARM: perf: remove mysterious compiler barrier · 9f44f9a2
      Will Deacon 提交于
      There's a rather strange compiler barrier in the PMU disabling code
      which was presumably placed there by aliens. There's no valid reason for
      the barrier and one can only suspect that it's up to no good.
      
      This patch removes it before it has a chance to spread.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      9f44f9a2
    • W
      ARM: pmu: remove unused reservation mechanism · f0d1bc47
      Will Deacon 提交于
      The PMU reservation mechanism was originally intended to allow OProfile
      and perf-events to co-ordinate over access to the CPU PMU. Since then,
      OProfile for ARM has moved to using perf as its backend, so the
      reservation code is no longer used.
      
      This patch removes the reservation code for the CPU PMU on ARM.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      f0d1bc47
    • W
      ARM: perf: add devicetree bindings for 11MPcore, A5, A7 and A15 PMUs · 50243efd
      Will Deacon 提交于
      This patch adds separate devicetree bindings for 11MPcore and
      Cortex-{A5,A7,A15} PMUs in preparation for improved devicetree parsing
      in the ARM perf-event CPU PMU driver.
      
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Acked-by: NRob Herring <rob.herring@calxeda.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      50243efd
    • J
      ARM: PMU: Add runtime PM Support · 7be2958e
      Jon Hunter 提交于
      Add runtime PM support to the ARM PMU driver so that devices such as OMAP
      supporting dynamic PM can use the platform->runtime_* hooks to initialise
      hardware at runtime. Without having these runtime PM hooks in place any
      configuration of the PMU hardware would be lost when low power states are
      entered and hence would prevent PMU from working.
      
      This change also replaces the PMU platform functions enable_irq and disable_irq
      added by Ming Lei with runtime_resume and runtime_suspend funtions. Ming had
      added the enable_irq and disable_irq functions as a method to configure the
      cross trigger interface on OMAP4 for routing the PMU interrupts. By adding
      runtime PM support, we can move the code called by enable_irq and disable_irq
      into the runtime PM callbacks runtime_resume and runtime_suspend.
      
      Cc: Ming Lei <ming.lei@canonical.com>
      Cc: Benoit Cousson <b-cousson@ti.com>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Signed-off-by: NJon Hunter <jon-hunter@ti.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      7be2958e
  14. 10 7月, 2012 1 次提交
    • W
      ARM: 7448/1: perf: remove arm_perf_pmu_ids global enumeration · 4295b898
      Will Deacon 提交于
      In order to provide PMU name strings compatible with the OProfile
      user ABI, an enumeration of all PMUs is currently used by perf to
      identify each PMU uniquely. Unfortunately, this does not scale well
      in the presence of multiple PMUs and creates a single, global namespace
      across all PMUs in the system.
      
      This patch removes the enumeration and instead uses the name string
      for the PMU to map onto the OProfile variant. perf_pmu_name is
      implemented for CPU PMUs, which is all that OProfile cares about anyway.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      4295b898
  15. 05 7月, 2012 1 次提交
  16. 24 3月, 2012 1 次提交
  17. 07 3月, 2012 2 次提交
  18. 05 3月, 2012 1 次提交
  19. 06 12月, 2011 1 次提交
  20. 02 12月, 2011 2 次提交
  21. 23 11月, 2011 1 次提交
  22. 17 11月, 2011 1 次提交
    • W
      ARM: perf: initialise used_mask for fake PMU during validation · bce34d14
      Will Deacon 提交于
      When validating an event group, we call pmu->get_event_idx for each
      group member in order to check that the group can be scheduled as a
      unit on an empty PMU.
      
      As a result of 3fc2c830 ("ARM: perf: remove event limit from
      pmu_hw_events"), the used_mask member of struct cpu_hw_events must be
      setup explicitly, something which we don't do for the fake cpu_hw_events
      used for validation.
      
      This patch sets up an empty used_mask for the fake validation
      cpu_hw_events, preventing NULL deferences when trying to get the event
      index.
      Reported-by: NPawel Moll <pawel.moll@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      bce34d14
  23. 14 11月, 2011 1 次提交
  24. 01 11月, 2011 1 次提交
    • P
      arm: convert core files from module.h to export.h · ecea4ab6
      Paul Gortmaker 提交于
      Many of the core ARM kernel files are not modules, but just
      including module.h for exporting symbols.  Now these files can
      use the lighter footprint export.h for this role.
      
      There are probably lots more, but ARM files of mach-* and plat-*
      don't get coverage via a simple yesconfig build.  They will have
      to be cleaned up and tested via using their respective configs.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      ecea4ab6
  25. 31 8月, 2011 2 次提交