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>
Tue, 25 Sep 2018 18:09:18 +0000 (20:09 +0200)
commitb860801e3237ec4c74cf8de0be4816996757ae5c
treee80b40f0c22c108f1afeaaf1243e129c6ccec6aa
parentd4989fe88603367e5998af70ee638ae6790d42d1
coresight: etm4x: Configure EL2 exception level when kernel is running in HYP

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>
drivers/hwtracing/coresight/coresight-etm4x.c