AArch64: Disable Secure Cycle Counter
authorAlexei Fedorov <Alexei.Fedorov@arm.com>
Tue, 13 Aug 2019 14:17:53 +0000 (15:17 +0100)
committerAlexei Fedorov <Alexei.Fedorov@arm.com>
Wed, 21 Aug 2019 14:43:24 +0000 (15:43 +0100)
commite290a8fcbc836d51566da1607add8a320d0f1a20
tree568a10c4c8e732fed313c612e275a25d1b8f5b58
parent5119fa7b8d674d8ae6466836c0687433f8e1694d
AArch64: Disable Secure Cycle Counter

This patch fixes an issue when secure world timing information
can be leaked because Secure Cycle Counter is not disabled.
For ARMv8.5 the counter gets disabled by setting MDCR_El3.SCCD
bit on CPU cold/warm boot.
For the earlier architectures PMCR_EL0 register is saved/restored
on secure world entry/exit from/to Non-secure state, and cycle
counting gets disabled by setting PMCR_EL0.DP bit.
'include\aarch64\arch.h' header file was tided up and new
ARMv8.5-PMU related definitions were added.

Change-Id: I6f56db6bc77504634a352388990ad925a69ebbfa
Signed-off-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
bl1/aarch64/bl1_exceptions.S
bl31/aarch64/ea_delegate.S
bl31/aarch64/runtime_exceptions.S
include/arch/aarch64/arch.h
include/arch/aarch64/el3_common_macros.S
include/lib/el3_runtime/aarch64/context.h
lib/el3_runtime/aarch64/context.S
lib/el3_runtime/aarch64/context_mgmt.c