]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: KVM: invalidate BTB on guest exit for Cortex-A12/A17
authorMarc Zyngier <marc.zyngier@arm.com>
Thu, 1 Feb 2018 11:07:35 +0000 (11:07 +0000)
committerRussell King <rmk+kernel@armlinux.org.uk>
Thu, 31 May 2018 10:09:03 +0000 (11:09 +0100)
commite70687494b45d440d8accc9fd62cc33e7c6195e0
treecb2e36e2ad4908ce0b3daf776c8857a729a0fc31
parentdb53c34370c001ce2face85c7da6bb1639bcdcec
ARM: KVM: invalidate BTB on guest exit for Cortex-A12/A17

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>
arch/arm/include/asm/kvm_asm.h
arch/arm/include/asm/kvm_mmu.h
arch/arm/kvm/hyp/hyp-entry.S