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

[Minios-devel] [UNIKRAFT PATCH 19/22] plat/kvm: arm64: Build L3 page table for range greater than 2MB


  • To: <minios-devel@xxxxxxxxxxxxxxxxxxxx>, <simon.kuenzer@xxxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Thu, 8 Nov 2018 09:51:50 +0000
  • Authentication-results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=bestguesspass action=none header.from=arm.com;
  • Cc: Kaly.Xin@xxxxxxx, nd@xxxxxxx, wei.chen@xxxxxxx
  • Delivery-date: Thu, 08 Nov 2018 09:52:49 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Nodisclaimer: True
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

Current L3 table build function only supports to build L3 table for
memory range not exceeded than 2MB. But as we mentioned in previous
patch, the image size will be greater than 2MB. So in this case, build
L3 table for bigger image is not convenient. We have improve the
function of building L3 table to support bigger memory range.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
 plat/kvm/arm/pagetable64.S | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/plat/kvm/arm/pagetable64.S b/plat/kvm/arm/pagetable64.S
index bd473bf..212f8e0 100644
--- a/plat/kvm/arm/pagetable64.S
+++ b/plat/kvm/arm/pagetable64.S
@@ -427,7 +427,13 @@ link_l2_pagetable:
  *  x11, x12 and x13 are trashed
  */
 build_l3_pagetable:
-       /* Find the table index */
+       /* Find the first L3 table to be updated */
+       lsr x11, x8, #L2_SHIFT
+       and x11, x11, #Ln_ADDR_MASK
+       lsl x11, x11, #L3_SHIFT
+       add x6, x11, x6
+
+       /* Find the first entry index in L3 table */
        lsr x11, x8, #L3_SHIFT
        and x11, x11, #Ln_ADDR_MASK
 
@@ -446,10 +452,17 @@ build_l3_pagetable:
 
        /* Store the entry */
        str x13, [x6, x11, lsl #3]
+       add x11, x11, #1
 
+       /* Cross L3 Page? */
+       and x11, x11, #Ln_ADDR_MASK
+       cbnz x11, 2f
+
+       /* To next L3 table */
+       add x6, x6, #__PAGE_SIZE
+
+2:     add x9, x9, #1
        sub x10, x10, #1
-       add x11, x11, #1
-       add x9, x9, #1
        cbnz x10, 1b
 
        ret
-- 
2.17.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

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