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

[Minios-devel] [UNIKRAFT PATCH 18/22] plat/kvm: arm64: Clear pagetable memory with boot stack



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

diff --git a/plat/kvm/arm/entry64.S b/plat/kvm/arm/entry64.S
index 72e170f..b053497 100644
--- a/plat/kvm/arm/entry64.S
+++ b/plat/kvm/arm/entry64.S
@@ -87,14 +87,14 @@ ENTRY(_libkvmplat_entry)
        add x17, x17, #L2_TABLE_SIZE
 
        /* Boot stack is placed after pagetable area temporarily */
-       add x26, x26, x17
-       add x27, x26, #__STACK_SIZE
+       add x27, x26, x17
+       add x27, x27, #__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.
         */
 1:
        stp xzr, xzr, [x26], #16
diff --git a/plat/kvm/arm/pagetable64.S b/plat/kvm/arm/pagetable64.S
index 7d19f6b..bd473bf 100644
--- a/plat/kvm/arm/pagetable64.S
+++ b/plat/kvm/arm/pagetable64.S
@@ -70,18 +70,6 @@ ENTRY(create_pagetables)
        /* Pagetable starts from _end */
        ldr x14, =_end
 
-       /* Clean the page table */
-       mov x6, x14
-       ldr x13, =page_table_size
-       ldr x13, [x13]
-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®.