aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Marinho <jose.marinho@arm.com>2019-11-08 14:42:16 +0000
committerOlivier Deprez <olivier.deprez@arm.com>2020-07-22 15:38:20 +0000
commitcc071f181d296ec08f7367ec99a3cfdde03ba593 (patch)
treeaa7bd8cb75147ea74768161142320e23d302028d
parent815fd951e644bd7fa81454156644521422ecb7e0 (diff)
downloadhafnium-cc071f181d296ec08f7367ec99a3cfdde03ba593.tar.gz
cpu: prevent LOR regions disabling in S-EL2
Hafnium disables LOR regions in NWd. Writing to LORC_EL1 from SWd is not allowed and generates an undef exception. Change-Id: Id2df27e5d5516d831122e48a8c5f034f224176e8 Signed-off-by: Jose Marinho <jose.marinho@arm.com> Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
-rw-r--r--src/arch/aarch64/hypervisor/cpu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/arch/aarch64/hypervisor/cpu.c b/src/arch/aarch64/hypervisor/cpu.c
index e8048c3..4024803 100644
--- a/src/arch/aarch64/hypervisor/cpu.c
+++ b/src/arch/aarch64/hypervisor/cpu.c
@@ -31,12 +31,14 @@
static void lor_disable(void)
{
+#if SECURE_WORLD == 0
/*
* Accesses to LORC_EL1 are undefined if LORegions are not supported.
*/
if (read_msr(ID_AA64MMFR1_EL1) & ID_AA64MMFR1_EL1_LO) {
write_msr(MSR_LORC_EL1, 0);
}
+#endif
}
static void gic_regs_reset(struct arch_regs *r, bool is_primary)