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

[Minios-devel] [UNIKRAFT PATCHv3 20/25] plat/kvm: arm64: Build L3 page table for range greater than 2MB



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®.