]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace: Fix recursion check for NMI test
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 29 Oct 2020 21:31:45 +0000 (17:31 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 2 Nov 2020 13:52:18 +0000 (08:52 -0500)
commitff7c9a1618dce25e006885f633f3dcd34ca9e373
tree67c54a9830e23b2325b2a0020ee12f9e2c339afb
parentbf07b44a6acc8698262199f2967a2e0481e596c9
ftrace: Fix recursion check for NMI test

The code that checks recursion will work to only do the recursion check once
if there's nested checks. The top one will do the check, the other nested
checks will see recursion was already checked and return zero for its "bit".
On the return side, nothing will be done if the "bit" is zero.

The problem is that zero is returned for the "good" bit when in NMI context.
This will set the bit for NMIs making it look like *all* NMI tracing is
recursing, and prevent tracing of anything in NMI context!

The simple fix is to return "bit + 1" and subtract that bit on the end to
get the real bit.

Cc: stable@vger.kernel.org
Fixes: 33f7d5557eeee ("tracing: Avoid unnecessary multiple recursion checks")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace.h