powerpc/fsl: Flush the branch predictor at each kernel entry (64bit)
authorDiana Craciun <diana.craciun@nxp.com>
Fri, 29 Mar 2019 11:26:13 +0000 (22:26 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:26:20 +0000 (06:26 +0200)
commitcf72dad924cb98773cd21c22cc06f484fd522db9
treec5c760ddb7fcefd8b5123b6a72374d3c3fd9e978
parent020e5f13805b4a35c9394fbe55508311453fdbc8
powerpc/fsl: Flush the branch predictor at each kernel entry (64bit)

commit 10c5e83afd4a3f01712d97d3bb1ae34d5b74a185 upstream.

In order to protect against speculation attacks on
indirect branches, the branch predictor is flushed at
kernel entry to protect for the following situations:
- userspace process attacking another userspace process
- userspace process attacking the kernel
Basically when the privillege level change (i.e. the
kernel is entered), the branch predictor state is flushed.

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/kernel/entry_64.S
arch/powerpc/kernel/exceptions-64e.S
arch/powerpc/mm/tlb_low_64e.S