]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sparc32: get rid of fake_swapper_regs
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 19 Aug 2020 22:05:02 +0000 (18:05 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 4 Jan 2021 01:10:55 +0000 (20:10 -0500)
no reason to have ->kregs of initial thread set up in a special
way - we can keep them on stack, same as for every other thread.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/sparc/include/asm/processor_32.h
arch/sparc/kernel/head_32.S
arch/sparc/kernel/process_32.c
arch/sparc/kernel/setup_32.c

index 3c4bc2189092d350b7b6e2c794714f6c7249f692..d7b71d7bed1fc84a0f2419b1993a410d5f1d07ef 100644 (file)
@@ -60,6 +60,7 @@ struct thread_struct {
 #define INIT_THREAD  { \
        .flags = SPARC_FLAG_KTHREAD, \
        .current_ds = KERNEL_DS, \
+       .kregs = (struct pt_regs *)(init_stack+THREAD_SIZE)-1 \
 }
 
 /* Do necessary setup to start up a newly executed thread. */
index be30c8d4cc7373490ed5f8c2ff716aae22f56574..6044b82b976751a8ccbe43ac424bafe8de36af42 100644 (file)
@@ -515,7 +515,7 @@ continue_boot:
 
                /* I want a kernel stack NOW! */
                set     init_thread_union, %g1
-               set     (THREAD_SIZE - STACKFRAME_SZ), %g2
+               set     (THREAD_SIZE - STACKFRAME_SZ - TRACEREG_SZ), %g2
                add     %g1, %g2, %sp
                mov     0, %fp                  /* And for good luck */
 
index a023637359154e9bbd874a574bd9f95ba50c5b10..97549e01f5401e0ebf135d4f81470097693384aa 100644 (file)
@@ -218,14 +218,7 @@ void flush_thread(void)
        }
 
        /* This task is no longer a kernel thread. */
-       if (current->thread.flags & SPARC_FLAG_KTHREAD) {
-               current->thread.flags &= ~SPARC_FLAG_KTHREAD;
-
-               /* We must fixup kregs as well. */
-               /* XXX This was not fixed for ti for a while, worked. Unused? */
-               current->thread.kregs = (struct pt_regs *)
-                   (task_stack_page(current) + (THREAD_SIZE - TRACEREG_SZ));
-       }
+       current->thread.flags &= ~SPARC_FLAG_KTHREAD;
 }
 
 static inline struct sparc_stackf __user *
index eea43a1aef1b9a6fd1e4139dbf118d8e4eafc2ee..c8e0dd99f3700e73851878ca44102f1c7d24fe8f 100644 (file)
@@ -266,7 +266,6 @@ static __init void leon_patch(void)
 }
 
 struct tt_entry *sparc_ttable;
-static struct pt_regs fake_swapper_regs;
 
 /* Called from head_32.S - before we have setup anything
  * in the kernel. Be very careful with what you do here.
@@ -363,8 +362,6 @@ void __init setup_arch(char **cmdline_p)
                (*(linux_dbvec->teach_debugger))();
        }
 
-       init_task.thread.kregs = &fake_swapper_regs;
-
        /* Run-time patch instructions to match the cpu model */
        per_cpu_patch();