Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1949ybg; Sun, 31 May 2020 14:45:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwb84tnuefzPfO7HMC/0zrogLKT4jqUq2ZM4bSGz7EuNJ+j9pgjBpEtYkFiHAS7TN+ftO8s X-Received: by 2002:a50:955a:: with SMTP id v26mr19234384eda.5.1590961526894; Sun, 31 May 2020 14:45:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590961526; cv=none; d=google.com; s=arc-20160816; b=OI3PqLn+uAYNkaVkJfXPlzdi5KfOm3brEPj3urXdq+FIRVHE99OFU1wAzLK54iVbaF YgcE5WnL2t78sgkUPAvv7s1sqF8zdz/DfSQSl5+TxqTr8FM2JQu5o0CZUCJkpSB7dLjO Q4VFqPzmgdQl/RBEyNZqO8c6y1lsoOuchOtXyf7UH4kR/zDQXJkIMsrCpq4O9vQUUHCF hl3QwI1Ygf/etTiyzxQfDQK1x+M2oED7EY09sQ/sKSjMxmc39AKu+OjHq0xr9qC8UjRl ppElmWb5U7K29T9ewCgaX1ThQPN6M+P8YzqZt/C3lSPlV5zC9/83XntSuP3huaSsHP/a FL4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kmVcIZYi7tq7zlqymQfKPZksyT7vem5YyJXZwNg7lQI=; b=a8TPAOGDXqvZHOB1ah9/d/JU1TxsC7Dpe2RDYDORobfm/wu+OmxrGUjnQHuw2twJgQ 2x2alaNi7nT+HZDeum/tvDZkpoiRkCYdbB4fWHtd6yD72fETcVysMrLDLOPul6nY1lbt ZoynEJWeB8jAICsvNThaHe6m1vLYVXl7HsBYGfKMGXBNUPxt4b27uDmstDQxFDflfQWJ Th5P1jSFSL71fPW2CN9d8rMNcrvxEBkWobEWRDJupaJgyXdXABKlYuRJuy4OkuSkrP/i mWcnd9BOnKOmZMUUByMh//bbVBW3c2b5VYW+JFXrzX1N+y0NNCVNKSuJI72KM566xh1V TUmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Hi0vkaNb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si838429eds.471.2020.05.31.14.44.52; Sun, 31 May 2020 14:45:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Hi0vkaNb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728402AbgEaVZT (ORCPT + 99 others); Sun, 31 May 2020 17:25:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727000AbgEaVZT (ORCPT ); Sun, 31 May 2020 17:25:19 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39F1AC061A0E for ; Sun, 31 May 2020 14:25:19 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id m7so3440249plt.5 for ; Sun, 31 May 2020 14:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kmVcIZYi7tq7zlqymQfKPZksyT7vem5YyJXZwNg7lQI=; b=Hi0vkaNb3GGHsrGSHuugf23wMme3NulEbti4IQ2YbCAxsNXhjSIK18vi4krqQtD748 KlfjlmpzdclLel58WqNjIC3NIyaQ6cdZ1mXH2TZkMkGkybPkCFvZhuTrfoqSjunUFZBf hCN2zTPhLp4V5tLQDFup9ovG9HG60b+K7KZxg7zKtI7V+J2KCPTsK0ZWd4H6hYCMRAy4 rXJAZpcbyFXgasgeFH/dHFDG2DHSzD5E0NvVePECR7Cd/33DHFIiQeUrG7G3SPZlXLrU COJ7eEIkZiPxPO/JQZWcDBLXXv8+A+lckF4rlYeDvuQIqia0MoINLgl00dMq4UOMh0ny KAbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kmVcIZYi7tq7zlqymQfKPZksyT7vem5YyJXZwNg7lQI=; b=H/0Z2u4vkfLKKAhj0JNLfJkn6IaKs9RHW324KMlpirRIYnyGKUa9JCRurVbxSKMbn/ 5NJR7EesDsVLdocN3H73cqp2IdcvsINWxWavdT9FaO26KdgFpV63uPtSYR/FW4t2wTX+ 5szOFGXqvDH+0YkWkZVl6k1vG89sqrE/bCvoGudq7DrCNt8j2PORrOE4Oftx3bxF724T 7Gkx6ygLtALwf8A2/80B1Pok4C/zDHKC5Qk/KL+JOPEQqZEpN0YBnftM78tmVTOejz+d q8wbZfm1lpdJ92nd0NlbE0oJnl4yRzLdFb/lY1mNPTWfEJlFznxnDFSOmPau/65uvMav qn4A== X-Gm-Message-State: AOAM530WBplxxVxkRQiGu+1l2vur3feDtOX7FotL2I6aPcFehAkd4BQI 4oG1ooP8N8HB/xO1enmv/Tl5D937 X-Received: by 2002:a17:902:720c:: with SMTP id ba12mr16829465plb.97.1590960318237; Sun, 31 May 2020 14:25:18 -0700 (PDT) Received: from localhost (g228.115-65-196.ppp.wakwak.ne.jp. [115.65.196.228]) by smtp.gmail.com with ESMTPSA id i21sm11122876pgn.20.2020.05.31.14.25.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 May 2020 14:25:17 -0700 (PDT) From: Stafford Horne To: LKML Cc: Stafford Horne , Jonas Bonn , Stefan Kristiansson , openrisc@lists.librecores.org Subject: [PATCH] openrisc: Fix issue with argument clobbering for clone/fork Date: Mon, 1 Jun 2020 06:24:59 +0900 Message-Id: <20200531212500.826332-1-shorne@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- arch/openrisc/kernel/entry.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/openrisc/kernel/entry.S b/arch/openrisc/kernel/entry.S index e4a78571f883..c6481cfc5220 100644 --- a/arch/openrisc/kernel/entry.S +++ b/arch/openrisc/kernel/entry.S @@ -1166,13 +1166,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 -- 2.26.2