OSDN Git Service

powerpc: Have patch_instruction detect faults
authorSteven Rostedt <srostedt@redhat.com>
Thu, 26 Apr 2012 08:31:18 +0000 (08:31 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 3 Jul 2012 04:14:38 +0000 (14:14 +1000)
commitb6e3796834faefe4b6e9a2aedfe12665cd51fbc5
treed330be3540cf441198f630c8fa0eda9899ddb8b5
parentee456bb346e75a9b6d941224b108250e6ee5f79f
powerpc: Have patch_instruction detect faults

For ftrace to use the patch_instruction code, it needs to check for
faults on write. Ftrace updates code all over the kernel, and we need to
know if code is updated or not due to protections that are placed on
some portions of the kernel. If ftrace does not detect a fault, it will
error later on, and it will be much more difficult to find the problem.

By changing patch_instruction() to detect faults, then ftrace will be
able to make use of it too.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/code-patching.h
arch/powerpc/lib/code-patching.c