public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: page align emergency stack
       [not found]     ` <20040716013901.GC24753@zax>
@ 2004-07-19  5:55       ` David Gibson
  0 siblings, 0 replies; only message in thread
From: David Gibson @ 2004-07-19  5:55 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Anton Blanchard, linuxppc64-dev, linux-kernel

On Fri, Jul 16, 2004 at 11:39:01AM +1000, David Gibson wrote:
> 
> On Fri, Jul 16, 2004 at 11:11:41AM +1000, Anton Blanchard wrote:
> >
> >
> > > Do we actually need to do this?  I noted that the old guard pages were
> > > page aligned, but couldn't see any particular reason for it, so I
> > > didn't transfer the alignment to the new version.
> >
> > The ABI requires us to have 128 bit alignment doesnt it? Im thinking
> > about what would happen if we saved altivec registers to the stack.
> 
> Ok, that's not quite the same thing as page alignment...

Ok, here's a patch that just applies the weaker 128-byte alignment
constraint.

Andrew, please apply

The PPC64 ABI requires the stack to be 128 byte aligned (and that can
become important if AltiVec registers are saved there).  In the
kernel, that's usually dealt with by the fact that the stack has a
page more-or-less to itself.  However, the emergency stacks (used in
SMP bringup and when we detect a bad stack pointer) aren't necessarily
page aligned, or anything aligned for that matter.  This patch applies
the necessary alignement constraint to them.

Signed-off-by: David Gibson <dwg@au.ibm.com>

Index: working-2.6/arch/ppc64/kernel/pacaData.c
===================================================================
--- working-2.6.orig/arch/ppc64/kernel/pacaData.c
+++ working-2.6/arch/ppc64/kernel/pacaData.c
@@ -29,8 +29,10 @@
 
 /* Stack space used when we detect a bad kernel stack pointer, and
  * early in SMP boots before relocation is enabled.
+ *
+ * ABI requires stack to be 128-byte aligned
  */
-char emergency_stack[PAGE_SIZE * NR_CPUS];
+char emergency_stack[PAGE_SIZE * NR_CPUS] __attribute__((aligned(128)));
 
 /* The Paca is an array with one entry per processor.  Each contains an 
  * ItLpPaca, which contains the information shared between the 

-- 
David Gibson			| For every complex problem there is a
david AT gibson.dropbear.id.au	| solution which is simple, neat and
				| wrong.
http://www.ozlabs.org/people/dgibson

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-07-19  6:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20040715145708.GG27715@krispykreme>
     [not found] ` <20040716004729.GA24753@zax>
     [not found]   ` <20040716011141.GC17574@krispykreme>
     [not found]     ` <20040716013901.GC24753@zax>
2004-07-19  5:55       ` page align emergency stack David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox