lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <522406EB-8788-47F1-B616-0A6338A03304@joelfernandes.org>
Date:   Mon, 10 Feb 2020 21:32:23 -0500
From:   joel@...lfernandes.org
To:     Steven Rostedt <rostedt@...dmis.org>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
CC:     linux-kernel <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        "Gustavo A. R. Silva" <gustavo@...eddedor.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        paulmck <paulmck@...nel.org>,
        Josh Triplett <josh@...htriplett.org>,
        Lai Jiangshan <jiangshanlai@...il.com>
Subject: Re: [PATCH] tracing/perf: Move rcu_irq_enter/exit_irqson() to perf trace point hook



On February 10, 2020 9:22:22 PM EST, Steven Rostedt <rostedt@...dmis.org> wrote:
>
>> Which brings a question about handling of NMIs: in the proposed
>patch, if
>> a NMI nests over rcuidle context, AFAIU it will be in a state
>> !rcu_is_watching() && in_nmi(), which is handled by this patch with a
>simple
>> "return", meaning important NMIs doing hardware event sampling can be
>> completely lost.
>> 
>> Considering that we cannot use rcu_irq_enter/exit_irqson() from NMI
>context,
>> is it at all valid to use rcu_read_lock/unlock() as perf does from
>NMI handlers,
>> considering that those can be nested on top of rcuidle context ?
>> 
>
>Note, in the __DO_TRACE macro, we've had this for a long time:
>
>		/* srcu can't be used from NMI */			\
>		WARN_ON_ONCE(rcuidle && in_nmi());			\
>
>With nothing triggering.

I did not understand Mathieu's question, afaik perf event sampling code in NMI handler does not invoke trace_..._rcuidle functions anywhere. That afair is independently dealt within perf and does not involve tracepoint code. And if NMI has interrupted any code currently running in __DO_TRACE, that's ok because NMI is higher priority and will run to completion before resuming the interrupted code. Did I miss something? I am not surprised the warning doesn't ever trigger.

Thanks,
Joel.


>
>-- Steve

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ