From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Subject: Re: Qemu problems in -next with 's390/spinlock: add niai spinlock hints'
Date: Wed, 26 Jul 2017 09:26:54 +0200 [thread overview]
Message-ID: <20170726072654.GE3218@osiris> (raw)
In-Reply-To: <20170726083100.0146e84a@mschwideX1>
> > > Hmm, I though that NIAI is a NOP on older machines. A runtime check for
> > > the facility bit is out of the question as the NIAI-7 gets inlined in
> > > the spin_unlock code. So yes, the only available fix is to make the
> > > NIAI hinting conditional on zEC12. Which is quite ugly as we would need
> > > an architecture level set to zEC12 for the distribution kernel to make
> > > use of NIAI.
> >
> > Alternatively you could generate a four-byte nop, and replace that at IPL
> > time with the needed NIAI instruction, if the facility is available. Some
> > sort of "alternative" code patching infrastructure that x86 already has.
> > Not sure if it is worth it, however...
>
> Patching all spin_unlock inlines? There are a lot of callers for this
> function. We could think about an out-of-line spin_unlock and patch this
> single function but then we'd loose the advantage of inlining.
> I do not think it is worthwhile.
>
> I pushed an updated patch to the features branch of s390/linux. Should
> be in linux-next tomorroy. Thanks.
The idea would be to generate an extra section that contains the addresses
of the to be patched instructions, and how they need to be patched. That
section, plus the code that will do the patching could reside in init
data/code sections and would be discarded after. So the additional memory
overhead after initialization would be close to zero.
However an ifdef is fine as well ;)
next prev parent reply other threads:[~2017-07-26 7:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-26 1:14 Qemu problems in -next with 's390/spinlock: add niai spinlock hints' Guenter Roeck
2017-07-26 5:00 ` Heiko Carstens
2017-07-26 5:40 ` Martin Schwidefsky
2017-07-26 6:05 ` Heiko Carstens
2017-07-26 6:31 ` Martin Schwidefsky
2017-07-26 7:26 ` Heiko Carstens [this message]
2017-07-26 9:40 ` Cornelia Huck
2017-07-26 11:48 ` Martin Schwidefsky
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=20170726072654.GE3218@osiris \
--to=heiko.carstens@de.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=schwidefsky@de.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;
as well as URLs for NNTP newsgroup(s).