KVM: arm64: Use INIT_SCTLR_EL2_MMU_OFF to disable the MMU on KVM teardown
authorMarc Zyngier <maz@kernel.org>
Wed, 10 Mar 2021 13:32:53 +0000 (13:32 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 18 Mar 2021 15:51:56 +0000 (15:51 +0000)
Instead of doing a RMW on SCTLR_EL2 to disable the MMU, use the
existing define that loads the right set of bits.

Acked-by: Will Deacon <will@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/nvhe/hyp-init.S

index c631e29..4eb584a 100644 (file)
@@ -221,9 +221,7 @@ SYM_CODE_START(__kvm_handle_stub_hvc)
        mov     x0, xzr
 reset:
        /* Reset kvm back to the hyp stub. */
-       mrs     x5, sctlr_el2
-       mov_q   x6, SCTLR_ELx_FLAGS
-       bic     x5, x5, x6              // Clear SCTL_M and etc
+       mov_q   x5, INIT_SCTLR_EL2_MMU_OFF
        pre_disable_mmu_workaround
        msr     sctlr_el2, x5
        isb