This fixes the initial stack alignment for x86, which is required for
current to return a fine NULL instead of a random value or possibly
crash during initialization.
Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
* Just allocate the kernel stack here. SS:ESP is set up to point here
* in head.S.
*/
-char stack[8192];
+char stack[2*8192];
extern char shared_info[PAGE_SIZE];
void
arch_print_info(void)
{
- printk(" stack: %p-%p\n", stack, stack + 8192);
+ printk(" stack: %p-%p\n", stack, stack + 2*8192);
}
_start:
cld
lss stack_start,%esp
+ andl $(~(8192-1)), %esp
push %esi
call start_kernel
stack_start:
- .long stack+8192, __KERNEL_SS
+ .long stack+(2*8192), __KERNEL_SS
/* Unpleasant -- the PTE that maps this page is actually overwritten */
/* to map the real shared-info page! :-) */
_start:
cld
movq stack_start(%rip),%rsp
+ andq $(~(8192-1)), %rsp
movq %rsi,%rdi
call start_kernel
stack_start:
- .quad stack+8192
+ .quad stack+(2*8192)
/* Unpleasant -- the PTE that maps this page is actually overwritten */
/* to map the real shared-info page! :-) */