[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200121161045.dhihqibnpyrk2lsu@treble>
Date: Tue, 21 Jan 2020 10:10:45 -0600
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Miroslav Benes <mbenes@...e.cz>
Cc: Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Joe Lawrence <joe.lawrence@...hat.com>,
Jessica Yu <jeyu@...nel.org>, x86@...nel.org,
linux-kernel@...r.kernel.org, mhiramat@...nel.org,
bristot@...hat.com, jbaron@...mai.com,
torvalds@...ux-foundation.org, tglx@...utronix.de,
mingo@...nel.org, namit@...are.com, hpa@...or.com, luto@...nel.org,
ard.biesheuvel@...aro.org, live-patching@...r.kernel.org,
Randy Dunlap <rdunlap@...radead.org>
Subject: Re: [PATCH v3 5/6] x86/ftrace: Use text_poke()
On Tue, Jan 21, 2020 at 09:35:28AM +0100, Miroslav Benes wrote:
> On Mon, 20 Jan 2020, Josh Poimboeuf wrote:
>
> > On Mon, Oct 21, 2019 at 10:05:49AM -0500, Josh Poimboeuf wrote:
> > > On Wed, Oct 16, 2019 at 09:42:17AM +0200, Peter Zijlstra wrote:
> > > > > which are not compatible with livepatching. GCC upstream now has
> > > > > -flive-patching option, which disables all those interfering optimizations.
> > > >
> > > > Which, IIRC, has a significant performance impact and should thus really
> > > > not be used...
> > > >
> > > > If distros ship that crap, I'm going to laugh at them the next time they
> > > > want a single digit performance improvement because *important*.
> > >
> > > I have a crazy plan to try to use objtool to detect function changes at
> > > a binary level, which would hopefully allow us to drop this flag.
> > >
> > > But regardless, I wonder if we enabled this flag prematurely. We still
> > > don't have a reasonable way to use it for creating source-based live
> > > patches upstream, and it should really be optional for CONFIG_LIVEPATCH,
> > > since kpatch-build doesn't need it.
> >
> > I also just discovered that -flive-patching is responsible for all those
> > "unreachable instruction" objtool warnings which Randy has been
> > dutifully bugging me about over the last several months. For some
> > reason it subtly breaks GCC implicit noreturn detection for local
> > functions.
>
> Ugh, that is unfortunate. Have you reported it?
Not yet (but I plan to).
> > At this point, I only see downsides of -flive-patching, at least until
> > we actually have real upstream code which needs it.
>
> Can you explain this? The option makes GCC to avoid optimizations which
> are difficult to detect and would make live patching unsafe. I consider it
> useful as it is, so if you shared the other downsides and what you meant
> by real upstream code, we could discuss it.
Only SLES needs it right? Why inflict it on other livepatch users? By
"real upstream code" I mean there's no (documented) way to create live
patches using the method which relies on this flag. So I don't see any
upstream benefits for having it enabled.
--
Josh
Powered by blists - more mailing lists