From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754182AbdCOVzt (ORCPT ); Wed, 15 Mar 2017 17:55:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38044 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753314AbdCOVzs (ORCPT ); Wed, 15 Mar 2017 17:55:48 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 40C7281233 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jpoimboe@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 40C7281233 Date: Wed, 15 Mar 2017 16:55:45 -0500 From: Josh Poimboeuf To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Thomas Gleixner , Peter Zijlstra , Masami Hiramatsu , "H. Peter Anvin" , Andy Lutomirski , Linus Torvalds Subject: Re: [RFC][PATCH 5/5] ftrace/x86-32: Add -mfentry support to x86_32 with DYNAMIC_FTRACE set Message-ID: <20170315215545.co7elr7b3lguwaiu@treble> References: <20170315195527.703131481@goodmis.org> <20170315200255.828608428@goodmis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170315200255.828608428@goodmis.org> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 15 Mar 2017 21:55:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 15, 2017 at 03:55:32PM -0400, Steven Rostedt wrote: > +#ifdef USING_FRAME_POINTER > +# ifdef CC_USING_FENTRY > + /* > + * Frame pointers are of ip followed by bp. > + * Since fentry is an immediate jump, we are left with > + * parent-ip, function-ip. We need to add a frame with > + * parent-ip followed by ebp. > + */ > + pushl 4(%esp) /* parent ip */ > pushl %ebp > movl %esp, %ebp > - > + pushl 2*4(%esp) /* function ip */ > +# endif > + /* For mcount, the function ip is directly above */ > + pushl %ebp > + movl %esp, %ebp > +#endif More vertical operand alignment issues. > @@ -85,6 +140,10 @@ ENTRY(ftrace_regs_caller) > pushl %edx > pushl %ecx > pushl %ebx > +#ifndef USING_FRAME_POINTER > + /* Load 4 off of the parent ip addr into ebp */ > + lea 14*4(%esp), %ebp > +#endif Instead of: #ifndef USING_FRAME_POINTER Shouldn't it be: #ifdef CC_USING_FENTRY ? Otherwise, if I'm reading it right, with fentry and CONFIG_FRAME_POINTER=y, ebp will lead to the grandparent's ip instead of the parent's ip. -- Josh