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

[Minios-devel] [UNIKRAFT PATCHv4 17/23] plat/kvm: arm64: Clear pagetable memory with boot stack



From: Wei Chen <wei.chen@xxxxxxx>

The pagetable memory and boot stack are contiguous, so we can
clear these two areas at the same time.

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/entry64.S     | 15 +++++++--------
 plat/kvm/arm/pagetable64.S | 11 -----------
 2 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/plat/kvm/arm/entry64.S b/plat/kvm/arm/entry64.S
index f1bbeb6..d08b49e 100644
--- a/plat/kvm/arm/entry64.S
+++ b/plat/kvm/arm/entry64.S
@@ -43,17 +43,16 @@
 
 .text
 ENTRY(_libkvmplat_entry)
-       /* Boot stack is placed after pagetable area temporarily */
-       ldr x26, =_end
-       add x26, x26, #PAGE_TABLE_SIZE
-       add x27, x26, #__STACK_SIZE
 
        /*
-        * Clean the boot stack. As _end, PAGE_TABLE_SIZE and BOOT_STACK_SIZE
-        * are page_size alignment, the boot stack can be 64-bytes alignment
-        * too. Execute 4 stp consecutively without boundary check would be
-        * safe here.
+        * Clean the boot stack and page table. As _end, PAGE_TABLE_SIZE and
+        * BOOT_STACK_SIZE are page_size alignment, the boot stack can be
+        * 64-bytes alignment too. Execute 4 stp consecutively without boundary
+        * check would be safe here.
         */
+       ldr x26, =_end
+       add x27, x26, #PAGE_TABLE_SIZE
+       add x27, x27, #__STACK_SIZE
 1:
        stp xzr, xzr, [x26], #16
        stp xzr, xzr, [x26], #16
diff --git a/plat/kvm/arm/pagetable64.S b/plat/kvm/arm/pagetable64.S
index cf30584..a00b71c 100644
--- a/plat/kvm/arm/pagetable64.S
+++ b/plat/kvm/arm/pagetable64.S
@@ -70,17 +70,6 @@ ENTRY(create_pagetables)
        /* Pagetable starts from _end */
        ldr x14, =_end
 
-       /* Clean the page table */
-       mov x6, x14
-       add x13, x14, #PAGE_TABLE_SIZE
-1:
-       stp  xzr, xzr, [x6], #16
-       stp  xzr, xzr, [x6], #16
-       stp  xzr, xzr, [x6], #16
-       stp  xzr, xzr, [x6], #16
-       cmp  x6, x13
-       b.lo 1b
-
        /*
         * We have 2 L1 tables to map 0 ~ 512GB, 512 GB ~ 1TB.
         * Link these two tables to L0 entries#0, #1
-- 
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®.