Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752506AbbDAPpy (ORCPT ); Wed, 1 Apr 2015 11:45:54 -0400 Received: from smtprelay0199.hostedemail.com ([216.40.44.199]:44901 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751406AbbDAPpx (ORCPT ); Wed, 1 Apr 2015 11:45:53 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:3138:3139:3140:3141:3142:3353:3622:3653:3865:3866:3867:3870:3871:3872:4250:5007:6117:6119:6261:6742:7875:7903:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12295:12296:12438:12517:12519:12740:13069:13311:13357:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: sort96_15f0af43d052c X-Filterd-Recvd-Size: 2318 Date: Wed, 1 Apr 2015 11:45:49 -0400 From: Steven Rostedt To: Denys Vlasenko Cc: Ingo Molnar , Linus Torvalds , Borislav Petkov , "H. Peter Anvin" , Andy Lutomirski , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/asm/entry/64: fold test_in_nmi macro into its only user Message-ID: <20150401114549.26323d25@gandalf.local.home> In-Reply-To: <1427899858-7165-1-git-send-email-dvlasenk@redhat.com> References: <1427899858-7165-1-git-send-email-dvlasenk@redhat.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1312 Lines: 41 On Wed, 1 Apr 2015 16:50:57 +0200 Denys Vlasenko 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/