]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sparc64: get rid of fake_swapper_regs
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 19 Aug 2020 21:50:40 +0000 (17:50 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 4 Jan 2021 01:10:54 +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/thread_info_64.h
arch/sparc/kernel/head_64.S
arch/sparc/kernel/setup_64.c

index 42cd4cd3892e32a9adacad7ba1d4fb208369691c..8047a9caab2fc86a35e684a98e2c1deff54e923a 100644 (file)
@@ -118,6 +118,7 @@ struct thread_info {
        .task           =       &tsk,                   \
        .current_ds     =       ASI_P,                  \
        .preempt_count  =       INIT_PREEMPT_COUNT,     \
+       .kregs          =       (struct pt_regs *)(init_stack+THREAD_SIZE)-1 \
 }
 
 /* how to get the thread information struct from C */
index c5ff2472b3d9d4e53385da0536802b387f123f75..72a5bdc833ea22f0800663c354cba188fad83243 100644 (file)
@@ -706,7 +706,7 @@ tlb_fixup_done:
        wr      %g0, ASI_P, %asi
        mov     1, %g1
        sllx    %g1, THREAD_SHIFT, %g1
-       sub     %g1, (STACKFRAME_SZ + STACK_BIAS), %g1
+       sub     %g1, (STACKFRAME_SZ + STACK_BIAS + TRACEREG_SZ), %g1
        add     %g6, %g1, %sp
 
        /* Set per-cpu pointer initially to zero, this makes
index d87244197d5cbb56fec92223c3b5c7ead0352b63..48abee4eee29d8589d9452029f109e102f63f91a 100644 (file)
@@ -165,8 +165,6 @@ extern int root_mountflags;
 
 char reboot_command[COMMAND_LINE_SIZE];
 
-static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 };
-
 static void __init per_cpu_patch(void)
 {
        struct cpuid_patch_entry *p;
@@ -661,8 +659,6 @@ void __init setup_arch(char **cmdline_p)
        rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK;
 #endif
 
-       task_thread_info(&init_task)->kregs = &fake_swapper_regs;
-
 #ifdef CONFIG_IP_PNP
        if (!ic_set_manually) {
                phandle chosen = prom_finddevice("/chosen");