AArch64 开关 EL3 >非安全 EL1 问题 [英] AArch64 switch EL3 > non-secure EL1 problem

查看:58
本文介绍了AArch64 开关 EL3 >非安全 EL1 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Cortex-A35 处理器,AArch64 模式.在设置 MMU 和 GIC 之前,我正在尝试从 EL3 转到非安全 EL1:

Cortex-A35 processor, AArch64 mode. Before setting up MMU and GIC, I'm trying to go from EL3 to non-secure EL1:

        msr VTTBR_EL2, xzr
        mov x0, SCR_EL3.RES1 or SCR_EL3.NS or SCR_EL3.RW or SCR_EL3.ST
        msr SCR_EL3, x0
        mov x1, SPSR.M.AArch64_EL1h or SPSR_EL3.A or SPSR_EL3.I or SPSR_EL3.F
        msr SPSR_EL3, x1
        adr x2, __el1
        msr ELR_EL3, x2
        ; all other system registers are set to their reset values. 
        ; SCTLR_EL1 = 0x00C50838
        ; HCR_EL2   = 0x0000000000000002

        eret

__el1:
        mov x10, 0xff220000  ; this simply turns on the LED on the board, 
        mov w11, 0x0020      ; for testing only
        str w11, [x10, 4]    ;
        str w11, [x10, 0]    ;
        b.al $ 

切换到安全 EL1(SCR_EL3.NS 未设置)工作正常,LED 亮起.当我尝试转到非安全 EL1 时它不起作用.

Switching to the secure EL1 (SCR_EL3.NS not set) works fine and the LED turns on. It doesn't work when I try to go to non-secure EL1.

设置 HCR_EL2.RW 也不起作用:

        mov x0, HCR_EL2.RW
        msr HCR_EL2, x0

我错过了什么?

推荐答案

您缺少 ARMv8 的异常级别和安全状态实现.

You are missing Exception Levels and Secure States implementation of ARMv8.

不能更改 EL3(安全)->EL1(非安全)直接.

You could not change EL3(secure) -> EL1(non-secure) directly.

到达 EL1 有两种可能的方式:

There are 2 possible ways to reach EL1:

  • EL3(安全)->EL1(安全)
  • EL3(安全)->EL2(非安全)->EL1(非安全)

这篇关于AArch64 开关 EL3 >非安全 EL1 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆