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

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


  • To: <minios-devel@xxxxxxxxxxxxxxxxxxxx>, <simon.kuenzer@xxxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Thu, 8 Nov 2018 09:51:51 +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:50 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Nodisclaimer: True
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

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>
---
 plat/kvm/arm/pagetable64.S | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/plat/kvm/arm/pagetable64.S b/plat/kvm/arm/pagetable64.S
index 212f8e0..d02e104 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;
+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®.