public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* NMI vs #PF clash
@ 2012-05-22 12:53 Avi Kivity
  2012-05-22 13:30 ` Steven Rostedt
  2012-06-11  4:24 ` [tip:x86/debug] x86: Save cr2 in NMI in case NMIs take a page fault (for i386) tip-bot for Steven Rostedt
  0 siblings, 2 replies; 18+ messages in thread
From: Avi Kivity @ 2012-05-22 12:53 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: linux-kernel, Ingo Molnar, Linus Torvalds, H. Peter Anvin,
	Thomas Gleixner, Paul Turner, Peter Zijlstra, Frederic Weisbecker,
	Mathieu Desnoyers

The recent changes to NMI allow exceptions to take place in NMI
handlers, but I think that a #PF (say, due to access to vmalloc space)
is still problematic.  Consider the sequence

  #PF  (cr2 set by processor)
    NMI
      ...
      #PF (cr2 clobbered)
        do_page_fault()
        IRET
      ...
      IRET
    do_page_fault()
      address = read_cr2()
 
The last line reads the overwritten cr2 value.

I vaguely remember some discussion about this back in the day, but I
can't find anything in the code to save/restore cr2 in the NMI handler. 
Did I miss it?  Or perhaps the page fault handler ignores the incorrect
cr2 and IRETs, to fault back immediately?

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-06-11  4:24 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-22 12:53 NMI vs #PF clash Avi Kivity
2012-05-22 13:30 ` Steven Rostedt
2012-05-22 13:45   ` Avi Kivity
2012-05-22 14:09     ` Steven Rostedt
2012-05-22 14:20       ` Avi Kivity
2012-05-22 14:27         ` Steven Rostedt
2012-05-22 14:37           ` Avi Kivity
2012-05-22 14:50             ` Steven Rostedt
2012-05-22 15:22               ` Mathieu Desnoyers
2012-05-22 15:33           ` Linus Torvalds
2012-05-22 15:45             ` Avi Kivity
2012-05-22 15:47             ` H. Peter Anvin
2012-05-23  0:39             ` Steven Rostedt
2012-05-23  1:26               ` Brian Gerst
2012-05-23  8:32                 ` Steven Rostedt
2012-05-23  8:56                 ` Steven Rostedt
2012-06-11  4:22                   ` [tip:x86/debug] x86: Save cr2 in NMI in case NMIs take a page fault tip-bot for Steven Rostedt
2012-06-11  4:24 ` [tip:x86/debug] x86: Save cr2 in NMI in case NMIs take a page fault (for i386) tip-bot for Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox