I fixed some codes to make xv6 for AArch64 re-work.
(1) Fix the definition of struct trapframe to adapt to the current trap frame in trap_asm.S.
(2) Because EL3 should be used by security monitors not by OS kernels,
use elr_el1, spsr_el1 instead of elr_el3, spsr_el3 .
(3) Restore a kernel stack pointer ( sp ) to the value where pointed to
when enter the kernel ( this should be the bottom of process's kernel stack. )
when the kernel return to EL0.
I should have written the codes to move into EL1 from EL2/EL3 before I send this PR.
But I cannot write and test such codes because I do not have a machine which boots kernel from EL3.
Hi, sudharson14,
I fixed some codes to make xv6 for AArch64 re-work.
(1) Fix the definition of struct trapframe to adapt to the current trap frame in trap_asm.S. (2) Because EL3 should be used by security monitors not by OS kernels, use elr_el1, spsr_el1 instead of elr_el3, spsr_el3 . (3) Restore a kernel stack pointer ( sp ) to the value where pointed to when enter the kernel ( this should be the bottom of process's kernel stack. ) when the kernel return to EL0.
I should have written the codes to move into EL1 from EL2/EL3 before I send this PR. But I cannot write and test such codes because I do not have a machine which boots kernel from EL3.
Would you please review this PR and merge this.
Thanks, Regards,