Identifying whether a user-process or kernel-thread execution takes place by looking at CPU registers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux