From: Rusty Russell Date: Wed, 2 May 2007 17:27:09 +0000 (+0200) Subject: [PATCH] i386: Initialize esp0 properly all the time X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=692174b97d5b871f4b0f648b1fb17aa37b955876;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] i386: Initialize esp0 properly all the time Whenever we schedule, __switch_to calls load_esp0 which does: tss->esp0 = thread->esp0; This is never initialized for the initial thread (ie "swapper"), so when we're scheduling that, we end up setting esp0 to 0. This is fine: the swapper never leaves ring 0, so this field is never used. lguest, however, gets upset that we're trying to used an unmapped page as our kernel stack. Rather than work around it there, let's initialize it. Signed-off-by: Rusty Russell Signed-off-by: Andi Kleen Cc: Andi Kleen Signed-off-by: Andrew Morton --- diff --git a/include/asm-i386/processor.h b/include/asm-i386/processor.h index 11bf899de8aa..01ae0ffcf236 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-i386/processor.h @@ -421,6 +421,7 @@ struct thread_struct { }; #define INIT_THREAD { \ + .esp0 = sizeof(init_stack) + (long)&init_stack, \ .vm86_info = NULL, \ .sysenter_cs = __KERNEL_CS, \ .io_bitmap_ptr = NULL, \