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


Groups > linux.kernel > #1355520

Re: [PATCH 2/2] ppc64le live patch: get rid of mini stack frame

From Michael Ellerman <mpe@ellerman.id.au>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] ppc64le live patch: get rid of mini stack frame
Date 2016-03-11 02:00 +0100
Message-ID <rbjAS-6wH-7@gated-at.bofh.it> (permalink)
References <raQ5R-2LL-27@gated-at.bofh.it> <raQfw-2Q2-27@gated-at.bofh.it> <rb7T4-6WL-25@gated-at.bofh.it> <rb8m7-78l-23@gated-at.bofh.it> <rb8vL-7qT-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 2016-03-10 at 14:04 +0100, Torsten Duwe wrote:
> On Thu, Mar 10, 2016 at 01:51:16PM +0100, Petr Mladek wrote:
> > On Thu 2016-03-10 13:25:08, Petr Mladek wrote:
> > > On Wed 2016-03-09 18:30:17, Torsten Duwe wrote:
> > > > After the mini stack frame is no longer required for TOC storage, it can
> > > > be eliminated iff the functionality of klp_return_helper, which required
> > > > a stack frame for the extra return address previously, is carried out
> > > > by the replacement function now. This requires _every_ live patch replacement
> > > > function to execute the following (or similar) sequence of machine instructions
> > > > just before every return to the original caller:
> > > 
> > > I have thought about it and it is a nono from my point of view.
> > > It is too error prone, especially that there are functions that
> > > call return on several locations.
> 
> Yes, that's what I think as well when I look at it.

> > BTW: How is this solved in kretprobes? Or is it easier there?
> 
> Without any look at the code I assume it uses solution 3. Once
> you have a probing framework in place, you can remember the real
> return addresses in a data structure. As I wrote, the function
> graph tracer does it this way so it would be abvious.

Yeah it has a linked list of struct kretprobe_instance's, each of which stores
the real return address.

I have some ideas for how to fix livepatch, but this week is a bit busy with
merge window prep.

cheers

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


Thread

[PATCH 1/2] ppc64le live patch: clear out storage location(s) in  mini stack frame Torsten Duwe <duwe@lst.de> - 2016-03-09 18:30 +0100
  [PATCH 2/2] ppc64le live patch: get rid of mini stack frame Torsten Duwe <duwe@lst.de> - 2016-03-09 18:40 +0100
    Re: [PATCH 2/2] ppc64le live patch: get rid of mini stack frame Petr Mladek <pmladek@suse.com> - 2016-03-10 13:30 +0100
      Re: [PATCH 2/2] ppc64le live patch: get rid of mini stack frame Jiri Kosina <jikos@kernel.org> - 2016-03-10 14:00 +0100
      Re: [PATCH 2/2] ppc64le live patch: get rid of mini stack frame Petr Mladek <pmladek@suse.com> - 2016-03-10 14:00 +0100
        Re: [PATCH 2/2] ppc64le live patch: get rid of mini stack frame Torsten Duwe <duwe@lst.de> - 2016-03-10 14:10 +0100
          Re: [PATCH 2/2] ppc64le live patch: get rid of mini stack frame Michael Ellerman <mpe@ellerman.id.au> - 2016-03-11 02:00 +0100
  Re: [PATCH 1/2] ppc64le live patch: clear out storage location(s) in  mini stack frame Balbir Singh <bsingharora@gmail.com> - 2016-03-11 04:40 +0100

csiph-web