From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756531AbcG1Sjl (ORCPT ); Thu, 28 Jul 2016 14:39:41 -0400 Received: from smtprelay0106.hostedemail.com ([216.40.44.106]:34266 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753876AbcG1Sjh (ORCPT ); Thu, 28 Jul 2016 14:39:37 -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:3865:3866:3867:3868:3870:3872:3874:4250:4321:5007:6119:6261:7875:10004:10400:10848:10967:11026:11232:11473:11658:11914:12043:12219:12296:12438:12517:12519:12555:12663:12740:13069:13255:13311:13357:13439:14181:14659:14721:21080:30054:30074: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:8,LUA_SUMMARY:none X-HE-Tag: music05_195e3d54a4233 X-Filterd-Recvd-Size: 2824 Date: Thu, 28 Jul 2016 14:39:33 -0400 From: Steven Rostedt To: Jiri Olsa Cc: lkml , Ingo Molnar , Michael Grundy , Martin Schwidefsky , Masami Hiramatsu Subject: Re: [PATCH] ftrace/jprobes/s390: Fix conflict between jprobes and function graph tracing Message-ID: <20160728143933.1a2abc97@gandalf.local.home> In-Reply-To: <1468848401-8091-1-git-send-email-jolsa@kernel.org> References: <1468848401-8091-1-git-send-email-jolsa@kernel.org> 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 Mon, 18 Jul 2016 15:26:41 +0200 Jiri Olsa wrote: > This fixes the same issue Steven already fixed for x86 > in following commit: > > 237d28db036e ftrace/jprobes/x86: Fix conflict between jprobes and function graph tracing > > It fixes the crash, that happens when function graph tracing > and jprobes are used simultaneously. Please refer to above > commit for details. I'm guessing that this should go in via the s390 tree. Acked-by: Steven Rostedt -- Steve > > Signed-off-by: Jiri Olsa > --- > arch/s390/kernel/kprobes.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c > index 250f5972536a..dd6306c51bd6 100644 > --- a/arch/s390/kernel/kprobes.c > +++ b/arch/s390/kernel/kprobes.c > @@ -690,6 +690,15 @@ int setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs) > stack = (unsigned long) regs->gprs[15]; > > memcpy(kcb->jprobes_stack, (void *) stack, MIN_STACK_SIZE(stack)); > + > + /* > + * jprobes use jprobe_return() which skips the normal return > + * path of the function, and this messes up the accounting of the > + * function graph tracer to get messed up. > + * > + * Pause function graph tracing while performing the jprobe function. > + */ > + pause_graph_tracing(); > return 1; > } > NOKPROBE_SYMBOL(setjmp_pre_handler); > @@ -705,6 +714,9 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs) > struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); > unsigned long stack; > > + /* It's OK to start function graph tracing again */ > + unpause_graph_tracing(); > + > stack = (unsigned long) kcb->jprobe_saved_regs.gprs[15]; > > /* Put the regs back */