From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751059AbcHAO2j (ORCPT ); Mon, 1 Aug 2016 10:28:39 -0400 Received: from smtprelay0001.hostedemail.com ([216.40.44.1]:45880 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751954AbcHAO20 (ORCPT ); Mon, 1 Aug 2016 10:28:26 -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:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:5007:6117:6119:6261:6742:7875:7903:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12296:12438:12517:12519:12740:13069:13138:13231:13255:13311:13357:13439:14096:14097:14181:14659:14721:21080:30003:30012:30036:30045:30054:30070: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: shelf98_6655cd1183e31 X-Filterd-Recvd-Size: 3293 Date: Mon, 1 Aug 2016 10:28:21 -0400 From: Steven Rostedt To: Josh Poimboeuf Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Linus Torvalds , Brian Gerst , Kees Cook , Peter Zijlstra , Frederic Weisbecker , Byungchul Park Subject: Re: [PATCH 05/19] x86/dumpstack: fix function graph tracing stack dump reliability issues Message-ID: <20160801102821.1d6261a9@gandalf.local.home> In-Reply-To: <20160730135125.qqw5qz24szlc2crz@treble> References: <20160729185521.62a5cd2a@gandalf.local.home> <20160730005059.5krpl2xsvqfbnntj@treble> <20160729222036.340b51ce@grimm.local.home> <20160730135125.qqw5qz24szlc2crz@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 Sat, 30 Jul 2016 08:51:25 -0500 Josh Poimboeuf wrote: > On Fri, Jul 29, 2016 at 10:20:36PM -0400, Steven Rostedt wrote: > > On Fri, 29 Jul 2016 19:50:59 -0500 > > Josh Poimboeuf wrote: > > > > > BTW, it would be really nice if ftrace_graph_ret_addr() were idempotent > > > so we could get the "real" return address without having to pass in a > > > state variable. > > > > > > For example we could add an "unsigned long *retp" pointer to > > > ftrace_ret_stack, which points to the return address on the stack. Then > > > we could get rid of the index state variable in ftrace_graph_ret_addr, > > > and also then there would never be a chance of the stack dump getting > > > out of sync with the ret_stack. > > > > > > What do you think? > > > > > > > I don't want to extend ret_stack as that is allocated 50 of these > > structures for every task. That said, we have the "fp" field that's > > used to check for frame pointer corruption when mcount is used. With > > CC_USING_FENTRY, that field is ignored. Perhaps we could overload that > > field for this. > > In that case, I guess we would need two versions of > ftrace_graph_ret_addr(), with the current implementation still needed > for mcount+HAVE_FUNCTION_GRAPH_FP_TEST. How hard would it be in that case? > > Or would you want to get rid of HAVE_FUNCTION_GRAPH_FP_TEST for x86? No, because there's gcc versions that we still support that mess up mcount, and could still cause issues with function graph. > > BTW, on a different note, should I put ftrace_graph_ret_addr() to > kernel/trace/trace_functions_graph.c so other arches can use it? > I guess you could. There doesn't seem to be any x86 specific code in that right? -- Steve