]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: arm64: Enable Address Authentication at EL2 if available
authorMarc Zyngier <maz@kernel.org>
Thu, 11 Jun 2020 10:54:01 +0000 (11:54 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 22 Jun 2020 10:42:41 +0000 (11:42 +0100)
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>
arch/arm64/kvm/hyp-init.S

index 6e6ed5581eed157220a1b1ffcd660da21f38d62e..1587d146726abae1dff01b4ea3fc38a9ce9189eb 100644 (file)
@@ -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