All of lore.kernel.org
 help / color / mirror / Atom feed
* Where does kernel stores it's registers while performing a context switch?
@ 2017-10-07 13:52 Ketan Singh
  2017-10-07 15:08 ` Thibaut SAUTEREAU
  0 siblings, 1 reply; 2+ messages in thread
From: Ketan Singh @ 2017-10-07 13:52 UTC (permalink / raw)
  To: kernelnewbies

I want to know where the kernel stores it's registers while performing
a context switch on x86 architecture. In ARM I can see  struct
cpu_context_save in arch/arm/include/asm/thread_info.h but what about
x86/x86_64?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Where does kernel stores it's registers while performing a context switch?
  2017-10-07 13:52 Where does kernel stores it's registers while performing a context switch? Ketan Singh
@ 2017-10-07 15:08 ` Thibaut SAUTEREAU
  0 siblings, 0 replies; 2+ messages in thread
From: Thibaut SAUTEREAU @ 2017-10-07 15:08 UTC (permalink / raw)
  To: kernelnewbies

On Sat, Oct 07, 2017 at 07:22:49PM +0530, Ketan Singh wrote:
> I want to know where the kernel stores it's registers while performing
> a context switch on x86 architecture. In ARM I can see  struct
> cpu_context_save in arch/arm/include/asm/thread_info.h but what about
> x86/x86_64?

Are you talking about context switches between two different threads? If
so, on x86, EIP and other CPU registers are saved onto the kernel stack
of the thread, then ESP is saved in the thread_struct structure which is
itself included in task_struct. The kernel function that handles that is
switch_to(), you might want to take a look at it.

If you were talking about switches between kernel and user modes, on x86
it is managed like interrupts, on x86_64 you should read about the task
state segment (TSS).

Hope this helps,


Thibaut

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-07 15:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-07 13:52 Where does kernel stores it's registers while performing a context switch? Ketan Singh
2017-10-07 15:08 ` Thibaut SAUTEREAU

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.