summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2020-06-11 11:54:01 +0100
committerMarc Zyngier <maz@kernel.org>2020-06-22 11:42:41 +0100
commit4a95a1b20da31db0c1ca5289a892fef21f691f27 (patch)
treefc7c44cfa0666d047c409f319aaf8386b85af182
parentb3a9e3b9622ae10064826dccb4f7a52bd88c7407 (diff)
downloadlwn-4a95a1b20da31db0c1ca5289a892fef21f691f27.tar.gz
lwn-4a95a1b20da31db0c1ca5289a892fef21f691f27.zip
KVM: arm64: Enable Address Authentication at EL2 if available
While initializing EL2, enable Address Authentication if detected from EL1. We still use the EL1-provided keys though. Acked-by: Andrew Scull <ascull@google.com> Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Marc Zyngier <maz@kernel.org>
-rw-r--r--arch/arm64/kvm/hyp-init.S5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm64/kvm/hyp-init.S b/arch/arm64/kvm/hyp-init.S
index 6e6ed5581eed..1587d146726a 100644
--- a/arch/arm64/kvm/hyp-init.S
+++ b/arch/arm64/kvm/hyp-init.S
@@ -104,6 +104,11 @@ alternative_else_nop_endif
*/
mov_q x4, (SCTLR_EL2_RES1 | (SCTLR_ELx_FLAGS & ~SCTLR_ELx_A))
CPU_BE( orr x4, x4, #SCTLR_ELx_EE)
+alternative_if ARM64_HAS_ADDRESS_AUTH
+ mov_q x5, (SCTLR_ELx_ENIA | SCTLR_ELx_ENIB | \
+ SCTLR_ELx_ENDA | SCTLR_ELx_ENDB)
+ orr x4, x4, x5
+alternative_else_nop_endif
msr sctlr_el2, x4
isb