Merge tag 'xtensa-20220325' of https://github.com/jcmvbkbc/linux-xtensa
[sfrench/cifs-2.6.git] / arch / xtensa / kernel / process.c
index bd80df890b1e3a7598dd6a093e2f7ded74dc4552..e8bfbca5f0014faa0910728aa39707d14fb201af 100644 (file)
@@ -232,10 +232,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,
                p->thread.ra = MAKE_RA_FOR_CALL(
                                (unsigned long)ret_from_fork, 0x1);
 
-               /* This does not copy all the regs.
-                * In a bout of brilliance or madness,
-                * ARs beyond a0-a15 exist past the end of the struct.
-                */
                *childregs = *regs;
                childregs->areg[1] = usp;
                childregs->areg[2] = 0;
@@ -265,14 +261,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn,
                        childregs->wmask = 1;
                        childregs->windowstart = 1;
                        childregs->windowbase = 0;
-               } else {
-                       int len = childregs->wmask & ~0xf;
-                       memcpy(&childregs->areg[XCHAL_NUM_AREGS - len/4],
-                              &regs->areg[XCHAL_NUM_AREGS - len/4], len);
                }
 
-               childregs->syscall = regs->syscall;
-
                if (clone_flags & CLONE_SETTLS)
                        childregs->threadptr = tls;
        } else {