[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/7] xen/arm32: head.S: Introduce a macro to load the physical address of a symbol


  • To: Julien Grall <julien@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 27 Jun 2022 13:59:39 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SMDReZihMgL8n6yUE+Z180LcQUc2BcrDbXX4U+oLnyI=; b=Or4w5XXL1yNYuBjBHquKthlLiWbH0+UJbA90jAEVitOVkjcFMIXL76N6Kd3YgxUZ1/da1R7bsTDzaeRl++D3OZ0yAcUDSCvqb3mBFWofKUZAfYKxR33ewZy24y+Q4vboE3PtJVC9kpZzUUWdE6ZVCAItZxc4QaTQKWT1/AUKTE2OeZixrkmA6Fa25ubcl25XLqnFQYu1ifacAm65O0pD/JljA0QVTHC/q6QEoqNW9wkZa4ljFSPXL827uea/4ck6oiaZO19jSPu3DidthrrgUIe+0BxQsrC3P/mksf3DQrN988n02SMWj50WLCRgXEsUEF+XWkfwIStKAy+/Bc+4+A==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SMDReZihMgL8n6yUE+Z180LcQUc2BcrDbXX4U+oLnyI=; b=bS9MtEw68l7qA+1olgDLtzrtyP4vQxjZwV6YjQuR5TbRccJ8tSj7MEzsTFQVG5YosA9Hotnf+mmNcjc5bnG18eIK+SBek8nA0hRspTB+rLd93KKaOCIIrLBzvzFQ8lcYDRDvk6Bu/QhxYIbizMYBeu5V4JhHbquntFSk7EWjDYCTZoSJt14YPL+C2P+36mFyeyTGPfWhdEr80kPr1ryFd0yR4nHIB+MYbuwYLEORZby6ELlSv8s8FT1bJl3FR6mAPWK62Sgh6dJ18fjki74WRIkiA6k9qjQHBZmzWZfYh5+mGvaFEhpLrpNxqjZk4hz+TACDco8c5LRiIWxABIOwXA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=DykPKJeHQvBFZCcD4hWh026TwS8vZX0V7FAh1SUJ6kNfaPZGDZANQU73UqgQ7+fr/mIOjnwHvTqoVSALY/8OF3cQEC1fvtnyFmaD98/7+4dfXvKdOHGuqEAubmz97wZkSWDNv7eMflB59j4pGo3lV4Bk/DLESmJJ6gzIzl0UV9fEpDmCbDZQVfcK9+Y3vpGEUOOLU14fJ1M+ySYSuJ5G68AADxGByFqvORQ0Ys/PWWGXJpdaxeUcamVVJSsgWNx6z+dfYaJlXIuRLN1rwZsZkDJ/V/MV+73oK8Mpbt/V4WuURvZizzpwNEQFFXzL7QsGBPK2V/nRXqDOKXuJwmYG7A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h7Ptd9Wn2rR+yP8FZXao15X7EdMJ351gqbLjCGoUg6L0k87NLL7EVSFWAxr8MpAkoA3V/9J5Td7GNaTEYYUobh1pROU/PXuE56znHumSYsoWdFFPbJGFu/zMY6c3nGOfsmrqj06vsxeWxMBkqu4sQiwLAc/Y+7Z/z7gER19N/FVSONCZHhUg1jd75gCZVNrN4G3CP2UESE/EVXSWY5OYTZUvFr1DEtFOKcTuSbNKoJSPfw0CCe2Q/FdVgKS7zMnm8nd2YktOkv2iEYenFIdLosCjvypnL3aHEUVt0HHz0P58jJjFQvw/Vh0IkUm3Xc3P4u1M6tdXawNEieN6qQFN1A==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Michal Orzel <Michal.Orzel@xxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 27 Jun 2022 14:00:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYh6p3jlOKzsv2fEeFkG7om0FjI61iz6mAgAA4JICAAAIvAIAAAqUAgABAUoA=
  • Thread-topic: [PATCH 2/7] xen/arm32: head.S: Introduce a macro to load the physical address of a symbol

Hi Julien,

> On 27 Jun 2022, at 11:09, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Michal,
> 
> On 27/06/2022 10:59, Michal Orzel wrote:
>> 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 <jgrall@xxxxxxxxxx>
>>>>> 
>>>>> 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 <jgrall@xxxxxxxxxx>
>>>>> ---
>>>>> 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
> 
> For the better (or the worse) my way to code has evolved in the past 5 years. 
> :) Commenting is something that changed. I learnt from other open source 
> projects that it is better to comment when it is not clear what the 
> function/code is doing.
> 
> Anyway, this is easy enough for me to add if either Bertrand or Stefano think 
> that it is better to add a comment.

I do not think a comment to explain what is done in there is needed as it is 
quite obvious so:

Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.