Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2362475rwb; Thu, 29 Sep 2022 09:14:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5iIpi2qWRTUmzCuF7rNiD6ujxOx05TlVd5RXpbUA+p1FFuZJhXU0xoixsfnnX0PZXDEPEF X-Received: by 2002:a17:906:ef8b:b0:77f:2b14:6eef with SMTP id ze11-20020a170906ef8b00b0077f2b146eefmr3340374ejb.612.1664468070143; Thu, 29 Sep 2022 09:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664468070; cv=none; d=google.com; s=arc-20160816; b=v4XswK8u1sn9teBLtSiUr2HUGDpnbqPr5BjniB3PanHkv04SxUln47wq7Tgh+KyXNr FM4unSbCJi4QFqMCn63M6GoiryMVurR/n2EnKZQHvyovPV0O/o0t4jcS/df0UbCPmX4N HoGF48CGACHE+I1/A54Iht+jV0FBIsni2/IjIBMl7+gDIPDJB0m4jZcS/IC4/s2kBVFR 6hi3mqgZFjfgvq42gCbgt8rw4wqCQHt+6PQb/HoaH4jDXUzOhnnhX0Dg9M2HILirBSwz wp6R0MYpNUKcc7dswSA5UBs6ZdMJMiVTd75REfUKG0xzH1ju/KTk1hjkqv6MrUeFn8r2 UD2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=wKpmlwj1fzXYxzWrLyJGqcIEIW4e/dv204txMZ9y6k8=; b=TyMDZPGHYVm6fS8M2nXo601uQDl3RjrMpGM66SGMlQANsSl5l7TLladbWBuGrtpbbZ 7hXP9K0VaYltqGqvDJ4aCChyXcim0bBppekoEYmbyyZv3Nvk8ITpYaMFPJni71XMp+cD 8BWS+At31l9575iDb6MiJEKBWXdjIfSOJFI7iJUln7bjXomrBKth6SGnSJhOg9BgGE4P uXOG0nPKORLHEcHM2pXgy/OhqH5fUOSUZOKpI3rZuBheXzg4oRimlZEHAWYvAxBRHN57 hLYu/svQuuAoT+nM/1+RYqkaqI0Uamx89jmpBqiTc031h4Y13SmtpS1X1OMVNkt/Uxpi D0gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EIiXGJaW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y18-20020a056402359200b0045815457fc0si2982530edc.542.2022.09.29.09.14.01; Thu, 29 Sep 2022 09:14:30 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EIiXGJaW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235739AbiI2QL0 (ORCPT + 99 others); Thu, 29 Sep 2022 12:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234737AbiI2QLY (ORCPT ); Thu, 29 Sep 2022 12:11:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1D771D2D28 for ; Thu, 29 Sep 2022 09:11:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4083061A60 for ; Thu, 29 Sep 2022 16:11:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6583C433D6; Thu, 29 Sep 2022 16:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664467882; bh=YQ2VBsdrbmdPy2lXy7ot5iuJYzQlEhfs7SsBIKRXys0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EIiXGJaWxiVEK7X2NAyW+d/K6UeALMRP5UlZu5D/jYoqbAmGXNDzv/Y20YziT2HIH VueM46Fqx1jwmmpB0RtTnFQXf54vSZf4HvO8hSpXJKylMbkhya2nJd3ceYoEwHrZ+b HRZcZlwA6YvAr8MTVFHSDZX25Q0JHnBXN8qGKSXnsIJp70DrelwBnXwyhPesBQ47gm YH7R5AFs5g8+tMucOIcfZ3NrS8Adnt1Kl6HMmkvlF0vM9daU5BzAT7jge2N8jcfL+Q Bx4xR5htE9VIukaJeLeN8dRKyCt0N7YSTrqHusSOYOutV3dB1idDjYbC6Ec1wfsamg UfTL446k0S+nw== Date: Fri, 30 Sep 2022 00:01:42 +0800 From: Jisheng Zhang To: Guo Ren Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Nathan Chancellor , Nick Desaulniers , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v2 4/4] riscv: entry: consolidate general regs saving into save_gp Message-ID: References: <20220928162007.3791-1-jszhang@kernel.org> <20220928162007.3791-5-jszhang@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Thu, Sep 29, 2022 at 11:59:00AM +0800, Guo Ren wrote: > On Thu, Sep 29, 2022 at 12:29 AM Jisheng Zhang wrote: > > > > Consolidate the saving/restoring GPs(except ra, sp and tp) into > > save_gp/restore_gp macro. > > > > No functional change intended. > > > > Signed-off-by: Jisheng Zhang > > --- > > arch/riscv/include/asm/asm.h | 65 +++++++++++++++++++++++++ > > arch/riscv/kernel/entry.S | 87 ++-------------------------------- > > arch/riscv/kernel/mcount-dyn.S | 58 +---------------------- > > 3 files changed, 70 insertions(+), 140 deletions(-) > > > > diff --git a/arch/riscv/include/asm/asm.h b/arch/riscv/include/asm/asm.h > > index 1b471ff73178..2f3b49536e9d 100644 > > --- a/arch/riscv/include/asm/asm.h > > +++ b/arch/riscv/include/asm/asm.h > > @@ -68,6 +68,7 @@ > > #endif > > > > #ifdef __ASSEMBLY__ > > +#include > > > > /* Common assembly source macros */ > > > > @@ -80,6 +81,70 @@ > > .endr > > .endm > > > > + /* save all GPs except ra, sp and tp */ > > + .macro save_gp > How about leave x3(gp) out of the macro, and define: > .marco save_from_x5_to_x31 > .marco restore_from_x5_to_x31 Good idea, will do in next version. Thanks