[POWERPC] Fix kernel stack allocation alignment
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 18 Apr 2008 06:56:17 +0000 (16:56 +1000)
committerPaul Mackerras <paulus@samba.org>
Thu, 24 Apr 2008 10:57:33 +0000 (20:57 +1000)
commitf6a616800e68b61807d0f7bb0d5dc70665ef8046
tree62f8224cb6a7da0bc203de1be8a7f3485f4b583b
parent8c9843e57a7d9d7a090d6467a0f1f3afb8031527
[POWERPC] Fix kernel stack allocation alignment

The powerpc kernel stacks need to be naturally aligned, as they
contain the thread info at the bottom, which is obtained by
clearing the low bits of the stack pointer.

However, when using 64K pages, the stack is smaller than a page,
so we use kmalloc to allocate it, but that doesn't provide the
alignment guarantee we need.

It appeared to work so far... until one enables SLUB debugging
which then returns unaligned pointers.  Ooops...

This fixes it by using a slab cache with enforced alignment.  It
relies on my previous patch that adds a thread_info_cache_init()
callback.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/process.c
include/asm-powerpc/thread_info.h