summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/Makefile
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2023-04-08 12:17:49 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2023-04-20 12:54:22 +1000
commitdc5dac748af9087e9240bd2ae6ae7db48d5360ae (patch)
tree59998f55199668c054226f3bc29fc4963fc35741 /arch/powerpc/Makefile
parentb270bebd34e36fb69363d65e24b00a9d148903e8 (diff)
downloadlinux-stable-dc5dac748af9087e9240bd2ae6ae7db48d5360ae.tar.gz
linux-stable-dc5dac748af9087e9240bd2ae6ae7db48d5360ae.tar.bz2
linux-stable-dc5dac748af9087e9240bd2ae6ae7db48d5360ae.zip
powerpc/64: Add support to build with prefixed instructions
Add an option to build kernel and module with prefixed instructions if the CPU and toolchain support it. This is not related to kernel support for userspace execution of prefixed instructions. Building with prefixed instructions breaks some extended inline asm memory addressing, for example it will provide immediates that exceed the range of simple load/store displacement. Whether this is a toolchain or a kernel asm problem remains to be seen. For now, these are replaced with simpler and less efficient direct register addressing when compiling with prefixed. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230408021752.862660-4-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/Makefile')
-rw-r--r--arch/powerpc/Makefile4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 4343cca57cb3..9fb770d3b409 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -180,7 +180,11 @@ ifdef CONFIG_476FPE_ERR46
endif
# No prefix or pcrel
+ifdef CONFIG_PPC_KERNEL_PREFIXED
+KBUILD_CFLAGS += $(call cc-option,-mprefixed)
+else
KBUILD_CFLAGS += $(call cc-option,-mno-prefixed)
+endif
KBUILD_CFLAGS += $(call cc-option,-mno-pcrel)
# No AltiVec or VSX or MMA instructions when building kernel