From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754019AbcEPN6k (ORCPT ); Mon, 16 May 2016 09:58:40 -0400 Received: from smtprelay0033.hostedemail.com ([216.40.44.33]:37327 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753410AbcEPN6h (ORCPT ); Mon, 16 May 2016 09:58: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:1183: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:3352:3865:3867:3868:3871:3872:3873:4321:4605:5007:6119:6261:7875:7903:9040:10004:10400:10848:10967:11026:11232:11658:11914:12296:12517:12519:12555:12740:13069:13311:13357:13439:14096:14097:14181:14659:14721:21080:30012:30054:30056: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:2,LUA_SUMMARY:none X-HE-Tag: spoon51_10c9ae2f28f21 X-Filterd-Recvd-Size: 2192 Date: Mon, 16 May 2016 09:58:33 -0400 From: Steven Rostedt To: Namhyung Kim Cc: Masami Hiramatsu , LKML , Ingo Molnar , x86@kernel.org, Borislav Petkov , "H.J. Lu" Subject: Re: [PATCH] ftrace/x86: Fix function graph tracer reset path Message-ID: <20160516095833.08478147@gandalf.local.home> In-Reply-To: <20160516123250.GA16239@danjae.aot.lge.com> References: <1463147623-2575-1-git-send-email-namhyung@kernel.org> <20160515094141.0cff3ee44f1f0fa101b98b02@kernel.org> <20160515130652.GA7745@danjae.aot.lge.com> <20160516175614.53e0ceed3ec0880526fa1799@kernel.org> <20160516123250.GA16239@danjae.aot.lge.com> 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 Nice work Masami! On Mon, 16 May 2016 21:32:50 +0900 Namhyung Kim wrote: > > -/* This is global to keep gas from relaxing the jumps */ > > -ENTRY(early_idt_handler) > > +/* This is weak to keep gas from relaxing the jumps */ > > +WEAK(early_idt_handler) > > cld > So IIUC, this -mshared option disables the optimization on branch > instructions and generates slightly bigger code. Not sure how much > affected by this though. > > Steve, do you think it's better to use this option? Can we solve this by doing the same thing it did for the kernel? -- Steve diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S index ed48a9f465f8..e13a695c3084 100644 --- a/arch/x86/kernel/mcount_64.S +++ b/arch/x86/kernel/mcount_64.S @@ -182,7 +182,8 @@ GLOBAL(ftrace_graph_call) jmp ftrace_stub #endif -GLOBAL(ftrace_stub) +/* This is weak to keep gas from relaxing the jumps */ +WEAK(ftrace_stub) retq END(ftrace_caller)