linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sumanth Korikkar <sumanthk@linux.ibm.com>
To: Joe Lawrence <joe.lawrence@redhat.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
	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>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>
Subject: Re: s390/nospec: add an option to use thunk-extern
Date: Sun, 17 Jul 2022 15:11:06 +0200	[thread overview]
Message-ID: <2db2140b-ce07-f066-bcc2-981a53849bbb@linux.ibm.com> (raw)
In-Reply-To: <e853268a-3e0a-3a88-331b-53c74e8796d6@redhat.com>

Hi Joe,

c4e789572557 ("s390/nospec: build expoline.o for modules_prepare 
target") is now in linux.git.

Note: arch/s390/lib/expoline.o is moved to 
arch/s390/lib/expoline/expoline.o. This means kernel-devel package in 
fedora should also include this updated file path.

Thanks

On 7/1/22 23:39, Joe Lawrence wrote:
> On 7/1/22 5:18 PM, C. Erastus Toe wrote:
>> On Wed, Jun 29, 2022 at 11:16 AM Joe Lawrence <joe.lawrence@redhat.com
>> <mailto:joe.lawrence@redhat.com>> wrote:
>>
>>      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.
>>
>> Hi,
>>
>> Successfully tested the first patch in a rhel-9 backport. (had to skip
>> the second as it has dependencies on other patches like [1] that
>> deprecated symbols like __LC_BR_R1. Without those, the build resulted in
>> a flood of: depmod: WARNING: <module>.ko needs unknown symbol __LC_BR_R1.)
>>
>> For ("s390/nospec: build expoline.o for modules_prepare target"),
>> Tested-by: C. Erastus Toe <ctoe@redhat.com <mailto:ctoe@redhat.com>>
>>
>> [1] 4efd417f298b ("s390: raise minimum supported machine generation to z10")
>>
> 
> And then for the entire series (tested on top of v5.19-rc4),
> Tested-by: Joe Lawrence <joe.lawrence@redhat.com>
> 

-- 
Sumanth

  reply	other threads:[~2022-07-17 13:11 UTC|newest]

Thread overview: 13+ 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-17 10:58         ` 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     ` s390/nospec: add an option to use thunk-extern Joe Lawrence
     [not found]       ` <CAPQ7N1RFyZRCJZc84UxjSQj44ksa6f6ib5B=dVwoqMU9_=s8QA@mail.gmail.com>
2022-07-01 21:39         ` Joe Lawrence
2022-07-17 13:11           ` Sumanth Korikkar [this message]
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=2db2140b-ce07-f066-bcc2-981a53849bbb@linux.ibm.com \
    --to=sumanthk@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=ctoe@redhat.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=joe.lawrence@redhat.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=mpe@ellerman.id.au \
    /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;
as well as URLs for NNTP newsgroup(s).