Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/aarch64/aarch64 keep stack pointer when changing fr...



details:   https://anonhg.NetBSD.org/src/rev/540a7a66c81d
branches:  trunk
changeset: 323931:540a7a66c81d
user:      ryo <ryo%NetBSD.org@localhost>
date:      Mon Jul 09 06:10:21 2018 +0000

description:
keep stack pointer when changing from EL2 to EL1.

diffstat:

 sys/arch/aarch64/aarch64/locore_el2.S |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r c346fbd97a8f -r 540a7a66c81d sys/arch/aarch64/aarch64/locore_el2.S
--- a/sys/arch/aarch64/aarch64/locore_el2.S     Mon Jul 09 06:08:42 2018 +0000
+++ b/sys/arch/aarch64/aarch64/locore_el2.S     Mon Jul 09 06:10:21 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore_el2.S,v 1.1 2018/04/01 04:35:03 ryo Exp $       */
+/*     $NetBSD: locore_el2.S,v 1.2 2018/07/09 06:10:21 ryo Exp $       */
 
 /*-
  * Copyright (c) 2012-2014 Andrew Turner
@@ -32,17 +32,15 @@
 #include <aarch64/hypervisor.h>
 #include "assym.h"
 
-RCSID("$NetBSD: locore_el2.S,v 1.1 2018/04/01 04:35:03 ryo Exp $")
+RCSID("$NetBSD: locore_el2.S,v 1.2 2018/07/09 06:10:21 ryo Exp $")
 
 
 /* for use in #include "locore_el2.S" */
        .text
 drop_to_el1_inline:
-       mov     x27, sp
-       mov     x28, lr
+       mov     x8, lr
        bl      drop_to_el1
-       mov     lr, x28
-       mov     sp, x27
+       mov     lr, x8
        b       drop_to_el1_inline_done
 
        .text
@@ -117,6 +115,10 @@
        msr     icc_sre_el2, x2
 2:
 
+       /* keep stack pointer */
+       mov     x0, sp
+       msr     sp_el1, x0
+
        /* Set the address to return to our return address */
        msr     elr_el2, x30
        isb



Home | Main Index | Thread Index | Old Index