Hi experts,
In ARMv8, EL1/2/3 can use either their own stack pointer, SP_ELx or SP_EL0.
SP_EL0 can be used in EL0.
why it is safe to use SP_EL0 in EL1/2/3? I think the applications in EL0 may get the data of kernel in EL1 through SP_EL0.
Can anybody explain why? Thank you!
Thank you very much. But I dont quite understand it.
You mean, both SP_EL0 and SP_EL1 points at the kernel stack when OS is running?
What I understand (I could be wrong) is, when the code is running on the OS kernel (EL1), the SP_EL0 points at the kernel stack and the data push into the stack. Then, a exception occured, the SP_EL0 switches to SP_EL1 that points at a new address(new kernel stack?).
If understood in this way, are there two stacks in EL1?
Please tell me where I got wrong, thanks.