I use qemu to emulate a Raspberry Pi 4b , then I found when I load elf image , the exception level is EL3 , but when I load bin file , the exception level is EL2 .
Why do different image file formats result in different exception levels?
qemu-system-aarch64 -nographic -kernel benos.bin -S -s
.section ".text.boot"
.globl _start
_start:
mrs x0, mpidr_el1
and x0, x0,#0xFF
cbz x0, master
b proc_hang
proc_hang:
b proc_hang
master:
bl getel
.globl getel
getel:
mrs x0, currentel
lsr x0, x0, 2
and x0, x0, 0x3
ret