mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Chen Zhongjin <chenzhongjin@huawei.com>
Cc: <linux-kernel@vger.kernel.org>, <jpoimboe@kernel.org>,
	<peterz@infradead.org>, <tglx@linutronix.de>, <mingo@redhat.com>,
	<bp@alien8.de>, <dave.hansen@linux.intel.com>, <x86@kernel.org>,
	<hpa@zytor.com>
Subject: Re: [PATCH] x86/unwind/orc: unwind ftrace trampolines with correct orc
Date: Thu, 18 Aug 2022 09:59:44 -0400	[thread overview]
Message-ID: <20220818095944.5fbe3e8e@gandalf.local.home> (raw)
In-Reply-To: <24556707-99b3-ec3c-c176-cb73e1d030d8@huawei.com>

On Thu, 18 Aug 2022 11:42:17 +0800
Chen Zhongjin <chenzhongjin@huawei.com> wrote:

> Thanks for review!
> 
> 
> On 2022/8/18 10:28, Steven Rostedt wrote:
> > On Thu, 18 Aug 2022 09:55:25 +0800
> > Chen Zhongjin <chenzhongjin@huawei.com> wrote:
> >
> >  
> >>   arch/x86/kernel/unwind_orc.c | 13 ++++++++-----
> >>   1 file changed, 8 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
> >> index 38185aedf7d1..a938c5d0ed6f 100644
> >> --- a/arch/x86/kernel/unwind_orc.c
> >> +++ b/arch/x86/kernel/unwind_orc.c
> >> @@ -93,22 +93,25 @@ static struct orc_entry *orc_find(unsigned long ip);
> >>   static struct orc_entry *orc_ftrace_find(unsigned long ip)
> >>   {
> >>   	struct ftrace_ops *ops;
> >> -	unsigned long caller;
> >> +	unsigned long tramp_addr, offset;
> >>   
> >>   	ops = ftrace_ops_trampoline(ip);
> >>   	if (!ops)
> >>   		return NULL;
> >>     
> > Now if this is that unlikely recursion mentioned below then ops->trampoline
> > will be NULL, and if we do that offset addition, it will be incorrect.
> >
> > Perhaps we should add here:
> >
> > 	if (!ops->trampoline)
> > 		return NULL;  
> 
> I think when this will return NULL and then stop at orc_find:`if (ip == 
> 0)` and return null_orc_entry.
> 

Duh, you're correct. I wasn't paying attention to how we acquired ops. Yes,
if ops->trampoline is NULL, then it will never be returned by
ftrace_ops_trampoline().
 
> >
> > Let's add some comments.  
> 
> Makes sense.
> 
> If the above explanation logic is fine, I'll add this comment and send v2.
> 

Yes, just add the comments for v2.

Thanks,

-- Steve

      reply	other threads:[~2022-08-18 14:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-18  1:55 Chen Zhongjin
2022-08-18  2:28 ` Steven Rostedt
2022-08-18  3:42   ` Chen Zhongjin
2022-08-18 13:59     ` Steven Rostedt [this message]

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=20220818095944.5fbe3e8e@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bp@alien8.de \
    --cc=chenzhongjin@huawei.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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®