Lines Matching full:stack
7 * Stack layout while running C code:
8 * ptrace needs to have all registers on the stack.
123 * When we're here from kernel mode; the (exception) stack looks like:
171 * so any attempt to access the stack needs to use SS. (except for
180 * middle doesn't scribble our stack.
233 /* Switch to kernel stack if necessary */
325 * Setup and switch to ESPFIX stack
327 * We're returning to userspace with a 16 bit stack. The CPU will not
361 * entry-stack, it will overwrite the task-stack and everything we
362 * copied there. So allocate the stack-frame on the task-stack and
377 /* Are we on the entry stack? Bail out if not! */
384 /* Load stack pointer into %esi and %edi */
388 /* Move %edi to the top of the entry stack */
392 /* Load top of task-stack into %edi */
395 /* Special case - entry from kernel mode via entry stack */
415 * Stack-frame contains 4 additional segment registers when
423 /* Allocate frame on task-stack */
426 /* Switch to task-stack */
430 * We are now on the task-stack and can safely copy over the
431 * stack-frame
443 * kernel-mode and %esp points to the entry-stack. When this
444 * happens we need to switch to the task-stack to run C code,
445 * but switch back to the entry-stack again when we approach
451 * When we switch to the task-stack here, we can't trust the
452 * contents of the entry-stack anymore, as the exception handler
454 * copy the complete entry-stack to the task-stack and set a
459 * entry-stack, so that the interrupted kernel code-path
460 * continues on the same stack it was interrupted with.
464 * %esi: Entry-Stack pointer (same as %esp)
465 * %edi: Top of the task stack
469 /* Calculate number of bytes on the entry stack in %ecx */
472 /* %ecx to the top of entry-stack */
476 /* Number of bytes on the entry stack to %ecx */
479 /* Mark stackframe as coming from entry stack */
493 * the stack-frame on task-stack and copy everything over
501 * Switch back from the kernel stack to the entry stack.
503 * The %esp register must point to pt_regs on the task stack. It will
504 * first calculate the size of the stack-frame to copy, depending on
506 * to copy the contents of the stack over to the entry stack.
509 * task-stack once we switched to the entry-stack. When an NMI happens
510 * while on the entry-stack, the NMI handler will switch back to the top
511 * of the task stack, overwriting our stack-frame we are about to copy.
512 * Therefore we switch the stack only after everything is copied over.
534 /* Save future stack pointer in %ebx */
537 /* Copy over the stack-frame */
543 * Switch to entry-stack - needs to happen after everything is
544 * copied because the NMI handler will overwrite the task-stack
545 * when on entry-stack
554 * path and have to switch back to the entry stack and/or user-cr3
562 * Test if we entered the kernel with the entry-stack. Most
571 /* Clear marker from stack-frame */
574 /* Copy the remaining task-stack contents to entry-stack */
578 /* Bytes on the task-stack to ecx */
582 /* Allocate stack-frame on entry-stack */
586 * Save future stack-pointer, we must not switch until the
588 * contents of the task-stack we are about to copy.
597 /* Safe to switch to entry-stack now */
601 * We came from entry-stack and need to check if we also need to
607 /* Clear marker from stack-frame */
620 * @has_error_code: Hardware pushed error code on stack
645 movl PT_ORIG_EAX(%esp), %edx /* get the vector from stack */
688 /* switch stack */
698 * When switching from a shallower to a deeper call stack
729 /* return address for the stack unwinder */
769 * SYSENTER does not save anything on the stack,
783 * ebp user stack
788 * On entry-stack with all userspace-regs live - save and
799 /* Stack empty again, switch to task stack */
809 SAVE_ALL pt_regs_ax=$-ENOSYS /* save rest, stack already switched */
844 * Setup entry stack - we keep the pointer in %eax and do the
848 /* Load entry stack pointer and allocate frame for eflags/eax */
852 /* Copy eflags and eax to entry stack */
869 /* Switch to entry stack */
970 * The stack-frame here is the one that iret faulted on, so its a
987 * Switch back for ESPFIX stack to the normal zerobased stack
989 * We can't call C functions using the ESPFIX stack. This code reads
991 * normal stack and adjusts ESP with the matching offset.
998 /* fixup the stack */
1012 addl %esp, %eax /* the adjusted stack pointer */
1015 lss (%esp), %esp /* switch to the normal stack segment */
1023 /* see if on espfix stack */
1026 /* switch to normal stack */
1033 /* the function address is in %gs's slot on the stack */
1075 * The error code is on the stack, but the stack is otherwise
1116 * interrupted kernel code running on the SYSENTER stack.
1124 * after we've switched to the entry stack.
1139 /* Are we currently on the SYSENTER stack? */
1146 /* Not on SYSENTER stack. */
1152 * We're on the SYSENTER stack. Switch off. No one (not even debug)
1153 * is using the thread stack right now, so it's safe for us to use it.
1209 lss (1+5+6)*4(%esp), %esp # back to espfix stack