Re: a question on cr3

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

 



Thank you Mulyadi for your answer, appreciate very much!!!!

On 6/28/08, Mulyadi Santosa <mulyadi.santosa@xxxxxxxxx> wrote:
> Hi !
>
> On 6/27/08, Peter Teoh <htmldeveloper@xxxxxxxxx> wrote:
>  > Is it true that the values of CR3 never change throughout the kernel
>  > life time?  Ie, it points to based of the pagetable....so unless the
>  > pagetable is migrated it is not necessary to change.
>
>
> It change whenever there is context switching between processes. Since
>  threads which belong to same parent share PGD, CR3 stays still if a
>  thread change to another thread which belong to the same parent (thus
>  share same tgid)
>

Ah...yes....which means that every process context switch the cr3 will
change.   But  per-threads inside the process, nothing happened.

I can see the pagetable creation per process in kernel/fork.c -
essentially those  pgd alloc stuff.   Correct?   Thanks.

>
>  > And when the kernel switch to the userspace , each different process
>  > should have its own per-process pagetable...so in this case the CR3
>  > will change its value per-process, correct?
>
>
> CR3 stays the same when there is a switch between user space to kernel
>  space or vice versa (if there is no preemption in between...of
>  course).
>

-- 
Regards,
Peter Teoh

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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