diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2015-02-28 05:35:26 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-03-02 14:35:53 -0500 |
commit | a9ca8eb7afb4f1c90d8e43092e94c4e86785efbc (patch) | |
tree | 0e728829761cb824e4e470e1429d7144027a4c6c | |
parent | d94260832d0d78aba398de361c0416a93cabc046 (diff) |
s390/ftrace: fix crashes when switching tracers / add notrace to cpu_relax()
With git commit 4d92f50249eb ("s390: reintroduce diag 44 calls for
cpu_relax()") I reintroduced a non-trivial cpu_relax() variant on s390.
The difference to the previous variant however is that the new version is
an out-of-line function, which will be traced if function tracing is enabled.
Switching to different tracers includes instruction patching. Therefore this
is done within stop_machine() "context" to prevent that any function tracing
is going on while instructions are being patched.
With the new out-of-line variant of cpu_relax() this is not true anymore,
since cpu_relax() gets called in a busy loop by all waiting cpus within
stop_machine() until function patching is finished.
Therefore cpu_relax() must be marked notrace.
This fixes kernel crashes when frequently switching between "function" and
"function_graph" tracers.
Moving cpu_relax() to a header file again, doesn't work because of header
include order dependencies.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r-- | arch/s390/kernel/processor.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index 26108232fcaa..dc488e13b7e3 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c | |||
@@ -18,7 +18,7 @@ | |||
18 | 18 | ||
19 | static DEFINE_PER_CPU(struct cpuid, cpu_id); | 19 | static DEFINE_PER_CPU(struct cpuid, cpu_id); |
20 | 20 | ||
21 | void cpu_relax(void) | 21 | void notrace cpu_relax(void) |
22 | { | 22 | { |
23 | if (!smp_cpu_mtid && MACHINE_HAS_DIAG44) | 23 | if (!smp_cpu_mtid && MACHINE_HAS_DIAG44) |
24 | asm volatile("diag 0,0,0x44"); | 24 | asm volatile("diag 0,0,0x44"); |