lkml.org 
[lkml]   [2013]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: Remove WARN_ON(in_nmi()) from vmalloc_fault
On Wed, 16 Oct 2013 13:40:37 +0200
Frederic Weisbecker <fweisbec@gmail.com> wrote:

> On Tue, Oct 15, 2013 at 04:39:06PM -0400, Steven Rostedt wrote:
> > Since the NMI iretq nesting has been fixed, there's no reason that
> > an NMI handler can not take a page fault for vmalloc'd code. No locks
> > are taken in that code path, and the software now handles nested NMIs
> > when the fault re-enables NMIs on iretq.
> >
> > Not only that, if the vmalloc_fault() WARN_ON_ONCE() is hit, and that
> > warn on triggers a vmalloc fault for some reason, then we can go into
> > an infinite loop (the WARN_ON_ONCE() does the WARN() before updating
> > the variable to make it happen "once").
> >
> > Reported-by: "Liu, Chuansheng" <chuansheng.liu@intel.com>
> > Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
>
> Thanks! For now we probably indeed want this patch. But I hope it's only
> for the short term.

Why?

>
> I still think that allowing faults in NMIs is very nasty, as we expect NMIs to never
> be disturbed.

We do faults (well, breakpoints really) in NMI to enable tracing.

> I'm not even sure if that interacts correctly with the rcu_nmi_enter()
> and preempt_count & NMI_MASK things. Not sure how perf is ready for that either (now
> hardware events can be interrupted by fault trace events).

I'm a bit confused. What doesn't interact correctly with
rcu_nmi_enter()?

>
> So I hope we can think about something else for the long term.

I still don't understand what's wrong with it. As long as the faulting
code does not grab any locks there shouldn't be anything wrong with
faulting in NMI. For vmalloc, it is just updating page tables.

-- Steve


\
 
 \ /
  Last update: 2013-10-16 15:21    [W:0.070 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site