linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Olof Johansson <olof@lixom.net>,
	linuxppc-dev@ozlabs.org, paulus@samba.org, anton@samba.org
Subject: Re: [PATCH] [v2] powerpc: save trap number in bad_stack
Date: Mon, 23 Apr 2007 23:33:12 +1000	[thread overview]
Message-ID: <1177335192.10341.2.camel@concordia.ozlabs.ibm.com> (raw)
In-Reply-To: <20070423232217.08e420a6.sfr@canb.auug.org.au>

[-- Attachment #1: Type: text/plain, Size: 1441 bytes --]

On Mon, 2007-04-23 at 23:22 +1000, Stephen Rothwell wrote:
> On Sun, 22 Apr 2007 18:38:21 -0500 olof@lixom.net (Olof Johansson) wrote:
> >
> > --- powerpc.orig/include/asm-powerpc/paca.h
> > +++ powerpc/include/asm-powerpc/paca.h
> > @@ -68,6 +68,7 @@ struct paca_struct {
> >  	void *emergency_sp;		/* pointer to emergency stack */
> >  	u64 data_offset;		/* per cpu data offset */
> >  	s16 hw_cpu_id;			/* Physical processor number */
> > +	u16 trap_save;			/* Used when bad stack is encountered */
> 
> Please read the comment at the top of the struct:
> 
>         /*
>          * Because hw_cpu_id, unlike other paca fields, is accessed
>          * routinely from other CPUs (from the IRQ code), we stick to
>          * read-only (after boot) fields in the first cacheline to
>          * avoid cacheline bouncing.
>          */
> 
> So please move this out of the first cache line.

The only time it's written to is when we detect a bad stack pointer,
after which we promptly panic, so it's essentially read-only (in fact
unused) during normal operation. Plus there's a massive gap there in
paca_struct before the start of the second cacheline.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-04-23 13:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-16  6:23 [PATCH] powerpc: save trap number in bad_stack Olof Johansson
2007-04-19 23:17 ` Benjamin Herrenschmidt
2007-04-20  2:18   ` Michael Ellerman
2007-04-20  8:51     ` Segher Boessenkool
2007-04-22 23:34   ` Olof Johansson
2007-04-22 23:38 ` [PATCH] [v2] " Olof Johansson
2007-04-23  9:29   ` Gabriel Paubert
2007-04-23 11:49     ` Olof Johansson
2007-04-23 12:19   ` [PATCH] [v3] " Olof Johansson
2007-04-23 15:11     ` [PATCH] [v4] " Olof Johansson
2007-04-23 15:34       ` Stephen Rothwell
2007-04-23 13:22   ` [PATCH] [v2] " Stephen Rothwell
2007-04-23 13:33     ` Michael Ellerman [this message]
2007-04-23 13:39     ` David Gibson
2007-04-23 13:54     ` Olof Johansson

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=1177335192.10341.2.camel@concordia.ozlabs.ibm.com \
    --to=michael@ellerman.id.au \
    --cc=anton@samba.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=olof@lixom.net \
    --cc=paulus@samba.org \
    --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).