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

[Minios-devel] [UNIKRAFT PATCH 16/22] plat/kvm: Disable D-Cache before doing any change for Arm64


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

Disable the D-Cache before doing anything change, This will
help us to avoid doing clean the D-Cache for changed area.

Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
---
 plat/kvm/arm/entry64.S | 30 +++++++++++++++++-------------
 1 file changed, 17 insertions(+), 13 deletions(-)

diff --git a/plat/kvm/arm/entry64.S b/plat/kvm/arm/entry64.S
index f1bbeb6..c1af0a4 100644
--- a/plat/kvm/arm/entry64.S
+++ b/plat/kvm/arm/entry64.S
@@ -43,6 +43,23 @@
 
 .text
 ENTRY(_libkvmplat_entry)
+       /*
+        * Disable the MMU. We may have entered the kernel with it on and
+        * will need to update the tables later. If this has been set up
+        * with anything other than a VA == PA map then this will fail,
+        * but in this case the code to find where we are running from
+        * would have also failed.
+        *
+        * Disable the D-Cache before doing anything change, This will
+        * make us avoid doing clean the D-Cache for changed area.
+        */
+       dsb sy
+       mrs x2, sctlr_el1
+       mov x3, #SCTLR_M|SCTLR_C
+       bic x2, x2, x3
+       msr sctlr_el1, x2
+       isb
+
        /* Boot stack is placed after pagetable area temporarily */
        ldr x26, =_end
        add x26, x26, #PAGE_TABLE_SIZE
@@ -64,19 +81,6 @@ ENTRY(_libkvmplat_entry)
 
        mov sp, x27
 
-       /*
-        * Disable the MMU. We may have entered the kernel with it on and
-        * will need to update the tables later. If this has been set up
-        * with anything other than a VA == PA map then this will fail,
-        * but in this case the code to find where we are running from
-        * would have also failed.
-        */
-       dsb sy
-       mrs x2, sctlr_el1
-       bic x2, x2, #SCTLR_M
-       msr sctlr_el1, x2
-       isb
-
        /* Set the context id */
        msr contextidr_el1, xzr
 
-- 
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®.