lkml.org 
[lkml]   [2010]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [patch 1/2] x86_64 page fault NMI-safe
    From
    On Thu, Jul 15, 2010 at 3:01 PM, Mathieu Desnoyers
    <mathieu.desnoyers@efficios.com> wrote:
    >
    > . NMI exit code
    > and fake NMI entry are made reentrant with respect to NMI handler interruption
    > by testing, at the very beginning of the NMI handler, if a NMI is nested over
    > the whole nmi_atomic .. nmi_atomic_end code region.

    That is totally bogus. The NMI can be nested by exceptions and
    function calls - the whole _point_ of this thing. So testing "rip" for
    anything else than the specific final "iret" is meaningless. You will
    be in an NMI region regardless of what rip is.

    > This code assumes NMIs have a separate stack.

    It also needs to be made per-cpu (and the flags be per-cpu).

    Then you could in fact possibly test the stack pointer for whether it
    is in the NMI stack area, and use the value of %rsp itself as the
    flag. So you could avoid the flag entirely. Because testing %rsp is
    valid - testing %rip is not.

    That would also avoid the race, because %rsp (as a flag) now gets
    cleared atomically by the "iret". So that might actually solve things.

    Linus


    \
     
     \ /
      Last update: 2010-07-16 00:19    [W:8.477 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site