]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/ftrace: Fix inverted check of create_branch()
authorMichael Ellerman <mpe@ellerman.id.au>
Tue, 17 Jun 2014 06:15:34 +0000 (16:15 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 24 Jun 2014 04:05:41 +0000 (14:05 +1000)
commitdda5755d8e434e7c81e964b33aed8c0d2d2378c4
tree04bad7718ceab3cf4a6f6479a0295f4bfedab8e7
parent48c32f18beb4b35a5522d56cda765916ac5d9db5
powerpc/ftrace: Fix inverted check of create_branch()

In commit ddc9f5981, "Fix ABIv2 issues with __ftrace_make_call", Anton
changed the logic that creates and patches the branch, and added a
thinko in the check of create_branch(). create_branch() returns the
instruction that was generated, so if we get zero then it succeeded.

The result is we can't ftrace modules:

  Branch out of range
  WARNING: at ../kernel/trace/ftrace.c:1638
  ftrace failed to modify [<d000000004ba001c>] fuse_req_init_context+0x1c/0x90 [fuse]

We should probably fix patch_instruction() to do that check and make the
API saner, but that's a separate patch. For now just invert the test.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/ftrace.c