[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrU-CMPSHJg6oDd5mwbZcWnsmfo7F4b8Qb+qkc6j4w3dFA@mail.gmail.com>
Date: Mon, 23 Feb 2015 16:34:15 -0800
From: Andy Lutomirski <luto@...capital.net>
To: Denys Vlasenko <dvlasenk@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Oleg Nesterov <oleg@...hat.com>,
Borislav Petkov <bp@...en8.de>,
"H. Peter Anvin" <hpa@...or.com>,
Frederic Weisbecker <fweisbec@...il.com>,
X86 ML <x86@...nel.org>, Alexei Starovoitov <ast@...mgrid.com>,
Will Drewry <wad@...omium.org>,
Kees Cook <keescook@...omium.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/6] x86: entry_64.S: fold test_in_nmi macro into its only user
On Mon, Feb 23, 2015 at 4:12 PM, Denys Vlasenko <dvlasenk@...hat.com> wrote:
> No code changes.
This needs to address Steven's comments, I think, and I'd like his ack, too.
--Andy
>
> Signed-off-by: Denys Vlasenko <dvlasenk@...hat.com>
> CC: Linus Torvalds <torvalds@...ux-foundation.org>
> CC: Oleg Nesterov <oleg@...hat.com>
> CC: Borislav Petkov <bp@...en8.de>
> CC: "H. Peter Anvin" <hpa@...or.com>
> CC: Andy Lutomirski <luto@...capital.net>
> CC: Frederic Weisbecker <fweisbec@...il.com>
> CC: X86 ML <x86@...nel.org>
> CC: Alexei Starovoitov <ast@...mgrid.com>
> CC: Will Drewry <wad@...omium.org>
> CC: Kees Cook <keescook@...omium.org>
> CC: linux-kernel@...r.kernel.org
> ---
> arch/x86/kernel/entry_64.S | 24 +++++++++---------------
> 1 file changed, 9 insertions(+), 15 deletions(-)
>
> diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
> index 03498d0..c628a1b 100644
> --- a/arch/x86/kernel/entry_64.S
> +++ b/arch/x86/kernel/entry_64.S
> @@ -1378,19 +1378,7 @@ ENTRY(error_exit)
> CFI_ENDPROC
> END(error_exit)
>
> -/*
> - * Test if a given stack is an NMI stack or not.
> - */
> - .macro test_in_nmi reg stack nmi_ret normal_ret
> - cmpq %\reg, \stack
> - ja \normal_ret
> - subq $EXCEPTION_STKSZ, %\reg
> - cmpq %\reg, \stack
> - jb \normal_ret
> - jmp \nmi_ret
> - .endm
> -
> - /* runs on exception stack */
> +/* Runs on exception stack */
> ENTRY(nmi)
> INTR_FRAME
> PARAVIRT_ADJUST_EXCEPTION_FRAME
> @@ -1451,8 +1439,14 @@ 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
> + cmpq %rdx, 4*8(%rsp)
> + ja first_nmi
> + subq $EXCEPTION_STKSZ, %rdx
> + cmpq %rdx, 4*8(%rsp)
> + jb first_nmi
> + jmp nested_nmi
> +
> CFI_REMEMBER_STATE
>
> nested_nmi:
> --
> 1.8.1.4
>
--
Andy Lutomirski
AMA Capital Management, LLC
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists