powerpc/fsl: Add infrastructure to fixup branch predictor flush
authorDiana Craciun <diana.craciun@nxp.com>
Fri, 29 Mar 2019 11:26:08 +0000 (22:26 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:26:19 +0000 (06:26 +0200)
commitd67ab3d9a1b7e4dbee0db0f133611de3a22d5517
treed21ba90bfee8aee67143fcd92a2142cfe7786e5f
parente044d21c2999d35c26cc15011e6478e2a9eaee63
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