Re: At what instant process starts using kernel stack ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Wed, Aug 20, 2008 at 11:59 PM, Rene Herman <rene.herman@xxxxxxxxxxxx> wrote:
On 20-08-08 10:43, Mayuresh wrote:

A process has both user space stack and kernel space stack. When a system call happens, all parameters are either copied to stack or in
registers and using exception it switches to kernel. As from
asmlinkage, I understand parameters are passed onto stack. So once in
kernel space, all parameters are poped from stack, which is user
stack.

My query is when does a process starts using kernel stack ?

At the first kernelspace instruction executed. On x86-32, the syscall parameters are passed in registers and are pushed onto the kernelstack by the common kernel syscall entrypoint after which the then called syscall handler finds them there (on the kernel stack, that is).

See arch/x86/kernel/entry_32.S:syscall_entry() and specifically the SAVE_ALL macro. On x86-64, it seems they are passed on simply in registers.

Rene.
 

Thank you all for your answers. I appreciate all the time spent.


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux