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

[PATCH 3/3] xen/arm64/mmu: head: Replace load_paddr with adr_l where appropriate


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 21 Nov 2023 10:45:16 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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 (0)
  • 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=Xa7a57P4d78oZLu4ZDZT+8vnzMYOT8JAEc+nQCvZbW8=; b=CwOGPCt+H1M8ZbWuEijciLNehF/o+F8FezXur5MFo61tHt+UGE2e4BOply8J2HWtBsvi5dbOzLjgQ9sdaeZWxXa0bNltLymW0GJlosuQGIKLsLbY4pQAm1w1eAAyUbjGBeW6qNwV0g6Lyy82NF2uclk7prhL8a9Vq6C54exXNAoZmBeFPKeh4J7hSImtrJqRP44IJXE2NGAbDmjszOfpji+/kihjHqoA0wPCMUlBnH7IP1ryvdXZ3Rl04onyqK2ZtGHPD19leSI4pDWVsF0ibrlApsdmBIZMg1o4eWZ5/pQitSu9NMa7UX9O/4jvMsm4UzY1yuw+b5fbiPP7ECkWRA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bt1JdNZNCbjBK8RG5mq7rT1/lIteO54wdcTHZxnKOoSJSq1S5jtDZuPuaKW0C095mB1wuM688lHcgPB43BIwdzScHT5gbFLqaZMtQIchnXY4n1MBRGv0qD3V27c5iUJ5hhEnclsqaLOjYtKZVU+bU3Rmjdik+vLvnVP5f4pEmH8QKNefV/NW+hP0JaOB/jqe4fkn9oqzbVc7zd8gaIxYGZOZg+KfWMxld/fiaAev+W1tBCy4pwnVI5FIxGCHljd8rWvpsQnU4jU4xRAg6IyCgzUmsL1LpJDpUByk7HWTwIftk2mse64FgOS8RTR9xPERuRMQ5T2vQdREBYm7YoAdlw==
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 21 Nov 2023 09:45:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Macros load_paddr and adr_l are equivalent when used before the MMU is
enabled, resulting in obtaining physical address of a symbol. The former
requires to know the physical offset (PA - VA) and can be used both before
and after the MMU is enabled. In the spirit of using something only when
truly necessary, replace all instances of load_paddr with adr_l, except
in create_table_entry macro. Even though there is currently no use of
load_paddr after MMU is enabled, this macro used to be call in such a
context and we can't rule out that it won't happen again.

This way, the logic behind using load_paddr/adr_l is consistent between
arm32 and arm64, making it easier for developers to determine which one
to use and when.

Take the opportunity to fix a comment with incorrect function name.

Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/arch/arm/arm64/mmu/head.S | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/arm64/mmu/head.S b/xen/arch/arm/arm64/mmu/head.S
index 10774f30e40e..41779020eb4d 100644
--- a/xen/arch/arm/arm64/mmu/head.S
+++ b/xen/arch/arm/arm64/mmu/head.S
@@ -146,10 +146,10 @@ create_page_tables:
 
         /*
          * We need to use a stash register because
-         * create_table_entry_paddr() will clobber the register storing
+         * create_table_entry_from_paddr() will clobber the register storing
          * the physical address of the table to point to.
          */
-        load_paddr x4, boot_third
+        adr_l x4, boot_third
         ldr   x1, =XEN_VIRT_START
 .rept XEN_NR_ENTRIES(2)
         mov   x0, x4                            /* x0 := paddr(l3 table) */
@@ -311,7 +311,7 @@ ENDPROC(enable_mmu)
 ENTRY(enable_secondary_cpu_mm)
         mov   x6, lr
 
-        load_paddr x0, init_ttbr
+        adr_l x0, init_ttbr
         ldr   x0, [x0]
 
         mov   x1, #SCTLR_Axx_ELx_WXN        /* Enable WxN from the start */
@@ -336,7 +336,7 @@ ENTRY(enable_boot_cpu_mm)
         mov   x6, lr
 
         bl    create_page_tables
-        load_paddr x0, boot_pgtable
+        adr_l x0, boot_pgtable
 
         mov   x1, #0        /* No extra SCTLR flags */
         bl    enable_mmu
-- 
2.25.1




 


Rackspace

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