linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: paulmck <paulmck@kernel.org>, Masami Hiramatsu <mhiramat@kernel.org>
Cc: rostedt <rostedt@goodmis.org>,
	"Joel Fernandes, Google" <joel@joelfernandes.org>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-arch <linux-arch@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Gustavo A. R. Silva" <gustavo@embeddedor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Josh Triplett <josh@joshtriplett.org>,
	Lai Jiangshan <jiangshanlai@gmail.com>
Subject: Re: [PATCH v2 3/9] rcu,tracing: Create trace_rcu_{enter,exit}()
Date: Tue, 18 Feb 2020 11:15:30 -0500 (EST)	[thread overview]
Message-ID: <1841874582.7975.1582042530726.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <20200218161231.GD2935@paulmck-ThinkPad-P72>

----- On Feb 18, 2020, at 11:12 AM, paulmck paulmck@kernel.org wrote:

> On Tue, Feb 18, 2020 at 01:33:35PM +0900, Masami Hiramatsu wrote:
>> On Mon, 17 Feb 2020 08:31:12 -0800
>> "Paul E. McKenney" <paulmck@kernel.org> wrote:
>> > 
>> > > BTW, if you consider the x86 specific code is in the generic file,
>> > > we can move NOKPROBE_SYMBOL() in arch/x86/kernel/traps.c.
>> > > (Sorry, I've hit this idea right now)
>> > 
>> > Might this affect other architectures with NMIs and probe-like things?
>> > If so, it might make sense to leave it where it is.
>> 
>> Yes, git grep shows that arm64 is using rcu_nmi_enter() in
>> debug_exception_enter().
>> OK, let's keep it, but maybe it is good to update the comment for
>> arm64 too. What about following?
>> 
>> +/*
>> + * All functions in do_int3() on x86, do_debug_exception() on arm64 must be
>> + * marked NOKPROBE before kprobes handler is called.
>> + * ist_enter() on x86 and debug_exception_enter() on arm64 which is called
>> + * before kprobes handle happens to call rcu_nmi_enter() which means
>> + * that rcu_nmi_enter() must be marked NOKRPOBE.
>> + */
> 
> Would it work to describe the general problem, then give x86 details
> as a specific example, as follows?
> 
> /*
> * On some architectures, certain exceptions prohibit use of kprobes until
> * the exception code path reaches a certain point.  For example, on x86 all
> * functions called by do_int3() must be marked NOKPROBE.  However, once
> * kprobe_int3_handler() is called, kprobing is permitted.  Specifically,
> * ist_enter() is called in do_int3() before kprobe_int3_handle().
> * Furthermore, ist_enter() calls rcu_nmi_enter(), which means that
> * rcu_nmi_enter() must be marked NOKRPOBE.
> */
> 
> That way, I don't feel like I need to update the commment each time
> a new architecture adds this capability.  ;-)

I suspect this kind of comment would belong in a new
Documentation/features/kprobes/annotations.txt or something
similar. You might want to look at other "features" files to see
the expected layout.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

  reply	other threads:[~2020-02-18 16:15 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 21:01 [PATCH v2 0/9] tracing vs rcu vs nmi Peter Zijlstra
2020-02-12 21:01 ` [PATCH v2 1/9] rcu: Rename rcu_irq_{enter,exit}_irqson() Peter Zijlstra
2020-02-12 22:38   ` Joel Fernandes
2020-02-12 21:01 ` [PATCH v2 2/9] rcu: Mark rcu_dynticks_curr_cpu_in_eqs() inline Peter Zijlstra
2020-02-12 22:38   ` Joel Fernandes
2020-02-13  1:41     ` Steven Rostedt
2020-02-13 14:25       ` Joel Fernandes
2020-02-12 21:01 ` [PATCH v2 3/9] rcu,tracing: Create trace_rcu_{enter,exit}() Peter Zijlstra
2020-02-12 23:20   ` Joel Fernandes
2020-02-13  8:27     ` Peter Zijlstra
2020-02-13 13:31       ` Joel Fernandes
2020-02-13 13:51       ` Paul E. McKenney
2020-02-13 16:40         ` Peter Zijlstra
2020-02-13 18:56           ` Paul E. McKenney
2020-02-13 20:44             ` Joel Fernandes
2020-02-13 20:54               ` Paul E. McKenney
2020-02-13 21:19                 ` Joel Fernandes
2020-02-13 21:38                   ` Steven Rostedt
2020-02-13 21:50                     ` Paul E. McKenney
2020-02-13 22:04                       ` Steven Rostedt
2020-02-13 22:39                         ` Paul E. McKenney
2020-02-14  6:19                           ` Masami Hiramatsu
2020-02-15 14:59                             ` Paul E. McKenney
2020-02-17  8:55                               ` Masami Hiramatsu
2020-02-17 16:31                                 ` Paul E. McKenney
2020-02-18  4:33                                   ` Masami Hiramatsu
2020-02-18 16:12                                     ` Paul E. McKenney
2020-02-18 16:15                                       ` Mathieu Desnoyers [this message]
2020-02-18 16:35                                       ` Steven Rostedt
2020-02-18 17:46                                     ` Steven Rostedt
2020-02-18 20:18                                       ` Paul E. McKenney
2020-02-19  2:45                                         ` Masami Hiramatsu
2020-03-06 18:01                                           ` Masami Hiramatsu
2020-03-06 18:47                                             ` Joel Fernandes
2020-03-06 19:11                                             ` Joel Fernandes
2020-03-07  1:58                                               ` Masami Hiramatsu
2020-03-06  0:42                     ` Thomas Gleixner
2020-02-13 21:48                   ` Paul E. McKenney
2020-02-13 22:58                     ` Joel Fernandes
2020-02-13 23:55                       ` Steven Rostedt
2020-02-18 19:58               ` Peter Zijlstra
2020-02-18 20:17                 ` Paul E. McKenney
2020-02-18 20:40                   ` Peter Zijlstra
2020-02-18 21:39                     ` Paul E. McKenney
2020-02-19  9:57                       ` Peter Zijlstra
2020-02-19 12:46                         ` Paul E. McKenney
2020-02-12 23:27   ` Joel Fernandes
2020-02-13  8:28     ` Peter Zijlstra
2020-02-13 18:39       ` Joel Fernandes
2020-02-12 21:01 ` [PATCH v2 4/9] sched,rcu,tracing: Avoid tracing before in_nmi() is correct Peter Zijlstra
2020-02-12 21:01 ` [PATCH v2 5/9] x86,tracing: Add comments to do_nmi() Peter Zijlstra
2020-02-12 21:01 ` [PATCH v2 6/9] perf,tracing: Prepare the perf-trace interface for RCU changes Peter Zijlstra
2020-02-12 23:28   ` Joel Fernandes
2020-02-13  8:29     ` Peter Zijlstra
2020-02-13 18:38       ` Joel Fernandes
2020-02-12 21:01 ` [PATCH v2 7/9] tracing: Employ trace_rcu_{enter,exit}() Peter Zijlstra
2020-02-12 21:01 ` [PATCH v2 8/9] tracing: Remove regular RCU context for _rcuidle tracepoints (again) Peter Zijlstra
2020-02-12 21:01 ` [PATCH v2 9/9] perf,tracing: Allow function tracing when !RCU Peter Zijlstra
2020-02-14  2:28   ` Sergey Senozhatsky
2020-02-14  2:42     ` Sergey Senozhatsky
2020-02-14  3:32       ` Steven Rostedt
2020-02-14 20:38   ` Kim Phillips
2020-02-14 22:48     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1841874582.7975.1582042530726.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gustavo@embeddedor.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).