summaryrefslogtreecommitdiff
path: root/arch/s390/Makefile
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2022-06-27 15:50:53 +0300
committerAlexander Gordeev <agordeev@linux.ibm.com>2022-07-13 16:21:55 +0300
commitc4e789572557aa147b13bf7fe09cc99663ed0cf5 (patch)
tree49da32666321502636d714842b4df4d9674b5d54 /arch/s390/Makefile
parentd7d488f41b41a1b7a1df3c74f2f65eb4585f5d55 (diff)
downloadlinux-c4e789572557aa147b13bf7fe09cc99663ed0cf5.tar.xz
s390/nospec: build expoline.o for modules_prepare target
When CONFIG_EXPOLINE_EXTERN is used expoline thunks are generated from arch/s390/lib/expoline.S and postlinked into every module. This is also true for external modules. Add expoline.o build to the modules_prepare target. Fixes: 1d2ad084800e ("s390/nospec: add an option to use thunk-extern") Reported-by: Joe Lawrence <joe.lawrence@redhat.com> Tested-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com> Tested-by: C. Erastus Toe <ctoe@redhat.com> Tested-by: Joe Lawrence <joe.lawrence@redhat.com> Link: https://lore.kernel.org/r/patch-1.thread-d13b6c.git-a2387a74dc49.your-ad-here.call-01656331067-ext-4899@work.hours Signed-off-by: Vasily Gorbik <gor@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Diffstat (limited to 'arch/s390/Makefile')
-rw-r--r--arch/s390/Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index 495c68a4df1e..fc72a35a1f07 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -82,7 +82,7 @@ endif
ifdef CONFIG_EXPOLINE
ifdef CONFIG_EXPOLINE_EXTERN
- KBUILD_LDFLAGS_MODULE += arch/s390/lib/expoline.o
+ KBUILD_LDFLAGS_MODULE += arch/s390/lib/expoline/expoline.o
CC_FLAGS_EXPOLINE := -mindirect-branch=thunk-extern
CC_FLAGS_EXPOLINE += -mfunction-return=thunk-extern
else
@@ -163,6 +163,12 @@ vdso_prepare: prepare0
$(Q)$(MAKE) $(build)=arch/s390/kernel/vdso64 include/generated/vdso64-offsets.h
$(if $(CONFIG_COMPAT),$(Q)$(MAKE) \
$(build)=arch/s390/kernel/vdso32 include/generated/vdso32-offsets.h)
+
+ifdef CONFIG_EXPOLINE_EXTERN
+modules_prepare: expoline_prepare
+expoline_prepare: prepare0
+ $(Q)$(MAKE) $(build)=arch/s390/lib/expoline arch/s390/lib/expoline/expoline.o
+endif
endif
# Don't use tabs in echo arguments