ARC: kernel stack: INIT_THREAD need not setup @init_stack in @ksp
authorVineet Gupta <vgupta@kernel.org>
Thu, 14 May 2020 23:26:45 +0000 (16:26 -0700)
committerVineet Gupta <vgupta@kernel.org>
Fri, 18 Aug 2023 03:31:59 +0000 (20:31 -0700)
There are 2 pointers to kernel mode stack of a task
 - task_struct.stack: base address of stack page (max possible stack top)
 - thread_info.ksp  : runtime stack top in __switch_to

INIT_THREAD was setting up ksp to stack base which was not really needed
 - it would get overwritten with dynamic value on first call to
   __switch_to when init is switched out for the very first time.
 - generic code already does
      init_task.stack = init_stack
   and ARC code uses that to retrieve task's stack base.

Signed-off-by: Vineet Gupta <vgupta@kernel.org>
arch/arc/include/asm/processor.h

index fb844fce1ab671552e4dc3a7dd0384da4c6e6abf..82ddc929d6e73a60dcc5d5c60033464faab068b1 100644 (file)
@@ -33,9 +33,7 @@ struct thread_struct {
 #endif
 };
 
-#define INIT_THREAD  {                          \
-       .ksp = sizeof(init_stack) + (unsigned long) init_stack, \
-}
+#define INIT_THREAD  { }
 
 /* Forward declaration, a strange C thing */
 struct task_struct;