kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Identifying whether a user-process or kernel-thread execution takes place by looking at CPU registers
@ 2011-05-12 10:55 limp
  2011-05-12 11:53 ` Mulyadi Santosa
  0 siblings, 1 reply; 5+ messages in thread
From: limp @ 2011-05-12 10:55 UTC (permalink / raw)
  To: kernelnewbies

Hi all,

 

About a month ago I've made a question in the ML regarding the contents of
the CR3 register and how the value of this register change when different
processes/threads are executed.

 

One of the conclusions of the conversation we had was that when kernel
threads are executed, the CR3 register keeps the value of the process under
which the kernel thread is executed (which is the previously executed
process). That is, the kernel thread "borrows" the page-table of the
previously executed process for executing.

 

The problem is that by looking *only* at the CR3 register, we can't really
tell if the user process in which the CR3 value corresponds to (each process
is assigned a unique PGD value which results to a unique CR3 value) *or* a
kernel-thread that uses its tables is executing.

 

I was wondering if any other CPU register (apart from CR3) can indicate if a
user-process or a kernel thread under it (and which one) is executed. Is it
possible to know such a thing *only* by looking at CPU registers?

 

I'll be happy to clarify any of the above.

 

Thank you all in advance.

 

John K.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110512/3b394a06/attachment.html 

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

end of thread, other threads:[~2011-05-14 19:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-12 10:55 Identifying whether a user-process or kernel-thread execution takes place by looking at CPU registers limp
2011-05-12 11:53 ` Mulyadi Santosa
2011-05-13  1:55   ` Dave Hylands
2011-05-14 17:55     ` limp
2011-05-14 19:12       ` Dave Hylands

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).