mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC][PATCH 5/5] ftrace/x86-32: Add -mfentry support to x86_32 with DYNAMIC_FTRACE set
Date: Wed, 15 Mar 2017 16:55:45 -0500	[thread overview]
Message-ID: <20170315215545.co7elr7b3lguwaiu@treble> (raw)
In-Reply-To: <20170315200255.828608428@goodmis.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

  reply	other threads:[~2017-03-15 21:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-15 19:55 [RFC][PATCH 0/5] ftrace/x86_32: Ftrace cleanup and add support for -mfentry Steven Rostedt
2017-03-15 19:55 ` [RFC][PATCH 1/5] x86/ftrace: Rename mcount_64.S to ftrace.S Steven Rostedt
2017-03-15 19:55 ` [RFC][PATCH 2/5] ftrace/x86-32: Move the ftrace specific code out of entry_32.S Steven Rostedt
2017-03-15 19:55 ` [RFC][PATCH 3/5] ftrace/x86_32: Add stack frame pointer to ftrace_caller Steven Rostedt
2017-03-15 21:13   ` Josh Poimboeuf
2017-03-15 19:55 ` [RFC][PATCH 4/5] ftrace/x86_32: Clean up ftrace_regs_caller Steven Rostedt
2017-03-15 21:13   ` Josh Poimboeuf
2017-03-15 23:11     ` Steven Rostedt
2017-03-16  8:39       ` Masami Hiramatsu
2017-03-15 19:55 ` [RFC][PATCH 5/5] ftrace/x86-32: Add -mfentry support to x86_32 with DYNAMIC_FTRACE set Steven Rostedt
2017-03-15 21:55   ` Josh Poimboeuf [this message]
2017-03-15 23:13     ` Steven Rostedt
2017-03-16  9:24   ` Masami Hiramatsu
2017-03-16 13:02     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170315215545.co7elr7b3lguwaiu@treble \
    --to=jpoimboe@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®