Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F32DC43334 for ; Mon, 27 Jun 2022 10:00:37 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.356379.584563 (Exim 4.92) (envelope-from ) id 1o5lXW-0005If-LI; Mon, 27 Jun 2022 10:00:18 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 356379.584563; Mon, 27 Jun 2022 10:00:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o5lXW-0005IU-I4; Mon, 27 Jun 2022 10:00:18 +0000 Received: by outflank-mailman (input) for mailman id 356379; Mon, 27 Jun 2022 10:00:17 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1o5lXV-0005IN-3u for xen-devel@lists.xenproject.org; Mon, 27 Jun 2022 10:00:17 +0000 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by se1-gles-flk1.inumbo.com (Halon) with ESMTP id f0af5e5d-f5ff-11ec-b725-ed86ccbb4733; Mon, 27 Jun 2022 12:00:16 +0200 (CEST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6991D1691; Mon, 27 Jun 2022 03:00:14 -0700 (PDT) Received: from [10.57.42.186] (unknown [10.57.42.186]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 93C813F792; Mon, 27 Jun 2022 03:00:12 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f0af5e5d-f5ff-11ec-b725-ed86ccbb4733 Message-ID: <8c8d6a9f-18cd-43e5-0835-68927e7d1bac@arm.com> Date: Mon, 27 Jun 2022 11:59:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 2/7] xen/arm32: head.S: Introduce a macro to load the physical address of a symbol Content-Language: en-US To: Julien Grall , xen-devel@lists.xenproject.org Cc: Julien Grall , Stefano Stabellini , Bertrand Marquis , Volodymyr Babchuk References: <20220624091146.35716-1-julien@xen.org> <20220624091146.35716-3-julien@xen.org> <1218329a-13a3-79b6-6753-c2c9a0c45b2d@arm.com> From: Michal Orzel In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 27.06.2022 11:52, Julien Grall wrote: > > > On 27/06/2022 07:31, Michal Orzel wrote: >> Hi Julien, > > Hi Michal, > >> On 24.06.2022 11:11, Julien Grall wrote: >>> From: Julien Grall >>> >>> A lot of places in the ARM32 assembly requires to load the physical address >>> of a symbol. Rather than open-coding the translation, introduce a new macro >>> that will load the phyiscal address of a symbol. >>> >>> Lastly, use the new macro to replace all the current open-coded version. >>> >>> Note that most of the comments associated to the code changed have been >>> removed because the code is now self-explanatory. >>> >>> Signed-off-by: Julien Grall >>> --- >>>   xen/arch/arm/arm32/head.S | 23 +++++++++++------------ >>>   1 file changed, 11 insertions(+), 12 deletions(-) >>> >>> diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S >>> index c837d3054cf9..77f0a619ca51 100644 >>> --- a/xen/arch/arm/arm32/head.S >>> +++ b/xen/arch/arm/arm32/head.S >>> @@ -65,6 +65,11 @@ >>>           .endif >>>   .endm >>>   +.macro load_paddr rb, sym >>> +        ldr   \rb, =\sym >>> +        add   \rb, \rb, r10 >>> +.endm >>> + >> All the macros in this file have a comment so it'd be useful to follow this convention. > This is not really a convention. Most of the macros are non-trivial (e.g. they may clobber registers). > > The comment I have in mind here would be: > > "Load the physical address of \sym in \rb" > > I am fairly confident that anyone can understand from the ".macro" line... So I don't feel the comment is necessary. > Fair enough although you did put a comment when introducing load_paddr for arm64 head.S. Anyway, I'm ok not to add it. > Cheers, >