ftrace/x86: Simplify save_mcount_regs on getting RIP
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Mon, 24 Nov 2014 18:06:05 +0000 (13:06 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 1 Dec 2014 19:07:50 +0000 (14:07 -0500)
commit527aa75b333f90f4f90ac1730762156680a42fe8
tree96c1d59adccb390b16f71aa75b8f94bcaa0223c0
parent094dfc545139510f251b9595850aa63fe2a8c131
ftrace/x86: Simplify save_mcount_regs on getting RIP

Currently save_mcount_regs is passed a "skip" parameter to know how much
stack updated the pt_regs, as it tries to keep the saved pt_regs in the
same location for all users. This is rather stupid, especially since the
part stored on the pt_regs has nothing to do with what is suppose to be
in that location.

Instead of doing that, just pass in an "added" parameter that lets that
macro know how much stack was added before it was called so that it
can get to the RIP.  But the difference is that it will now offset the
pt_regs by that "added" count. The caller now needs to take care of
the offset of the pt_regs.

This will make it easier to simplify the code later.

Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1411262304010.3961@nanos
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
arch/x86/kernel/mcount_64.S