Module Name: src Committed By: ryo Date: Mon Jul 9 06:10:21 UTC 2018
Modified Files: src/sys/arch/aarch64/aarch64: locore_el2.S Log Message: keep stack pointer when changing from EL2 to EL1. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/aarch64/aarch64/locore_el2.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/aarch64/aarch64/locore_el2.S diff -u src/sys/arch/aarch64/aarch64/locore_el2.S:1.1 src/sys/arch/aarch64/aarch64/locore_el2.S:1.2 --- src/sys/arch/aarch64/aarch64/locore_el2.S:1.1 Sun Apr 1 04:35:03 2018 +++ src/sys/arch/aarch64/aarch64/locore_el2.S Mon Jul 9 06:10:21 2018 @@ -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 @@ drop_to_el1: 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