FROMGIT: KVM: arm64: Use INIT_SCTLR_EL2_MMU_OFF to disable the MMU on KVM teardown

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>
(cherry picked from commit bc6ddaa67abc9345370b219d07b079d25665f868
 git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next)
Signed-off-by: Will Deacon <willdeacon@google.com>
Bug: 178098380
Test: atest VirtualizationHostTestCases on an EL2-enabled device
Change-Id: I4e2538939f1306953cdd28e2a696d659fc8479ad
This commit is contained in:
Marc Zyngier
2021-03-10 13:32:53 +00:00
committed by Quentin Perret
parent 3ff7250562
commit f47a4d91e5

View File

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