<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arm/kernel/perf_event.c, branch linux-3.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2014-08-05T09:27:25Z</updated>
<entry>
<title>Merge branch 'devel-stable' into for-next</title>
<updated>2014-08-05T09:27:25Z</updated>
<author>
<name>Russell King</name>
</author>
<published>2014-08-05T09:27:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f15bdfe4fb264ac30d9c176f898cbd52cfd1ffa9'/>
<id>urn:sha1:f15bdfe4fb264ac30d9c176f898cbd52cfd1ffa9</id>
<content type='text'>
Conflicts:
	arch/arm/kernel/perf_event_cpu.c
</content>
</entry>
<entry>
<title>ARM: 8071/1: perf: Make perf use arm_get_current_stackframe</title>
<updated>2014-07-18T11:29:12Z</updated>
<author>
<name>Nikolay Borisov</name>
</author>
<published>2014-06-03T18:48:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6888e32a9e0b284c4dcdefcc3158949110699bc2'/>
<id>urn:sha1:6888e32a9e0b284c4dcdefcc3158949110699bc2</id>
<content type='text'>
Make the perf backend use the API so that it correctly references the FP
when in THUMB2 mode

Signed-off-by: Nikolay Borisov &lt;Nikolay.Borisov@arm.com&gt;
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>ARM: perf: disable the pagefault handler when reading from user space</title>
<updated>2014-07-09T14:05:29Z</updated>
<author>
<name>Jean Pihet</name>
</author>
<published>2014-07-07T13:45:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4b2974fa6a4a32d390a50e23381a2270a2e0d444'/>
<id>urn:sha1:4b2974fa6a4a32d390a50e23381a2270a2e0d444</id>
<content type='text'>
Under perf, the fp unwinding scheme requires access to user space memory
and can provoke a pagefault via call to __copy_from_user_inatomic from
user_backtrace. This unwinding can take place in response to an interrupt
(__perf_event_overflow). This is undesirable as we may already have
mmap_sem held for write. One example being a process that calls mprotect
just as a the PMU counters overflow.

An example that can provoke this behaviour:
perf record -e event:tocapture --call-graph fp ./application_to_test

This patch addresses this issue by disabling pagefaults briefly in
user_backtrace (as is done in the other architectures: ARM64, x86, Sparc etc.).

Without the patch a deadlock occurs when __perf_event_overflow is called
while reading the data from the user space:

 [ INFO: possible recursive locking detected ]
 3.16.0-rc2-00038-g0ed7ff6 #46 Not tainted
 ---------------------------------------------
 stress/1634 is trying to acquire lock:
 (&amp;mm-&gt;mmap_sem){++++++}, at: [&lt;c001dc04&gt;] do_page_fault+0xa8/0x428

 but task is already holding lock:
 (&amp;mm-&gt;mmap_sem){++++++}, at: [&lt;c00f4098&gt;] SyS_mprotect+0xa8/0x1c8

 other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&amp;mm-&gt;mmap_sem);
  lock(&amp;mm-&gt;mmap_sem);

 *** DEADLOCK ***

 May be due to missing lock nesting notation

 2 locks held by stress/1634:
 #0:  (&amp;mm-&gt;mmap_sem){++++++}, at: [&lt;c00f4098&gt;] SyS_mprotect+0xa8/0x1c8
 #1:  (rcu_read_lock){......}, at: [&lt;c00c29dc&gt;] __perf_event_overflow+0x120/0x294

 stack backtrace:
 CPU: 1 PID: 1634 Comm: stress Not tainted 3.16.0-rc2-00038-g0ed7ff6 #46
 [&lt;c0017c8c&gt;] (unwind_backtrace) from [&lt;c0012eec&gt;] (show_stack+0x20/0x24)
 [&lt;c0012eec&gt;] (show_stack) from [&lt;c04de914&gt;] (dump_stack+0x7c/0x98)
 [&lt;c04de914&gt;] (dump_stack) from [&lt;c006a360&gt;] (__lock_acquire+0x1484/0x1cf0)
 [&lt;c006a360&gt;] (__lock_acquire) from [&lt;c006b14c&gt;] (lock_acquire+0xa4/0x11c)
 [&lt;c006b14c&gt;] (lock_acquire) from [&lt;c04e3880&gt;] (down_read+0x40/0x7c)
 [&lt;c04e3880&gt;] (down_read) from [&lt;c001dc04&gt;] (do_page_fault+0xa8/0x428)
 [&lt;c001dc04&gt;] (do_page_fault) from [&lt;c00084ec&gt;] (do_DataAbort+0x44/0xa8)
 [&lt;c00084ec&gt;] (do_DataAbort) from [&lt;c0013a1c&gt;] (__dabt_svc+0x3c/0x60)
 Exception stack(0xed7c5ae0 to 0xed7c5b28)
 5ae0: ed7c5b5c b6dadff4 ffffffec 00000000 b6dadff4 ebc08000 00000000 ebc08000
 5b00: 0000007e 00000000 ed7c4000 ed7c5b94 00000014 ed7c5b2c c001a438 c0236c60
 5b20: 00000013 ffffffff
 [&lt;c0013a1c&gt;] (__dabt_svc) from [&lt;c0236c60&gt;] (__copy_from_user+0xa4/0x3a4)

Acked-by: Steve Capper &lt;steve.capper@linaro.org&gt;
Signed-off-by: Jean Pihet &lt;jean.pihet@linaro.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: perf: Check that current-&gt;mm is alive before getting user callchain</title>
<updated>2014-07-09T14:05:24Z</updated>
<author>
<name>Jean Pihet</name>
</author>
<published>2014-07-07T13:45:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a7cc91001e36a4a4152c3ada6c8fe38adc5badbc'/>
<id>urn:sha1:a7cc91001e36a4a4152c3ada6c8fe38adc5badbc</id>
<content type='text'>
An event may occur when an mm is already released.

As per commit 20afc60f892d285fde179ead4b24e6a7938c2f1b
 'x86, perf: Check that current-&gt;mm is alive before getting user callchain'

Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Jean Pihet &lt;jean.pihet@linaro.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>perf/ARM: Use common PMU interrupt disabled code</title>
<updated>2014-06-05T10:30:00Z</updated>
<author>
<name>Vince Weaver</name>
</author>
<published>2014-05-16T21:15:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=edcb4d3c36a6429caa03ddfeab4cbb153c7002b2'/>
<id>urn:sha1:edcb4d3c36a6429caa03ddfeab4cbb153c7002b2</id>
<content type='text'>
Make the ARM perf code use the new common PMU interrupt disabled code.

This allows perf to work on ARM machines without a working PMU
interrupt (for example, raspberry pi).

Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Vince Weaver &lt;vincent.weaver@maine.edu&gt;
[peterz: applied changes suggested by Will]
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Grant Likely &lt;grant.likely@linaro.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Rob Herring &lt;robh+dt@kernel.org&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Cc: Will Deacon &lt;will.deacon@arm.com&gt;
Cc: devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1405161712190.11099@vincent-weaver-1.umelst.maine.edu
[ Small readability tweaks to the code. ]
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;

Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARM: perf: hook up perf_sample_event_took around pmu irq handling</title>
<updated>2014-02-21T11:11:21Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2014-02-11T18:08:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5f5092e72cc25a6a5785308270e0085b2b2772cc'/>
<id>urn:sha1:5f5092e72cc25a6a5785308270e0085b2b2772cc</id>
<content type='text'>
Since we indirect all of our PMU IRQ handling through a dispatcher, it's
trivial to hook up perf_sample_event_took to prevent applications such
as oprofile from generating interrupt storms due to an unrealisticly
low sample period.

Reported-by: Robert Richter &lt;rric@kernel.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: perf: add hook for event index clearing</title>
<updated>2014-02-21T11:11:08Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2014-02-07T21:01:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eab443ef391d18772710dc2c156f7ee05e51f754'/>
<id>urn:sha1:eab443ef391d18772710dc2c156f7ee05e51f754</id>
<content type='text'>
On Krait processors we have a many-to-one relationship between
raw CPU events and the event programmed into the PMNx counter.
Two raw CPU events could map to the same value programmed in the
PMNx counter. To avoid this problem, we check for collisions
during the get_event_idx() callback by setting a bit in a bitmap
whenever a certain event is used in a PMNx counter (see the next
patch). Unfortunately, we don't have a hook to clear this bit in
the bitmap when the event is deleted so let's add an optional
clear_event_idx() callback for this purpose.

Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>ARM: perf: support percpu irqs for the CPU PMU</title>
<updated>2014-02-21T11:10:44Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2014-02-07T21:01:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bbd64559376fa25732994c4181c8ec493fa57871'/>
<id>urn:sha1:bbd64559376fa25732994c4181c8ec493fa57871</id>
<content type='text'>
Some CPU PMUs are wired up with one PPI for all the CPUs instead
of with a different SPI for each CPU. Add support for these
devices.

Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
<entry>
<title>Revert "ARM: 7556/1: perf: fix updated event period in response to PERF_EVENT_IOC_PERIOD"</title>
<updated>2013-12-17T14:21:35Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2013-11-27T13:54:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9450d14fb959336803e5209119eb422b667b96aa'/>
<id>urn:sha1:9450d14fb959336803e5209119eb422b667b96aa</id>
<content type='text'>
This reverts commit 3581fe0ef37ce12ac7a4f74831168352ae848edc.

Fixes to the handling of PERF_EVENT_IOC_PERIOD in the core code mean
we no longer have to play this horrible game.

Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/1385560479-11014-2-git-send-email-will.deacon@arm.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARM: perf: fix group validation for mixed software and hardware groups</title>
<updated>2013-10-09T13:33:07Z</updated>
<author>
<name>Will Deacon</name>
</author>
<published>2013-10-09T12:51:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2dfcb802d6bd54a2353678c6434846d94b058f2c'/>
<id>urn:sha1:2dfcb802d6bd54a2353678c6434846d94b058f2c</id>
<content type='text'>
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 7b9f72c62ed0 ("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: Mark Rutland &lt;mark.rutland@arm.com&gt;
Signed-off-by: Will Deacon &lt;will.deacon@arm.com&gt;
</content>
</entry>
</feed>
