Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-27 Thread Jiri Kosina
On Mon, 27 Jun 2016, Pavel Machek wrote: > I believe you want "whenever source of function A influenced code in > function B, I want to be notified", and I believe it should be > documented as such. Well, exactly. IPA is a group of optimizations that are, by definition, intra-prodcedural. --

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-27 Thread Pavel Machek
On Mon 2016-06-27 10:26:58, Jiri Kosina wrote: > On Mon, 27 Jun 2016, Pavel Machek wrote: > > > > > 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

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-27 Thread Jiri Kosina
On Mon, 27 Jun 2016, Pavel Machek wrote: > > > 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 a

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-27 Thread Pavel Machek
On Mon 2016-06-27 10:13:28, Jiri Kosina wrote: > 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 anal

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-27 Thread Jiri Kosina
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 regis

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-27 Thread Torsten Duwe
On Mon, Jun 27, 2016 at 12:39:56AM +0200, Pavel Machek wrote: > Would it be possible to document which kind of guarantees live > patching needs from compiler? Sure, here you go, all required guarantees: Stick to the ABI. > I always assumed that whoever is preparing the patch does manual > inves

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-26 Thread Pavel Machek
On Thu 2016-06-23 14:47:03, Jiri Kosina wrote: > On Thu, 23 Jun 2016, Jiri Kosina wrote: > > > > I haven't looked at the fentry solution, but the code I'm involved in > > > saves > > > the registers so that ftrace, live patch and friends can work freely. But > > > then it restores all regs and _t

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-26 Thread Pavel Machek
On Wed 2016-06-22 16:24:41, Torsten Duwe 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 registe

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-23 Thread Jiri Kosina
On Thu, 23 Jun 2016, Jiri Kosina wrote: > > I haven't looked at the fentry solution, but the code I'm involved in saves > > the registers so that ftrace, live patch and friends can work freely. But > > then it restores all regs and _then_ calls the replacement, so ftrace > > saving all regs is no

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-23 Thread Jiri Kosina
On Thu, 23 Jun 2016, Torsten Duwe wrote: > I haven't looked at the fentry solution, but the code I'm involved in saves > the registers so that ftrace, live patch and friends can work freely. But > then it restores all regs and _then_ calls the replacement, so ftrace > saving all regs is no gain at

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-23 Thread Torsten Duwe
On Thu, Jun 23, 2016 at 09:45:48AM +0200, Miroslav Benes wrote: > > Hi, > > On Wed, 22 Jun 2016, Josh Poimboeuf wrote: > > > On Wed, Jun 22, 2016 at 04:24:41PM +0200, Torsten Duwe wrote: > > > Live patching, as we use it, deliberately disrupts the fabric of > > > compile units; thus all assumpti

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-23 Thread Miroslav Benes
Hi, On Wed, 22 Jun 2016, Josh Poimboeuf wrote: > On Wed, Jun 22, 2016 at 04:24:41PM +0200, Torsten Duwe 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

Re: [PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-22 Thread Josh Poimboeuf
On Wed, Jun 22, 2016 at 04:24:41PM +0200, Torsten Duwe 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

[PATCH] Disable non-ABI-compliant optimisations for live patching

2016-06-22 Thread Torsten Duwe
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 r