In our context switch we store the CPSR, however, this register is shadowed in the interrupt routine and we have to access the user CPSR through SPSR (Saved Program Status Register). Restoring a new context happens analogously.
Test case: Check CPSR of a user process (debug breakpoint). The CPU should be is in user mode. Before that change the system was always in supervisor mode.
In our context switch we store the CPSR, however, this register is shadowed in the interrupt routine and we have to access the user CPSR through SPSR (Saved Program Status Register). Restoring a new context happens analogously.