From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754315AbcEPOZS (ORCPT ); Mon, 16 May 2016 10:25:18 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34843 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753806AbcEPOZP (ORCPT ); Mon, 16 May 2016 10:25:15 -0400 Date: Mon, 16 May 2016 23:24:53 +0900 From: Namhyung Kim To: Steven Rostedt 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: <20160516142453.GB16239@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> <20160516095833.08478147@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160516095833.08478147@gandalf.local.home> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steve, On Mon, May 16, 2016 at 09:58:33AM -0400, Steven Rostedt wrote: > > 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? Yes, it fixes my problem. Thanks, Namhyung > > 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) >