ARM: KVM: invalidate BTB on guest exit for Cortex-A12/A17
authorMarc Zyngier <marc.zyngier@arm.com>
Mon, 15 Oct 2018 15:32:05 +0000 (11:32 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Oct 2018 07:16:27 +0000 (09:16 +0200)
commit75e48eff8aae50cabc9124cb39b31ef94c713c6a
treeb33a33433faad1afb878392e8cf78bd54314cb83
parent6d75fe7ed2f69f5debc35098281516e6737a8229
ARM: KVM: invalidate BTB on guest exit for Cortex-A12/A17

Commit 3f7e8e2e1ebda787f156ce46e3f0a9ce2833fa4f upstream.

In order to avoid aliasing attacks against the branch predictor,
let's invalidate the BTB on guest exit. This is made complicated
by the fact that we cannot take a branch before invalidating the
BTB.

We only apply this to A12 and A17, which are the only two ARM
cores on which this useful.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Boot-tested-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: David A. Long <dave.long@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/include/asm/kvm_asm.h
arch/arm/include/asm/kvm_mmu.h
arch/arm/kvm/hyp/hyp-entry.S