From: Joe Lawrence <joe.lawrence@redhat.com>
To: Vasily Gorbik <gor@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
Sumanth Korikkar <sumanthk@linux.ibm.com>,
Heiko Carstens <hca@linux.ibm.com>,
Masahiro Yamada <masahiroy@kernel.org>,
linux-s390 <linux-s390@vger.kernel.org>,
linux-kbuild@vger.kernel.org, "C. Erastus Toe" <ctoe@redhat.com>
Subject: Re: s390/nospec: add an option to use thunk-extern
Date: Wed, 29 Jun 2022 11:16:12 -0400 [thread overview]
Message-ID: <ad6a926e-eed1-a5e2-9f8b-0ea1599bbaed@redhat.com> (raw)
In-Reply-To: <cover.thread-d13b6c.your-ad-here.call-01656331067-ext-4899@work.hours>
On 6/27/22 8:50 AM, Vasily Gorbik wrote:
> Hi Joe,
>
> sorry for late reply.
>
>> I couldn't find the upstream patch post for 1d2ad084800e ("s390/nospec:
>> add an option to use thunk-extern"), so replying off-list here. Feel
>> free to cc the appropriate list.
>>
>> Regarding this change, as I understand it, when CONFIG_EXPOLINE_EXTERN=y
>> out-of-tree kernel modules will need to link against
>> arch/s390x/lib/expoline.o, right?
>>
>> And if so, shouldn't the top level 'prepare_modules' target create
>> expoline.o for this purpose?
>
> Thanks for bringing this up. I definitely missed out-of-tree kernel modules
> build case without a prebuilt kernel. On the other hand this post-linking
> trick is a rip off from powerpc:
>
> KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o
>
> So, now I wonder why powerpc doesn't have crtsavres.o in 'prepare_modules'.
>
> Anyhow, below is couple of patches to consider. The first one is
> meant to be backportable, as the second one requires 4efd417f298b.
>
> I had to move expoline.S to a separate directory to be able to call into
> its Makefile for 'prepare_modules' and avoid warnings for other targets
> defined in the same Makefile. Not sure if there are better kbuild tricks
> I could use. Another option I thought about is to keep expoline.S where
> it is and add a condition into that Makefile:
> expoline_prepare: prepare0
> $(Q)$(MAKE) $(build)=arch/s390/lib expoline_prepare=1 arch/s390/lib/expoline.o
>
> arch/s390/lib/Makefile:
> # first target defined
> obj-$(CONFIG_EXPOLINE_EXTERN) += expoline.o
> ifndef expoline_prepare
> # ...other targets...
>
> Vasily Gorbik (2):
> s390/nospec: build expoline.o for modules_prepare target
> s390/nospec: remove unneeded header includes
>
> arch/s390/Makefile | 8 +++++++-
> arch/s390/include/asm/nospec-insn.h | 2 --
> arch/s390/lib/Makefile | 3 ++-
> arch/s390/lib/expoline/Makefile | 3 +++
> arch/s390/lib/{ => expoline}/expoline.S | 0
> 5 files changed, 12 insertions(+), 4 deletions(-)
> create mode 100644 arch/s390/lib/expoline/Makefile
> rename arch/s390/lib/{ => expoline}/expoline.S (100%)
>
Thanks, Vasily. We'll test these with OOT and the original gitlab
pipeline where we spotted potential issue with packaging and report back.
--
Joe
next prev parent reply other threads:[~2022-06-29 15:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <8417373c-9dba-54bd-ce08-2d36d0a2af04@redhat.com>
2022-06-07 17:26 ` Fwd: s390/nospec: add an option to use thunk-extern Joe Lawrence
2022-06-27 12:50 ` Vasily Gorbik
2022-06-27 12:50 ` [PATCH 1/2] s390/nospec: build expoline.o for modules_prepare target Vasily Gorbik
2022-06-27 12:50 ` [PATCH 2/2] s390/nospec: remove unneeded header includes Vasily Gorbik
2023-03-16 11:14 ` Jiri Slaby
2023-03-16 11:28 ` [PATCH] s390: reintroduce expoline dependence to scripts Jiri Slaby (SUSE)
2023-03-21 21:19 ` Vasily Gorbik
2023-03-17 10:58 ` [PATCH 2/2] s390/nospec: remove unneeded header includes Masahiro Yamada
2023-03-17 11:17 ` Vasily Gorbik
2023-03-17 11:32 ` Jiri Slaby
2023-03-17 23:36 ` Masahiro Yamada
2022-06-29 15:16 ` Joe Lawrence [this message]
[not found] ` <CAPQ7N1RFyZRCJZc84UxjSQj44ksa6f6ib5B=dVwoqMU9_=s8QA@mail.gmail.com>
2022-07-01 21:39 ` s390/nospec: add an option to use thunk-extern Joe Lawrence
2022-07-17 13:11 ` Sumanth Korikkar
2022-08-17 13:59 ` Joe Lawrence
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ad6a926e-eed1-a5e2-9f8b-0ea1599bbaed@redhat.com \
--to=joe.lawrence@redhat.com \
--cc=ctoe@redhat.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=mpe@ellerman.id.au \
--cc=sumanthk@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox