]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: perf: Ignore exclude_hv when kernel is running in HYP
authorGanapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
Tue, 2 May 2017 16:29:34 +0000 (21:59 +0530)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 15 May 2017 17:30:37 +0000 (18:30 +0100)
commit2893d2524fde80b3fe1e4bfea91c787223dbdf78
tree6e38f50adf729eac3552bba63eae030b0b07cb97
parentc89846ff77af9ab6c021e02877c5ca5596fc320b
arm64: perf: Ignore exclude_hv when kernel is running in HYP

commit ea929e86c2a9 ("arm64: perf: Count EL2 events if the kernel is
running in HYP") returns -EINVAL when perf system call perf_event_open is
called with exclude_hv != exclude_kernel. This change breaks applications
on VHE enabled ARMv8.1 platforms. The issue was observed with HHVM
application, which calls perf_event_open with exclude_hv = 1 and
exclude_kernel = 0.

There is no separate hypervisor privilege level when VHE is enabled, the
host kernel runs at EL2. So when VHE is enabled, we should ignore
exclude_hv from the application. This behaviour is consistent with PowerPC
where the exclude_hv is ignored when the hypervisor is not present and with
x86 where this flag is ignored.

Signed-off-by: Ganapatrao Kulkarni <ganapatrao.kulkarni@cavium.com>
[will: added comment to justify the behaviour of exclude_hv]
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/perf_event.c