]> asedeno.scripts.mit.edu Git - linux.git/commit
powerpc64/ftrace: Add a field in paca to disable ftrace in unsafe code paths
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Thu, 19 Apr 2018 07:04:00 +0000 (12:34 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 3 May 2018 12:32:25 +0000 (22:32 +1000)
commitea678ac627e01daf5b4f1da24bf1d0c500e10898
tree3fc26b7a742114a8c6b79bc2a6490c40c86afaa5
parent6da6c0db5316275015e8cc2959f12a17584aeb64
powerpc64/ftrace: Add a field in paca to disable ftrace in unsafe code paths

We have some C code that we call into from real mode where we cannot
take any exceptions. Though the C functions themselves are mostly safe,
if these functions are traced, there is a possibility that we may take
an exception. For instance, in certain conditions, the ftrace code uses
WARN(), which uses a 'trap' to do its job.

For such scenarios, introduce a new field in paca 'ftrace_enabled',
which is checked on ftrace entry before continuing. This field can then
be set to zero to disable/pause ftrace, and set to a non-zero value to
resume ftrace.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/paca.h
arch/powerpc/kernel/asm-offsets.c
arch/powerpc/kernel/setup_64.c
arch/powerpc/kernel/trace/ftrace_64_mprofile.S
arch/powerpc/kernel/trace/ftrace_64_pg.S