Re: [PATCH] x86/asm/entry/64: fold test_in_nmi macro into its only user

From: Steven Rostedt
Date: Wed Apr 01 2015 - 11:45:57 EST


On Wed, 1 Apr 2015 16:50:57 +0200
Denys Vlasenko <dvlasenk@xxxxxxxxxx> 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:

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/