History

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.

Vasily Gorbik committed 4 years ago

Commit c4e78951 parent d7d488f4 files · +12 −2Browse files

Unified · Split

4 files
  1. arch/s390/Makefile +7 −1
  2. arch/s390/lib/Makefile +2 −1
  3. arch/s390/lib/expoline/Makefile +3 −0
  4. arch/s390/lib/expoline/expoline.S +0 −0
arch/s390/Makefile+7−1
@@ -82,7 +82,7 @@ endif · 81 unmodified lines
82 82
83ifdef CONFIG_EXPOLINE83ifdef CONFIG_EXPOLINE
84 ifdef CONFIG_EXPOLINE_EXTERN84 ifdef CONFIG_EXPOLINE_EXTERN
85 KBUILD_LDFLAGS_MODULE += arch/s390/lib/expoline.o85 KBUILD_LDFLAGS_MODULE += arch/s390/lib/expoline/expoline.o
86 CC_FLAGS_EXPOLINE := -mindirect-branch=thunk-extern86 CC_FLAGS_EXPOLINE := -mindirect-branch=thunk-extern
87 CC_FLAGS_EXPOLINE += -mfunction-return=thunk-extern87 CC_FLAGS_EXPOLINE += -mfunction-return=thunk-extern
88 else88 else
@@ -163,6 +163,12 @@ vdso_prepare: prepare0 · 74 unmodified lines
163 $(Q)$(MAKE) $(build)=arch/s390/kernel/vdso64 include/generated/vdso64-offsets.h163 $(Q)$(MAKE) $(build)=arch/s390/kernel/vdso64 include/generated/vdso64-offsets.h
164 $(if $(CONFIG_COMPAT),$(Q)$(MAKE) \164 $(if $(CONFIG_COMPAT),$(Q)$(MAKE) \
165 $(build)=arch/s390/kernel/vdso32 include/generated/vdso32-offsets.h)165 $(build)=arch/s390/kernel/vdso32 include/generated/vdso32-offsets.h)
166
167ifdef CONFIG_EXPOLINE_EXTERN
168modules_prepare: expoline_prepare
169expoline_prepare: prepare0
170 $(Q)$(MAKE) $(build)=arch/s390/lib/expoline arch/s390/lib/expoline/expoline.o
171endif
166endif172endif
167 173
168# Don't use tabs in echo arguments174# Don't use tabs in echo arguments
arch/s390/lib/Makefile+2−1
@@ -7,7 +7,6 @@ lib-y += delay.o string.o uaccess.o find.o spinlock.o · 6 unmodified lines
7obj-y += mem.o xor.o7obj-y += mem.o xor.o
8lib-$(CONFIG_KPROBES) += probes.o8lib-$(CONFIG_KPROBES) += probes.o
9lib-$(CONFIG_UPROBES) += probes.o9lib-$(CONFIG_UPROBES) += probes.o
10obj-$(CONFIG_EXPOLINE_EXTERN) += expoline.o
11obj-$(CONFIG_S390_KPROBES_SANITY_TEST) += test_kprobes_s390.o10obj-$(CONFIG_S390_KPROBES_SANITY_TEST) += test_kprobes_s390.o
12test_kprobes_s390-objs += test_kprobes_asm.o test_kprobes.o11test_kprobes_s390-objs += test_kprobes_asm.o test_kprobes.o
13 12
@@ -22,3 +21,5 @@ obj-$(CONFIG_S390_MODULES_SANITY_TEST) += test_modules.o · 8 unmodified lines
22obj-$(CONFIG_S390_MODULES_SANITY_TEST_HELPERS) += test_modules_helpers.o21obj-$(CONFIG_S390_MODULES_SANITY_TEST_HELPERS) += test_modules_helpers.o
23 22
24lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o23lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o
24
25obj-$(CONFIG_EXPOLINE_EXTERN) += expoline/
arch/s390/lib/expoline/Makefile+3−0
@@ -0,0 +1,3 @@
1# SPDX-License-Identifier: GPL-2.0
2
3obj-y += expoline.o
arch/s390/lib/expoline/expoline.Srenamed from arch/s390/lib/expoline.S+0−0

File renamed without changes.