perf: arm: enable pmuserenr [1/1]
authorHanjie Lin <hanjie.lin@amlogic.com>
Mon, 18 Feb 2019 12:03:16 +0000 (20:03 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 21 Feb 2019 02:41:56 +0000 (18:41 -0800)
commita3d9f542060aff7c81bf9e019c5f5f7e64b4e4a2
tree0e63a67f5c83a71131d11d34b836c4cc83e31274
parent56f8ec1578d3217bc2358bac02539c9bea43aed7
perf: arm: enable pmuserenr [1/1]

PD#SWPL-4673

Problem:
userspace can't access perf monitor cnt with "mrc ... c9,c13,0"

Solution:
actually userspace should check perf monitor cnt access permissions first
before use, so this is a workround.
enable pmuserenr with "mcr ... c9,c14,0" in several places:
1, perf probe
2, cpu idle (state>0) exit
3, cpu online
4, system resume after suspend

Verify:
u212

Change-Id: Ib09682d1d47545dfef8b088283ddbbf390630d3e
Signed-off-by: Hanjie Lin <hanjie.lin@amlogic.com>
arch/arm/include/asm/perf_event.h
arch/arm/kernel/cpuidle.c
arch/arm/kernel/perf_event_v7.c