summaryrefslogtreecommitdiff
path: root/arch/arm64/kvm/hyp-init.S
diff options
context:
space:
mode:
authorPranavkumar Sawargaonkar <pranavkumar@linaro.org>2014-07-31 12:23:23 +0530
committerChristoffer Dall <christoffer.dall@linaro.org>2014-08-29 11:53:26 +0200
commitf6edbbf36da3a27b298b66c7955fc84e1dcca305 (patch)
treeb139fa1469a73dd1e7082aba203d08509101ca2c /arch/arm64/kvm/hyp-init.S
parent30d1e0e806e5b2fadc297ba78f2d7afd6ba309cf (diff)
ARM/ARM64: KVM: Nuke Hyp-mode tlbs before enabling MMU
X-Gene u-boot runs in EL2 mode with MMU enabled hence we might have stale EL2 tlb enteris when we enable EL2 MMU on each host CPU. This can happen on any ARM/ARM64 board running bootloader in Hyp-mode (or EL2-mode) with MMU enabled. This patch ensures that we flush all Hyp-mode (or EL2-mode) TLBs on each host CPU before enabling Hyp-mode (or EL2-mode) MMU. Cc: <stable@vger.kernel.org> Tested-by: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar@linaro.org> Signed-off-by: Anup Patel <anup.patel@linaro.org> Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm64/kvm/hyp-init.S')
-rw-r--r--arch/arm64/kvm/hyp-init.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm64/kvm/hyp-init.S b/arch/arm64/kvm/hyp-init.S
index d968796f4b2d..c3191168a994 100644
--- a/arch/arm64/kvm/hyp-init.S
+++ b/arch/arm64/kvm/hyp-init.S
@@ -80,6 +80,10 @@ __do_hyp_init:
msr mair_el2, x4
isb
+ /* Invalidate the stale TLBs from Bootloader */
+ tlbi alle2
+ dsb sy
+
mrs x4, sctlr_el2
and x4, x4, #SCTLR_EL2_EE // preserve endianness of EL2
ldr x5, =SCTLR_EL2_FLAGS