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

[Minios-devel] [UNIKRAFT PATCHv7 20/23] plat/kvm: arm64: Support build L3 table for large image size



From: Wei Chen <wei.chen@xxxxxxx>
We have updated the L3 table build function to support large memory
range. In this case, we can support build L3 tables for images exceeded
2MB.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
Signed-off-by: Jia He <justin.he@xxxxxxx>
Reviewed-by: Sharan Santhanam <sharan.santhanam@xxxxxxxxx>
---
 plat/kvm/arm/pagetable64.S | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/plat/kvm/arm/pagetable64.S b/plat/kvm/arm/pagetable64.S
index 212f8e0..8d9e923 100644
--- a/plat/kvm/arm/pagetable64.S
+++ b/plat/kvm/arm/pagetable64.S
@@ -62,6 +62,7 @@ virt_bits:
 /*
  * We will use a direct map for physical address and virtual address
  * (PA = VA 1:1 mapping)
+ *  x15 = image size (trashed)
  */
 ENTRY(create_pagetables)
        /* Save link address */
@@ -134,20 +135,30 @@ ENTRY(create_pagetables)
        add x9, x14, #L2_TABLE_OFFSET;
        bl  link_l1_pagetable
 
-       /* 3rd: Build a L3 pagetable for 0~2MB*/
-       add x6, x14, #L3_TABLE_OFFSET;
+       /* 3rd: Build a L3 pagetable for image occupied memory */
+       add x16, x14, #L3_TABLE_OFFSET
+       mov x17, #RAM_ADDR_START
+
+       mov x6, x16
        ldr x7, =SECT_ATTR_NORMAL
-       mov x8, #RAM_ADDR_START
-       mov x9, x8
-       mov x10, 512
+       mov x8, x17
+       mov x9, x17
+       lsr x10, x15, L3_SHIFT
        bl  build_l3_pagetable
 
        /* 4th: Link this L3 pagetable to L2 entry */
-       add x6, x14, #L2_TABLE_OFFSET;
-       mov x8, #RAM_ADDR_START
-       add x9, x14, #L3_TABLE_OFFSET;
+       add x6, x14, #L2_TABLE_OFFSET
+1:
+       mov x8, x17
+       mov x9, x16
        bl  link_l2_pagetable
 
+       /* Check whether the image mapping has been done */
+       add x16, x16, #__PAGE_SIZE
+       add x17, x17, #L2_SIZE
+       sub x15, x15, #L2_SIZE
+       cbnz x15, 1b
+
        /* 5th: Update dtb section to readonly */
        ldr x8, =_dtb
        ldr x9, =_text
-- 
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®.