Hi Expert,
I am working on a simple kernel and test it on Qemu which supports RasPi3. During the boot level. Ras Pi goes to EL3 level, and I set spsr_el3 to 1 and elr_el3 to kernel_main and then use eret to enter EL1 mode. My problem is I create a kernel thread which still in EL1 level. I want to switch the kernel thread to user level. What I did is that this kernel thread also set spsr_el1 to 0 and elr_el1 to a function pointer, then eret. But this case a sync interrupt, I think caused by this eret? Please help her
I'd suggest: Stay on EL1 until you are sure you understand MMU setup etc. And maybe add some tooling to help debug. Then try again switching to EL0.