[PATCH] tracing: bpf: Remove in_nmi() check from kprobe handler

From: Masami Hiramatsu
Date: Wed Jan 27 2021 - 22:31:02 EST


Since commit 0d00449c7a28 ("x86: Replace ist_enter() with nmi_enter()") has
changed the kprobe handler to run in the NMI context, in_nmi() always returns
true. This means the bpf events on kprobes always skipped.

Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
---
kernel/trace/bpf_trace.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 6c0018abe68a..764400260eb6 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -96,9 +96,6 @@ unsigned int trace_call_bpf(struct trace_event_call *call, void *ctx)
{
unsigned int ret;

- if (in_nmi()) /* not supported yet */
- return 1;
-
cant_sleep();

if (unlikely(__this_cpu_inc_return(bpf_prog_active) != 1)) {
--
2.25.1

--
Masami Hiramatsu