From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frederic Weisbecker Subject: Re: [PATCH v4 08/27] rcu/kprobes: Comment why rcu_nmi_enter() is marked NOKPROBE Date: Wed, 26 Feb 2020 01:27:55 +0100 Message-ID: <20200226002755.GD9599@lenoir> References: <20200221133416.777099322@infradead.org> <20200221134215.501225981@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail.kernel.org ([198.145.29.99]:45802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728756AbgBZA16 (ORCPT ); Tue, 25 Feb 2020 19:27:58 -0500 Content-Disposition: inline In-Reply-To: <20200221134215.501225981@infradead.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, rostedt@goodmis.org, mingo@kernel.org, joel@joelfernandes.org, gregkh@linuxfoundation.org, gustavo@embeddedor.com, tglx@linutronix.de, paulmck@kernel.org, josh@joshtriplett.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, luto@kernel.org, tony.luck@intel.com, dan.carpenter@oracle.com, mhiramat@kernel.org On Fri, Feb 21, 2020 at 02:34:24PM +0100, Peter Zijlstra wrote: > From: Steven Rostedt (VMware) > > It's confusing that rcu_nmi_enter() is marked NOKPROBE and > rcu_nmi_exit() is not. One may think that the exit needs to be marked > for the same reason the enter is, as rcu_nmi_exit() reverts the RCU > state back to what it was before rcu_nmi_enter(). But the reason has > nothing to do with the state of RCU. > > The breakpoint handler (int3 on x86) must not have any kprobe on it > until the kprobe handler is called. Otherwise, it can cause an infinite > recursion and crash the machine. It just so happens that > rcu_nmi_enter() is called by the int3 handler before the kprobe handler > can run, and therefore needs to be marked as NOKPROBE. > > Comment this to remove the confusion to why rcu_nmi_enter() is marked > NOKPROBE but rcu_nmi_exit() is not. > > Reported-by: Joel Fernandes (Google) > Signed-off-by: Steven Rostedt (VMware) > Signed-off-by: Peter Zijlstra (Intel) > Reviewed-by: Paul E. McKenney > Reviewed-by: Masami Hiramatsu > Acked-by: Joel Fernandes (Google) > Link: https://lore.kernel.org/r/20200213163800.5c51a5f1@gandalf.local.home Reviewed-by: Frederic Weisbecker