OSDN Git Service

powerpc/fsl: Add infrastructure to fixup branch predictor flush
authorDiana Craciun <diana.craciun@nxp.com>
Sun, 21 Apr 2019 14:20:30 +0000 (00:20 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 May 2019 17:44:50 +0000 (19:44 +0200)
commit526adfdf029e63d7f3973d99a1f27b5af2ce6c62
treec1c09880d794d2db5e3b90c0c17b22ca34eff447
parent7fe905d0973eee071ebc4861cd6d23138116cd9e
powerpc/fsl: Add infrastructure to fixup branch predictor flush

commit 76a5eaa38b15dda92cd6964248c39b5a6f3a4e9d upstream.

In order to protect against speculation attacks (Spectre
variant 2) on NXP PowerPC platforms, the branch predictor
should be flushed when the privillege level is changed.
This patch is adding the infrastructure to fixup at runtime
the code sections that are performing the branch predictor flush
depending on a boot arg parameter which is added later in a
separate patch.

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/include/asm/feature-fixups.h
arch/powerpc/include/asm/setup.h
arch/powerpc/kernel/vmlinux.lds.S
arch/powerpc/lib/feature-fixups.c