ARMv8 changing from el3 to el1 secure

Viewed 1913

I am trying to change from el3 to el1 secure but i keep get the processor to hang somewhere. My code is running on a Cortex-A53 (raspberry pi 3). For now I can only drop from EL3 to EL2.

/* Code to try jump to EL1 secure */
MSR SCTLR_EL1, XZR

MRS X0, SCR_EL3
ORR X0, X0, #(1<<10) // RW EL1 Execution state is AArch64.
MSR SCR_EL3, x0
MOV X0, #0b00101 // DAIF=0000
MSR SPSR_EL3, X0

ADR X0, read_core
MSR ELR_EL3, X0 // EL1 code.
ERET

read_core:

/* set stack poiter */
mov sp, #0x3F000000

/* Jump to kernel main entry point */
bl  kernel_entry

Can someone point me out what can possibly be wrong in here?

Thnks in advance

1 Answers
Related