[patch 2/2] xsave: use alloc_bootmem_align() instead of alloc_bootmem()

From: Suresh Siddha
Date: Tue Nov 16 2010 - 16:32:54 EST


Alignment of alloc_bootmem() depends on the value of L1_CACHE_SHIFT. What
we need here is 64byte alignment. Use alloc_bootmem_align() instead.

This fixes a kernel boot crash reported by Jody when the cpu in .config
is set to MPENTIUMII

Reported-by: Jody Bruchon <jody@xxxxxxxxxxxxx>
Signed-off-by: Suresh Siddha <suresh.b.siddha@xxxxxxxxx>
Acked-by: H. Peter Anvin <hpa@xxxxxxxxxxxxxxx>
---
arch/x86/kernel/xsave.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Index: tree/arch/x86/kernel/xsave.c
===================================================================
--- tree.orig/arch/x86/kernel/xsave.c
+++ tree/arch/x86/kernel/xsave.c
@@ -394,7 +394,8 @@ static void __init setup_xstate_init(voi
* Setup init_xstate_buf to represent the init state of
* all the features managed by the xsave
*/
- init_xstate_buf = alloc_bootmem(xstate_size);
+ init_xstate_buf = alloc_bootmem_align(xstate_size,
+ __alignof__(struct xsave_struct));
init_xstate_buf->i387.mxcsr = MXCSR_DEFAULT;

clts();


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/