[PATCH] ftrace/x86: Load ftrace_ops in parameter not the variableholding it

From: Steven Rostedt
Date: Fri Nov 08 2013 - 10:06:58 EST



Peter,

I found a bug in the ftrace callback code. When there's only one
function registered that supplies its own recursion protection, it gets
the ftrace_ops that it registered passed to it in the 3rd parameter
from assembly (otherwise, it gets it from a helper function).

But the assembly uses 'leaq' instead of 'movq' and instead of passing
the ftrace_ops to the callback, it passes in the address of the pointer
to the current ftrace_ops structure :-p. Luckily, all users that needed
ftrace_ops so far used the helper function. But I have new code that
requires this to work that is scheduled for 3.14, I would like to get
this fix in for 3.13. As there are no current users of the direct
assembly passing, it's not required for stable.

I didn't know what branch to base this on in tip so I'm sending you the
patch here. You can pull in in directly or if you tell me which branch
to base on, I can send you a pull request. Your choice.

Thanks!

-- Steve