... when will this kernel stack associated with the process be used?
When making a system call. Just as you want to get the IP address of an interface, the kernel, like any other application, needs some stack to prepare what you want. Thus, it has an appropriate stack when switching to the kernel side of a system call.
How do different stack and stack pointers work in ARM modes?
ARM defines several hardware modes for processing various system inputs. For example, from nowhere you can execute an illegal instruction (or undefined). In this case, execution in the CPU switches to another mode and it should be told how to proceed. Since most of the time, you need some stack space to be able to handle this gracefully, you need a separate stack for this mode. ARM provides you with a different stack register, so when you switch to another HW mode, you do not overwrite the previous mode stack pointer.
auselen Mar 25 '14 at 7:39 2014-03-25 07:39
source share