linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org, akpm@linux-foundation.org,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] powerpc/64: Initialise thread_info for emergency stacks
Date: Wed, 21 Jun 2017 12:41:41 +1000	[thread overview]
Message-ID: <20170621124141.5a5cde49@roar.ozlabs.ibm.com> (raw)
In-Reply-To: <87shiut7y6.fsf@concordia.ellerman.id.au>

On Wed, 21 Jun 2017 12:01:37 +1000
Michael Ellerman <mpe@ellerman.id.au> wrote:

> Nicholas Piggin <npiggin@gmail.com> writes:
> 
> > diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
> > index a941cc6fc3e9..5995e4b2996d 100644
> > --- a/arch/powerpc/include/asm/thread_info.h
> > +++ b/arch/powerpc/include/asm/thread_info.h
> > @@ -62,6 +63,24 @@ struct thread_info {
> >  
> >  #define THREAD_SIZE_ORDER	(THREAD_SHIFT - PAGE_SHIFT)
> >  
> > +/*
> > + * Emergency stacks are used for a range of things, from asynchronous
> > + * NMIs (system reset, machine check) to synchronous, process context.
> > + * Set HARDIRQ_OFFSET because we don't know exactly what context we
> > + * come from or if it had a valid stack, which is about the best we
> > + * can do.
> > + * TODO: what to do with accounting?
> > + */
> > +#define emstack_init_thread_info(ti, c)		\
> > +do {						\
> > +	(ti)->task = NULL;			\
> > +	(ti)->cpu = (c);			\
> > +	(ti)->preempt_count = HARDIRQ_OFFSET;	\
> > +	(ti)->local_flags = 0;			\
> > +	(ti)->flags = 0;			\
> > +	klp_init_thread_info(ti);		\
> > +} while (0)  
> 
> Why don't we just bzero() the whole thing? Like we do for the other
> stacks?

Wouldn't hurt to.

Thanks,
Nick

  reply	other threads:[~2017-06-21  2:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20 13:58 [PATCH] powerpc/64: Initialise thread_info for emergency stacks Nicholas Piggin
2017-06-21  2:01 ` Michael Ellerman
2017-06-21  2:41   ` Nicholas Piggin [this message]
2017-06-21  9:25 ` Abdul Haleem

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=20170621124141.5a5cde49@roar.ozlabs.ibm.com \
    --to=npiggin@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=sfr@canb.auug.org.au \
    /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;
as well as URLs for NNTP newsgroup(s).