]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
openrisc: Fix issue with argument clobbering for clone/fork
authorStafford Horne <shorne@gmail.com>
Wed, 22 Apr 2020 11:24:11 +0000 (20:24 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jun 2020 13:41:56 +0000 (15:41 +0200)
[ Upstream commit 6bd140e14d9aaa734ec37985b8b20a96c0ece948 ]

Working on the OpenRISC glibc port I found that sometimes clone was
working strange.  That the tls data argument sent in r7 was always
wrong.  Further investigation revealed that the arguments were getting
clobbered in the entry code.  This patch removes the code that writes to
the argument registers.  This was likely due to some old code hanging
around.

This patch fixes this up for clone and fork.  This fork clobber is
harmless but also useless so remove.

Signed-off-by: Stafford Horne <shorne@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/openrisc/kernel/entry.S

index 1107d34e45bf14d25f57757a567d8e7927d6a325..0fdfa7142f4b3b9d21018093462a9e42ad2ac2e6 100644 (file)
@@ -1102,13 +1102,13 @@ ENTRY(__sys_clone)
        l.movhi r29,hi(sys_clone)
        l.ori   r29,r29,lo(sys_clone)
        l.j     _fork_save_extra_regs_and_call
-        l.addi r7,r1,0
+        l.nop
 
 ENTRY(__sys_fork)
        l.movhi r29,hi(sys_fork)
        l.ori   r29,r29,lo(sys_fork)
        l.j     _fork_save_extra_regs_and_call
-        l.addi r3,r1,0
+        l.nop
 
 ENTRY(sys_rt_sigreturn)
        l.jal   _sys_rt_sigreturn