Skip to content
Commit b8e9ecd3 authored by Rob Herring's avatar Rob Herring Committed by Ruiqiang Hao
Browse files

perf: Add a counter for number of user access events in context



commit 82ff0c02 upstream

On arm64, user space counter access will be controlled differently
compared to x86. On x86, access in the strictest mode is enabled for all
tasks in an MM when any event is mmap'ed. For arm64, access is
explicitly requested for an event and only enabled when the event's
context is active. This avoids hooks into the arch context switch code
and gives better control of when access is enabled.

In order to configure user space access when the PMU is enabled, it is
necessary to know if any event (currently active or not) in the current
context has user space accessed enabled. Add a counter similar to other
counters in the context to avoid walking the event list every time.

Reviewed-by: default avatarMark Rutland <mark.rutland@arm.com>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20211208201124.310740-3-robh@kernel.org


Signed-off-by: default avatarWill Deacon <will@kernel.org>
[AZ: backport of 82ff0c02 from master branch of linux-mainline]
Signed-off-by: default avatarAdrian Zaharia <Adrian.Zaharia@windriver.com>
Signed-off-by: default avatarRuiqiang Hao <Ruiqiang.Hao@windriver.com>
parent 83995534
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment