lkml.org 
[lkml]   [2016]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Disable non-ABI-compliant optimisations for live patching
On Mon, 27 Jun 2016, Pavel Machek wrote:

> > Live patching, as we use it, deliberately disrupts the fabric of
> > compile units; thus all assumptions a compiler can make about the
> > control flow may be invalid. As an example, it could analyse that a
> > callee does not touch a caller-saved register at all, so why waste
> > memory bandwidth saving it? The register allocations for the live
> > patch replacement function may however be quite different.
> >
> > Starting with this example, disable all compiler optimisations that
> > do not strictly comply with the established calling conventions.
>
> I thought that in such case, person creating the live patch should
> notice and adjust patch appropriately, at assembly level if
> neccessary..?

Yes, that still holds; a lot of things could be automated though, and
creating the automation tools is one of the big TODO items.

> If this is not true, and we want gcc to help us, what other
> optimalizations do we need to disable? Even changes inside one compiler
> unit can be "interesting"...

What would actually be helpful is gcc providing us with a list of
functions where it performed this ABI-violating optimization (similarly,
we're already obtaining list of "what got inlined where"). Unfortunately,
-fdump-ipa-ra is currently missing; I'm talking to gcc guys now to have it
implemented.

--
Jiri Kosina
SUSE Labs

\
 
 \ /
  Last update: 2016-06-27 11:01    [W:0.088 / U:0.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site