Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1364303

Re: [PATCH/RFC] ppc64 livepatch: frameless klp_return_helper using odd TOC

From Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH/RFC] ppc64 livepatch: frameless klp_return_helper using odd TOC
Date 2016-03-24 17:10 +0100
Message-ID <rgfZG-53T-39@gated-at.bofh.it> (permalink)
References <rfTmq-5As-9@gated-at.bofh.it> <rgawW-12F-17@gated-at.bofh.it> <rgaGD-17f-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Torsten Duwe <duwe@lst.de> [2016-03-24 11:27:57]:

> On Thu, Mar 24, 2016 at 03:44:55PM +0530, Kamalesh Babulal wrote:
> > * Torsten Duwe <duwe@lst.de> [2016-03-23 16:58:58]:
> > 
> > > 
> > > Since nobody liked the extra stack frame nor its workarounds, here is
> > > the next attempt. Assumptions:
> > > 
> > > 1. Heuristics are bad. The better they are, the more subtly the
> > >    way they might fail.
> > > 
> > > 2. The TOC pointer is usually dividable by 4, if not by 8. An odd
> > >    value never occurs.
> > > 
> > > Conclusively, this patch unambiguously creates an odd TOC value when
> > > an ftraced function's global entry point is used. Ftrace_caller will
> > > then immediately fix it, and alongside gather the information whether
> > > the made call was local or global.
> > > 
> > > In case of live patching this information is furthermore used to decide
> > > whether a klp_return_helper needs to be inserted or not.
> > > CAVEAT: any frameless klp_return_helper does not play well with
> > > sibling calls! There's an emergency exit that might work, at worst
> > > it will cause an oops, but it surely avoids a lockup.
> > > At least the live patching modules on ppc64le will need to be compiled
> > > using the -fno-optimize-sibling-calls compiler flag!
> > > 
> > > Thanks go to Michael Matz and Richard Biener for reassurance about
> > > heuristics and pointers to the compiler flag.
> > > 
> > > Signed-off-by: Torsten Duwe <duwe@suse.de>
> > 
> > Hi Torsten,
> > 
> > Should this patch be applied over Petr Mladek's v4 ?
> 
> Yes. Just omit the changes it makes to entry_64.S and use this instead.

Thanks, I was able to successfully execute basic livepatch sample module test.


Thanks,
Kamalesh.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH/RFC] ppc64 livepatch: frameless klp_return_helper using odd  TOC Torsten Duwe <duwe@lst.de> - 2016-03-23 17:00 +0100
  Re: [PATCH/RFC] ppc64 livepatch: frameless klp_return_helper using  odd TOC Balbir Singh <bsingharora@gmail.com> - 2016-03-24 03:30 +0100
    Re: [PATCH/RFC] ppc64 livepatch: frameless klp_return_helper using  odd TOC Torsten Duwe <torsten@lst.de> - 2016-03-24 09:10 +0100
      Re: [PATCH/RFC] ppc64 livepatch: frameless klp_return_helper using  odd TOC Michael Ellerman <mpe@ellerman.id.au> - 2016-03-24 12:10 +0100
  Re: [PATCH/RFC] ppc64 livepatch: frameless klp_return_helper using  odd TOC Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> - 2016-03-24 11:20 +0100
    Re: [PATCH/RFC] ppc64 livepatch: frameless klp_return_helper using  odd TOC Torsten Duwe <duwe@lst.de> - 2016-03-24 11:30 +0100
      Re: [PATCH/RFC] ppc64 livepatch: frameless klp_return_helper using  odd TOC Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> - 2016-03-24 17:10 +0100

csiph-web