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, 11 Feb 2015 21:17:07 -0500
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Andy Lutomirski <luto@...capital.net>
Cc:	Denys Vlasenko <dvlasenk@...hat.com>,
	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 08/11] x86: entry_64.S: fold test_in_nmi macro into its
 only user

On Wed, 11 Feb 2015 12:40:36 -0800
Andy Lutomirski <luto@...capital.net> wrote:

> On Wed, Jan 14, 2015 at 1:48 PM, Denys Vlasenko <dvlasenk@...hat.com> wrote:
> > No code changes.
> 
> Steven, is this okay with you?

Not as is. The reason I created the macro in the first place was to
give names to values and labels. That is:

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

Shows you that we are comparing the reg to a given stack. And it also
shows us where to jump as a result (normal_ret vs nmi_ret).


We lose that with:

+       cmpq    %rdx, 4*8(%rsp)
+       ja      first_nmi
+       subq    $EXCEPTION_STKSZ, %rdx
+       cmpq    %rdx, 4*8(%rsp)
+       jb      first_nmi
+       jmp     nested_nmi

I'm not against the change. I would like to see some descriptive
comments along with it. Like adding:

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

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