summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/module.c
diff options
context:
space:
mode:
authorMichael Ellerman <mpe@ellerman.id.au>2018-07-28 09:06:34 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2018-08-08 00:32:23 +1000
commit179ab1cbf883575c3a585bcfc0f2160f1d22a149 (patch)
treeeead3ee74946fc0b174966ef4fcf1fa02ae8e2fc /arch/powerpc/kernel/module.c
parent6453b532f2c8856a80381e6b9a1f5ea2f12294df (diff)
powerpc/64: Add CONFIG_PPC_BARRIER_NOSPEC
Add a config symbol to encode which platforms support the barrier_nospec speculation barrier. Currently this is just Book3S 64 but we will add Book3E in a future patch. Signed-off-by: Diana Craciun <diana.craciun@nxp.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/module.c')
-rw-r--r--arch/powerpc/kernel/module.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c
index 1b3c6835e730..77371c9ef3d8 100644
--- a/arch/powerpc/kernel/module.c
+++ b/arch/powerpc/kernel/module.c
@@ -72,13 +72,15 @@ int module_finalize(const Elf_Ehdr *hdr,
do_feature_fixups(powerpc_firmware_features,
(void *)sect->sh_addr,
(void *)sect->sh_addr + sect->sh_size);
+#endif /* CONFIG_PPC64 */
+#ifdef CONFIG_PPC_BARRIER_NOSPEC
sect = find_section(hdr, sechdrs, "__spec_barrier_fixup");
if (sect != NULL)
do_barrier_nospec_fixups_range(barrier_nospec_enabled,
(void *)sect->sh_addr,
(void *)sect->sh_addr + sect->sh_size);
-#endif
+#endif /* CONFIG_PPC_BARRIER_NOSPEC */
sect = find_section(hdr, sechdrs, "__lwsync_fixup");
if (sect != NULL)