Contents of CR3 register when a kernel thread is executed

limp johnkyr83 at hotmail.com
Mon Apr 18 09:17:39 EDT 2011


Hi all,

I am trying to understand in what extend the PGD (page global directory)
value stored in the CR3 register indicate the running process/thread by the
Linux scheduler.

I know that each process has its own PGD value but what I am confused about
is the value of CR3 register when kernel threads are scheduled.

AFAIK, a "kernel thread" can 'borrow' the page-directory that belongs to
another process (i.e. its address space). Does this apply *only* to threads
of the same process (i.e. all the threads of process A are using the PGD
entry of process A) or could also apply to threads not relevant to process
A?

That is, if a thread is executed and the value of CR3 at the time is
0x1E107000, does this *necessary* mean that a thread of the process with PGD
0xDE107000 is executed *or* a thread not relevant with that process could
have 'borrowed' its PGD entry?

Any help will be greatly appreciated.

John K.





More information about the Kernelnewbies mailing list