arm64: KVM: Handle ARM erratum 1165522 in TLB invalidation
authorMarc Zyngier <marc.zyngier@arm.com>
Thu, 6 Dec 2018 17:31:25 +0000 (17:31 +0000)
committerWill Deacon <will.deacon@arm.com>
Mon, 10 Dec 2018 12:20:42 +0000 (12:20 +0000)
commiteb036ad2ddf008309ea25e34470898c8cd122f6b
tree6b9abe02821fd11504394c7708ab021e7cc23a3f
parent1e4448c5ddbe93ab6070160f094f49e7c95477e6
arm64: KVM: Handle ARM erratum 1165522 in TLB invalidation

In order to avoid TLB corruption whilst invalidating TLBs on CPUs
affected by erratum 1165522, we need to prevent S1 page tables
from being usable.

For this, we set the EL1 S1 MMU on, and also disable the page table
walker (by setting the TCR_EL1.EPD* bits to 1).

This ensures that once we switch to the EL1/EL0 translation regime,
speculated AT instructions won't be able to parse the page tables.

Acked-by: Christoffer Dall <christoffer.dall@arm.com>
Reviewed-by: James Morse <james.morse@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kvm/hyp/tlb.c