lkml.org 
[lkml]   [2015]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/asm/entry/64: fold test_in_nmi macro into its only user
On Wed,  1 Apr 2015 16:50:57 +0200
Denys Vlasenko <dvlasenk@redhat.com> wrote:

> - /* runs on exception stack */
> +/* Runs on exception stack */
> ENTRY(nmi)
> INTR_FRAME
> PARAVIRT_ADJUST_EXCEPTION_FRAME
> @@ -1428,8 +1416,18 @@ ENTRY(nmi)
> * We check the variable because the first NMI could be in a
> * breakpoint routine using a breakpoint stack.
> */
> - lea 6*8(%rsp), %rdx
> - test_in_nmi rdx, 4*8(%rsp), nested_nmi, first_nmi
> + lea 6*8(%rsp), %rdx
> + /* Compare the NMI stack (rdx) with the stack we came from (4*8(%rsp)) */
> + cmpq %rdx, 4*8(%rsp)
> + /* If the stack pointer is above the NMI stack, this is a normal NMI */
> + ja first_nmi
> + subq $EXCEPTION_STKSZ, %rdx
> + cmpq %rdx, 4*8(%rsp)
> + /* If it is below the NMI stack, it is a normal NMI */
> + jb first_nmi
> + /* Ah, it is within the NMI stack, treat it as nested */
> + jmp nested_nmi

I guess we can get rid of the jmp nested_nmi, as it just jumps to the
next instruction. Although, I would keep the comment.

-- Steve

> +
> CFI_REMEMBER_STATE
>
> nested_nmi:



\
 
 \ /
  Last update: 2015-04-01 18:21    [W:0.051 / U:0.824 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site