• Home
  • Raw
  • Download

Lines Matching full:stack

7  * Stack layout while running C code:
8 * ptrace needs to have all registers on the stack.
59 * %gs is used for userland TLS and kernel only uses it for stack
200 * When we're here from kernel mode; the (exception) stack looks like:
248 * so any attempt to access the stack needs to use SS. (except for
257 * middle doesn't scribble our stack.
313 /* Switch to kernel stack if necessary */
409 * Setup and switch to ESPFIX stack
411 * We're returning to userspace with a 16 bit stack. The CPU will not
445 * entry-stack, it will overwrite the task-stack and everything we
446 * copied there. So allocate the stack-frame on the task-stack and
461 /* Are we on the entry stack? Bail out if not! */
468 /* Load stack pointer into %esi and %edi */
472 /* Move %edi to the top of the entry stack */
476 /* Load top of task-stack into %edi */
479 /* Special case - entry from kernel mode via entry stack */
499 * Stack-frame contains 4 additional segment registers when
507 /* Allocate frame on task-stack */
510 /* Switch to task-stack */
514 * We are now on the task-stack and can safely copy over the
515 * stack-frame
527 * kernel-mode and %esp points to the entry-stack. When this
528 * happens we need to switch to the task-stack to run C code,
529 * but switch back to the entry-stack again when we approach
535 * When we switch to the task-stack here, we can't trust the
536 * contents of the entry-stack anymore, as the exception handler
538 * copy the complete entry-stack to the task-stack and set a
543 * entry-stack, so that the interrupted kernel code-path
544 * continues on the same stack it was interrupted with.
548 * %esi: Entry-Stack pointer (same as %esp)
549 * %edi: Top of the task stack
553 /* Calculate number of bytes on the entry stack in %ecx */
556 /* %ecx to the top of entry-stack */
560 /* Number of bytes on the entry stack to %ecx */
563 /* Mark stackframe as coming from entry stack */
577 * the stack-frame on task-stack and copy everything over
585 * Switch back from the kernel stack to the entry stack.
587 * The %esp register must point to pt_regs on the task stack. It will
588 * first calculate the size of the stack-frame to copy, depending on
590 * to copy the contents of the stack over to the entry stack.
593 * task-stack once we switched to the entry-stack. When an NMI happens
594 * while on the entry-stack, the NMI handler will switch back to the top
595 * of the task stack, overwriting our stack-frame we are about to copy.
596 * Therefore we switch the stack only after everything is copied over.
618 /* Save future stack pointer in %ebx */
621 /* Copy over the stack-frame */
627 * Switch to entry-stack - needs to happen after everything is
628 * copied because the NMI handler will overwrite the task-stack
629 * when on entry-stack
638 * path and have to switch back to the entry stack and/or user-cr3
646 * Test if we entered the kernel with the entry-stack. Most
655 /* Clear marker from stack-frame */
658 /* Copy the remaining task-stack contents to entry-stack */
662 /* Bytes on the task-stack to ecx */
666 /* Allocate stack-frame on entry-stack */
670 * Save future stack-pointer, we must not switch until the
672 * contents of the task-stack we are about to copy.
681 /* Safe to switch to entry-stack now */
685 * We came from entry-stack and need to check if we also need to
691 /* Clear marker from stack-frame */
704 * @has_error_code: Hardware pushed error code on stack
729 movl PT_ORIG_EAX(%esp), %edx /* get the vector from stack */
776 /* switch stack */
786 * When switching from a shallower to a deeper call stack
807 * The unwinder expects the last frame on the stack to always be at the same
808 * offset from the end of the page, which allows it to validate the stack.
810 * asmlinkage function so its argument has to be pushed on the stack. This
811 * wrapper creates a proper "end of stack" frame header before the call.
884 * SYSENTER does not save anything on the stack,
898 * ebp user stack
903 * On entry-stack with all userspace-regs live - save and
914 /* Stack empty again, switch to task stack */
924 SAVE_ALL pt_regs_ax=$-ENOSYS /* save rest, stack already switched */
959 * Setup entry stack - we keep the pointer in %eax and do the
963 /* Load entry stack pointer and allocate frame for eflags/eax */
967 /* Copy eflags and eax to entry stack */
985 /* Switch to entry stack */
1087 * The stack-frame here is the one that iret faulted on, so its a
1105 * Switch back for ESPFIX stack to the normal zerobased stack
1107 * We can't call C functions using the ESPFIX stack. This code reads
1109 * normal stack and adjusts ESP with the matching offset.
1116 /* fixup the stack */
1130 addl %esp, %eax /* the adjusted stack pointer */
1133 lss (%esp), %esp /* switch to the normal stack segment */
1141 /* see if on espfix stack */
1144 /* switch to normal stack */
1151 /* the function address is in %gs's slot on the stack */
1197 * The error code is on the stack, but the stack is otherwise
1238 * interrupted kernel code running on the SYSENTER stack.
1246 * after we've switched to the entry stack.
1261 /* Are we currently on the SYSENTER stack? */
1268 /* Not on SYSENTER stack. */
1274 * We're on the SYSENTER stack. Switch off. No one (not even debug)
1275 * is using the thread stack right now, so it's safe for us to use it.
1330 lss (1+5+6)*4(%esp), %esp # back to espfix stack