Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4175768rwo; Tue, 25 Jul 2023 01:38:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlHrlkzjuLljQWxgOqot4zIrHhhWeyfmZes62tuOlCc+JaNip4trXFX8FXl7FzrygWDqcT/d X-Received: by 2002:a05:6a20:1591:b0:139:8517:10b6 with SMTP id h17-20020a056a20159100b00139851710b6mr10656144pzj.30.1690274318599; Tue, 25 Jul 2023 01:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690274318; cv=none; d=google.com; s=arc-20160816; b=b8xPwg9gKda4m7PDwlamapKyHrjjHT9/9LGjrB/7Jtk5tbZaBy2fpFHn3mT0HyQRRt DQ+NNQirj5IrF+6rpqcexcmsJY69JccHvM+Uv4Izi0YFnD1yOhKZFVh46KixX1UqVO6X Q28Kf8vXuzT1nYvNtmZO/tiDkVx3ktzoHfN8JHIWPpe0zA9BB/DxccAsFCQ0p6BjH0dc iuCHwByUmPCvcnrSCs0j0s8/btALoLLs1CVVfh1NetyDON76yyBrPOnbyND1X2r2nCLw JvW47sUguU8YOZAzIHaPGqc6dw9TyTsiJD486O7lTAlBNYdEKUGb4Yo8z47j7UG4BbkE k46A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=0M8Bit6zCzekddk8scIabSZg4U3eTB3lRo81GF/P8cw=; fh=bU9/kTs2AKRmrZu/3I6zizlMXUYaXyH+fEC8GirI+hI=; b=vC2cViZ6TKbE9qEVnh9UPIM7Crj2UPPJYjaWMA2pyCGYYQJXemiY0HNWWFYsLkMekP M719tv2yz1NbtsbQvfGqOuWl/i2UI3ETD3z0tz4DRugK7qU+0ahoblNHq57WVFIT17Cj 7XfrwW3naMHdJxRLDi5YCL06pov9O5aZkoP87aaPf8tKTxAfMO9EDNWc3nNI382tThPU 1u6L1+C7NfxdY3hbZXZ/PqPTmZiag1V2Oy9uzHKbJL+rPnfJIQfwB8cmm6g/p98HwSac MnPy8T8uvzSw80Xb656eQndGZBMusuFgq07L0JTauTTeVJqTVn4IuNftVmsKaFD0uzQ7 UDWA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a26-20020a631a5a000000b00542897dcc22si10493254pgm.516.2023.07.25.01.38.26; Tue, 25 Jul 2023 01:38:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230357AbjGYIBo (ORCPT + 99 others); Tue, 25 Jul 2023 04:01:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230267AbjGYIBl (ORCPT ); Tue, 25 Jul 2023 04:01:41 -0400 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CED9113 for ; Tue, 25 Jul 2023 01:01:40 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4B749E0008; Tue, 25 Jul 2023 08:01:34 +0000 (UTC) Message-ID: <68b2b7d8-a826-cd4d-d083-1f1819eb5d76@ghiti.fr> Date: Tue, 25 Jul 2023 10:01:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] riscv: remove redundant mv instructions Content-Language: en-US To: Nam Cao , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230725053835.138910-1-namcaov@gmail.com> From: Alexandre Ghiti In-Reply-To: <20230725053835.138910-1-namcaov@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-GND-Sasl: alex@ghiti.fr X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nam, On 25/07/2023 07:38, Nam Cao wrote: > Some mv instructions were useful when first introduced to preserve a0 and > a1 before function calls. However the code has changed and they are now > redundant. Remove them. > > Signed-off-by: Nam Cao > --- > arch/riscv/kernel/head.S | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S > index 11c3b94c4534..3710ea5d160f 100644 > --- a/arch/riscv/kernel/head.S > +++ b/arch/riscv/kernel/head.S > @@ -289,10 +289,6 @@ clear_bss: > blt a3, a4, clear_bss > clear_bss_done: > #endif > - /* Save hart ID and DTB physical address */ > - mv s0, a0 > - mv s1, a1 > - > la a2, boot_cpu_hartid > XIP_FIXUP_OFFSET a2 > REG_S a0, (a2) > @@ -306,7 +302,7 @@ clear_bss_done: > la a0, __dtb_start > XIP_FIXUP_OFFSET a0 > #else > - mv a0, s1 > + mv a0, a1 > #endif /* CONFIG_BUILTIN_DTB */ > call setup_vm > #ifdef CONFIG_MMU You can add: Reviewed-by: Alexandre Ghiti Thanks, Alex