lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 1 Apr 2015 11:45:49 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Denys Vlasenko <dvlasenk@...hat.com>
Cc:	Ingo Molnar <mingo@...nel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Borislav Petkov <bp@...en8.de>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andy Lutomirski <luto@...capital.net>,
	Oleg Nesterov <oleg@...hat.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Alexei Starovoitov <ast@...mgrid.com>,
	Will Drewry <wad@...omium.org>,
	Kees Cook <keescook@...omium.org>, x86@...nel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [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@...hat.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:

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ