summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm
diff options
context:
space:
mode:
authorDiana Craciun <diana.craciun@nxp.com>2018-12-12 16:03:07 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2018-12-20 22:59:03 +1100
commite7aa61f47b23afbec41031bc47ca8d6cb6516abc (patch)
treefba9a1be4ce7035803f8833bda349a2a9518781b /arch/powerpc/kvm
parent7fef436295bf6c05effe682c8797dfcb0deb112a (diff)
downloadtalos-obmc-linux-e7aa61f47b23afbec41031bc47ca8d6cb6516abc.tar.gz
talos-obmc-linux-e7aa61f47b23afbec41031bc47ca8d6cb6516abc.zip
powerpc/fsl: Flush branch predictor when entering KVM
Switching from the guest to host is another place where the speculative accesses can be exploited. Flush the branch predictor when entering KVM. Signed-off-by: Diana Craciun <diana.craciun@nxp.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r--arch/powerpc/kvm/bookehv_interrupts.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/bookehv_interrupts.S b/arch/powerpc/kvm/bookehv_interrupts.S
index 051af7d97327..4e5081e58409 100644
--- a/arch/powerpc/kvm/bookehv_interrupts.S
+++ b/arch/powerpc/kvm/bookehv_interrupts.S
@@ -75,6 +75,10 @@
PPC_LL r1, VCPU_HOST_STACK(r4)
PPC_LL r2, HOST_R2(r1)
+START_BTB_FLUSH_SECTION
+ BTB_FLUSH(r10)
+END_BTB_FLUSH_SECTION
+
mfspr r10, SPRN_PID
lwz r8, VCPU_HOST_PID(r4)
PPC_LL r11, VCPU_SHARED(r4)
OpenPOWER on IntegriCloud