lkml.org 
[lkml]   [2011]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[RFC][PATCH 2/5 v2] x86: Document the NMI handler about not using paranoid_exit
    From: Steven Rostedt <srostedt@redhat.com>

    Linus cleaned up the NMI handler but it still needs some comments to
    explain why it uses save_paranoid but not paranoid_exit. Just to keep
    others from adding that in the future, document why it's not used.

    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Andi Kleen <andi@firstfloor.org>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    ---
    arch/x86/kernel/entry_64.S | 9 ++++++++-
    1 files changed, 8 insertions(+), 1 deletions(-)

    diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
    index 3819ea9..d1d5434 100644
    --- a/arch/x86/kernel/entry_64.S
    +++ b/arch/x86/kernel/entry_64.S
    @@ -1480,9 +1480,16 @@ END(error_exit)
    ENTRY(nmi)
    INTR_FRAME
    PARAVIRT_ADJUST_EXCEPTION_FRAME
    - pushq_cfi $-1
    + pushq_cfi $-1 /* ORIG_RAX: no syscall to restart */
    subq $ORIG_RAX-R15, %rsp
    CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15
    + /*
    + * Use save_paranoid to handle SWAPGS, but no need to use paranoid_exit
    + * as we should not be calling schedule in NMI context.
    + * Even with normal interrupts enabled. An NMI should not be
    + * setting NEED_RESCHED or anything that normal interrupts and
    + * exceptions might do.
    + */
    call save_paranoid
    DEFAULT_FRAME 0
    /* paranoidentry do_nmi, 0; without TRACE_IRQS_OFF */
    --
    1.7.7.3



    \
     
     \ /
      Last update: 2011-12-14 03:55    [W:0.023 / U:0.128 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site