How Kernel stack is used in case of different processor mode in ARM architecture?

Arun KS getarunks at gmail.com
Tue Mar 25 05:36:33 EDT 2014


On Tue, Mar 25, 2014 at 2:58 PM, Arun KS <getarunks at gmail.com> wrote:
> Hello Rahul,
>
> On Tue, Mar 25, 2014 at 6:29 AM, Rahul Garg <rahul.lnmiit at gmail.com> wrote:
>> As I understand every process have a user stack and kernel stack.
> True.
>
>> Apart from that there is a stack for every mode in ARM achitecture. So
> This is wrong.
> Only irq, abort and undefined modes have stacks in linux. That too is
> very limited, 3 bytes per mode per cpu.
> Have a look at arch/arm/kernel/irq.c
Sorry. Wrong file, its at arch/arm/kernel/setup.c

Thanks,
Arun
> struct stack {
>         u32 irq[3];
>         u32 abt[3];
>         u32 und[3];
> } ____cacheline_aligned;
>
> kernel runs in SVC mode and the stack used belong to the kernel stack
> of the current task.
> Even irq, abort and undefined exception handlers use kernel stack of
> current task. All the exception
> handlers switch to SVC mode at a very early stage and use kernel
> stack. Those 3 bytes are used
> as stack just during the transition phase(for example transition from
> irq to svc mode during and interrupt).
>
> Thanks,
> Arun
>> I want to know How different stack and stack pointer works in ARM
>> modes? Also when this kernel stack associated with the process will be
>> used ?
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



More information about the Kernelnewbies mailing list