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

Re: [XEN] xen/arm: arm32: Use adr_l instead of load_paddr for getting address of symbols


  • To: Julien Grall <julien@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 26 Oct 2023 11:02:57 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • 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=sIK2GiO9xi8jpj0JqkeN7ZLEgMP1E9mQ9ocUZONKLPo=; b=QrL686RWQKTNzS4lmDPidW5Lm4ArqQHKcmHeTJK3J8rpRPSLx1HJ/8GsfdwWQ0OBRMk4Q/KqmbaeAu813Ydx4XlX0Eq3N9R4c3KwaBLNo7kFUagKsXLhmmrOlXLixMOTCdaWxczGuajWjdH0byiXwhXcWSm9G/y5Xq6uYVGWI7/Gr9fbub0nnlVu2sD+5dCSySGy+2YJT7BWZrbN7mKZy/J3bDcIkfoCDWAgYHmoNKFYA04EtEESkYY6jigGUcytVAXHzNTP0CTX5aJpV9NsGornHz+zVzQYd1pJ95QFBGgb6lBBGUnPiTH8x7cCvxKrNWjpNxDmov8JCUaJZZWEhg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FVOtsEwI8nC2zB39uhTClgeJPEq0mcfL8lT/gS2yeKRyoCcWnA9ui4yGTCDmatbsuOY3EmbVCRKydPI8hhIZy+zfDz20FGYsieKfK4i4V1b/zJfT363GY99Ih9mRUcpzRswPV0h7uj4S1ffjNygvahDp1BUA9RzTnbigouA2C43L6Q3ZtMULoA1eCuvU+gGO8PiyBgOlF82YTRZCqnY42XmIBnN8D6eqJpMgXR7OJEPYpKlJeKPW5ZekFzppzzsYT/q9+InXKfW0l9H/3dN6IYJuOjqBgGVv5GR8vU30rzc9hkQRQFDVCnpLVO98lP3HZ/w0bC8vyUhsxnusA87VVQ==
  • Cc: <sstabellini@xxxxxxxxxx>, <bertrand.marquis@xxxxxxx>
  • Delivery-date: Thu, 26 Oct 2023 09:03:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,

On 26/10/2023 10:40, Julien Grall wrote:
> 
> 
> Hi,
> 
> On 25/10/2023 18:59, Michal Orzel wrote:
>> Hi Ayan,
>>
>> On 25/10/2023 19:03, Ayan Kumar Halder wrote:
>>> Before the MMU is turned on, the address returned for any symbol will 
>>> always be
>>> physical address. Thus, one can use adr_l instead of load_paddr.
>>>
>>> create_table_entry() now takes an extra argument to denote if it is called 
>>> after
>>> the mmu is turned on or not.  If it is called with mmu on, then it uses
>>> load_paddr to get the physical address of the page table symbol.
>> I wonder if we need this extra complexity.
> 
> +1. We used to request the caller to tell whether the MMU is on. But
> this made the code more complex. So I decided to remove it completely.
> 
>> Can we just remove load_paddr macro completely (I have a plan to do this for 
>> arm64 mmu head.S)
>> and open code it in create_table_entry? I don't think there is any benefit in
>> having the if/else there to use either load_paddr or adr_l. This function 
>> will also go
>> into arm32 mmu head.S.
> 
> While I was ok (I am not 100% happy) with open-coding load_paddr in
> arm64, I would rather not do it on Arm32 because I still haven't figured
> out whether I would need other use (which could not be replaced with
> adr_l) when fixing the secondary CPU boot code (it is still not
> compliant with the Arm Arm).
> 
> So the question here is what do we gain by removing load_paddr
> completely? We still need a register allocate for the offset, and the
> macro makes it clearer what's the code is about.
I agree that it might not be super beneficial. My opinion was based on the fact
that why bother having a macro if it is only used in one place and consists of 
2 instructions only.
That said, I'm fully ok to keep the macro if it improves readability and the 
only use would be in create_table_entry.
Then, on an arm32 head.S split, the macro together with function would moved to 
mmu specific head.S

~Michal



 


Rackspace

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