public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Miroslav Benes <mbenes@suse.cz>
Cc: x86@kernel.org, Dave Jones <davej@codemonkey.org.uk>,
	Dmitry Vyukov <dvyukov@google.com>,
	Andy Lutomirski <luto@amacapital.net>,
	Brian Gerst <brgerst@gmail.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] x86/unwind: include __schedule() in stack traces
Date: Tue, 10 Jan 2017 11:28:49 -0600	[thread overview]
Message-ID: <20170110172849.3rloddujbjhx35g4@treble> (raw)
In-Reply-To: <alpine.LSU.2.20.1701101113170.28763@pobox.suse.cz>

On Tue, Jan 10, 2017 at 11:14:51AM +0100, Miroslav Benes wrote:
> On Mon, 9 Jan 2017, Josh Poimboeuf wrote:
> > Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
> > ---
> >  arch/x86/include/asm/stacktrace.h |  5 +----
> >  arch/x86/include/asm/switch_to.h  | 10 +++++++++-
> >  2 files changed, 10 insertions(+), 5 deletions(-)
> > 
> > diff --git a/arch/x86/include/asm/stacktrace.h b/arch/x86/include/asm/stacktrace.h
> > index 20ce3db..2e41c50 100644
> > --- a/arch/x86/include/asm/stacktrace.h
> > +++ b/arch/x86/include/asm/stacktrace.h
> > @@ -52,16 +52,13 @@ static inline bool on_stack(struct stack_info *info, void *addr, size_t len)
> >  static inline unsigned long *
> >  get_frame_pointer(struct task_struct *task, struct pt_regs *regs)
> >  {
> > -	struct inactive_task_frame *frame;
> > -
> >  	if (regs)
> >  		return (unsigned long *)regs->bp;
> >  
> >  	if (task == current)
> >  		return __builtin_frame_address(0);
> >  
> > -	frame = (struct inactive_task_frame *)task->thread.sp;
> > -	return (unsigned long *)READ_ONCE_NOCHECK(frame->bp);
> > +	return &((struct inactive_task_frame *)task->thread.sp)->bp;
> 
> You effectively remove one of the changes from the previous patch - 
> READ_ONCE_NOCHECK. Is it intentional?

Yes, notice that it's no longer reading the value of bp on the stack.
It's instead getting a pointer to it.  Since there's no longer a stack
access, READ_ONCE_NOCHECK is no longer needed.

-- 
Josh

  reply	other threads:[~2017-01-10 17:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-09 18:00 [PATCH 0/4] x86: unwinder/entry fixes Josh Poimboeuf
2017-01-09 18:00 ` [PATCH 1/4] x86/unwind: silence warnings for non-current tasks Josh Poimboeuf
2017-01-12 10:04   ` [tip:x86/urgent] x86/unwind: Silence " tip-bot for Josh Poimboeuf
2017-01-09 18:00 ` [PATCH 2/4] x86/unwind: disable KASAN checks " Josh Poimboeuf
2017-01-12 10:04   ` [tip:x86/urgent] x86/unwind: Disable " tip-bot for Josh Poimboeuf
2017-01-09 18:00 ` [PATCH 3/4] x86/unwind: include __schedule() in stack traces Josh Poimboeuf
2017-01-10 10:14   ` Miroslav Benes
2017-01-10 17:28     ` Josh Poimboeuf [this message]
2017-01-10 20:02       ` Miroslav Benes
2017-01-12 10:05   ` [tip:x86/urgent] x86/unwind: Include " tip-bot for Josh Poimboeuf
2017-01-09 18:00 ` [PATCH 4/4] x86/entry: fix the end of the stack for newly forked tasks Josh Poimboeuf
2017-01-12 10:05   ` [tip:x86/urgent] x86/entry: Fix " tip-bot for Josh Poimboeuf

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=20170110172849.3rloddujbjhx35g4@treble \
    --to=jpoimboe@redhat.com \
    --cc=brgerst@gmail.com \
    --cc=davej@codemonkey.org.uk \
    --cc=dvyukov@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mbenes@suse.cz \
    --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