coresight: etm4x: Configure EL2 exception level when kernel is running in HYP
authorTomasz Nowicki <tnowicki@caviumnetworks.com>
Thu, 20 Sep 2018 19:18:00 +0000 (13:18 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Nov 2019 08:52:53 +0000 (09:52 +0100)
commit6b32261826811cb53a49cc679c982c0733de3a51
tree86b69f14473d4541609a07fdf3169717f3ace86b
parente834a0f8ebb02527bf60076c4b400cd149c63318
coresight: etm4x: Configure EL2 exception level when kernel is running in HYP

[ Upstream commit b860801e3237ec4c74cf8de0be4816996757ae5c ]

For non-VHE systems host kernel runs at EL1 and jumps to EL2 whenever
hypervisor code should be executed. In this case ETM4x driver must
restrict configuration to EL1 when it setups kernel tracing.
However, there is no separate hypervisor privilege level when VHE
is enabled, the host kernel runs at EL2.

This patch fixes configuration of TRCACATRn register for VHE systems
so that ETM_EXLEVEL_NS_HYP bit is used instead of ETM_EXLEVEL_NS_OS
to on/off kernel tracing. At the same time, it moves common code
to new helper.

Signed-off-by: Tomasz Nowicki <tnowicki@caviumnetworks.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwtracing/coresight/coresight-etm4x.c