Commit c4e78957 authored by Vasily Gorbik's avatar Vasily Gorbik Committed by Alexander Gordeev
Browse files

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: 1d2ad084 ("s390/nospec: add an option to use thunk-extern")
Reported-by: default avatarJoe Lawrence <joe.lawrence@redhat.com>
Tested-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
Acked-by: default avatarSumanth Korikkar <sumanthk@linux.ibm.com>
Tested-by: default avatarC. Erastus Toe <ctoe@redhat.com>
Tested-by: default avatarJoe 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: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
parent d7d488f4
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -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
+2 −1
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@ lib-y += delay.o string.o uaccess.o find.o spinlock.o
obj-y += mem.o xor.o
lib-$(CONFIG_KPROBES) += probes.o
lib-$(CONFIG_UPROBES) += probes.o
obj-$(CONFIG_EXPOLINE_EXTERN) += expoline.o
obj-$(CONFIG_S390_KPROBES_SANITY_TEST) += test_kprobes_s390.o
test_kprobes_s390-objs += test_kprobes_asm.o test_kprobes.o

@@ -22,3 +21,5 @@ obj-$(CONFIG_S390_MODULES_SANITY_TEST) += test_modules.o
obj-$(CONFIG_S390_MODULES_SANITY_TEST_HELPERS) += test_modules_helpers.o

lib-$(CONFIG_FUNCTION_ERROR_INJECTION) += error-inject.o

obj-$(CONFIG_EXPOLINE_EXTERN) += expoline/
+3 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0

obj-y += expoline.o