powerpc/fsl: Enable runtime patching if nospectre_v2 boot arg is used
authorDiana Craciun <diana.craciun@nxp.com>
Fri, 29 Mar 2019 11:26:16 +0000 (22:26 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:25:14 +0000 (06:25 +0200)
commit 3bc8ea8603ae4c1e09aca8de229ad38b8091fcb3 upstream.

If the user choses not to use the mitigations, replace
the code sequence with nops.

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/setup-common.c

index ab7a75b731daa47d418ae0144f3552cfc8067155..c58364c74dad3617f29b5a53de307146e30ad721 100644 (file)
@@ -938,6 +938,7 @@ void __init setup_arch(char **cmdline_p)
                ppc_md.setup_arch();
 
        setup_barrier_nospec();
+       setup_spectre_v2();
 
        paging_init();