From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757438AbcGZRvn (ORCPT ); Tue, 26 Jul 2016 13:51:43 -0400 Received: from smtprelay0018.hostedemail.com ([216.40.44.18]:38509 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754595AbcGZRvk (ORCPT ); Tue, 26 Jul 2016 13:51:40 -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:2198:2199:2393:2553:2559:2562:2692:2693:2895:2904:2909:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4303:4321:5007:6261:6742:7875:7903:8784:10004:10400:10848:10967:11232:11658:11914:12296:12517:12519:12740:13069:13161:13229:13311:13357:13439:14181:14659:14721:14802:21080:30012:30016:30054:30070:30079:30090:30091,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,LFtime:3,LUA_SUMMARY:none X-HE-Tag: wren06_470c42c618c1f X-Filterd-Recvd-Size: 3077 Date: Tue, 26 Jul 2016 13:51:27 -0400 From: Steven Rostedt To: Josh Poimboeuf Cc: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , X86 ML , "linux-kernel@vger.kernel.org" , Linus Torvalds , Brian Gerst , Kees Cook , Peter Zijlstra , Frederic Weisbecker , Byungchul Park Subject: Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface Message-ID: <20160726135127.5e3daf44@gandalf.local.home> In-Reply-To: <20160726162642.e3ro4ynrgex74232@treble> References: <88568c51f1a253210897e368262d0f5fa1d7e97a.1469136008.git.jpoimboe@redhat.com> <20160722235459.xtikpj263hroloqo@treble> <20160723140439.36bhw5aslcxlkf3f@treble> <20160726162642.e3ro4ynrgex74232@treble> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; 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 On Tue, 26 Jul 2016 11:26:42 -0500 Josh Poimboeuf wrote: > Ok, I think that makes sense to me now. As I understand it, the > "outermost" RIP is the authoritative one, because it was written by the > original NMI. Any nested NMIs will update the original and/or iret > RIPs, which will only ever point to NMI entry code, and so they should > be ignored. Just to confirm: -- top-of-stack -- [ hardware written stack ] <- what the NMI hardware mechanism wrote [ internal variables ] <- you don't need to know what this is [ where to go next ] <- the stack to use to return on current NMI [ original copy of hardware stack ] <- the stack of the first NMI IIRC, the original version had the "where to go next" stack last, but to keep pt_regs in line with the stack, it made sense to have the original NMI stack at the bottom, just above pt_regs, like a real interrupt would. > > But I think there's a case where this wouldn't work: > > task stack > NMI > IST > stack dump > > If the IST interrupt hits before the NMI has a chance to update the > outermost regs, the authoritative RIP would be the original one written > by HW, right? The only IST interrupt that would hit there is MCE and it would probably be a critical error. Do we really need to worry about such an unlikely scenario? The system is probably doomed anyway. -- Steve