diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2014-06-17 02:15:34 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-06-24 00:05:41 -0400 |
commit | b7b348c682fac04cade7b860c49d4a17f158dad4 (patch) | |
tree | 04bad7718ceab3cf4a6f6479a0295f4bfedab8e7 | |
parent | dfc382a19a2478768ef09d1c745b116e4fca9b4e (diff) |
powerpc/ftrace: Fix inverted check of create_branch()
In commit 24a1bdc35, "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>
-rw-r--r-- | arch/powerpc/kernel/ftrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index f5d1a3420192..8fc0c1742498 100644 --- a/arch/powerpc/kernel/ftrace.c +++ b/arch/powerpc/kernel/ftrace.c | |||
@@ -320,7 +320,7 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) | |||
320 | } | 320 | } |
321 | 321 | ||
322 | /* Ensure branch is within 24 bits */ | 322 | /* Ensure branch is within 24 bits */ |
323 | if (create_branch(ip, rec->arch.mod->arch.tramp, BRANCH_SET_LINK)) { | 323 | if (!create_branch(ip, rec->arch.mod->arch.tramp, BRANCH_SET_LINK)) { |
324 | printk(KERN_ERR "Branch out of range"); | 324 | printk(KERN_ERR "Branch out of range"); |
325 | return -EINVAL; | 325 | return -EINVAL; |
326 | } | 326 | } |