No, cr3 doesn?t need to swap for a user to kernel transition on x86 and amd64. If you grab your local handy copy of the Intel manuals (which, last time I checked, Intel was happy to send you hardcopies for free if you managed to navigate their website to the right spot), there?s a user/supervisor bit (!pte calls it the user/kernel or owner bit) that controls what privilege level (CPL) is necessary to access a page.
That is the mechanism by which NT on x86 and amd64 currently protects kernel memory from user mode, not by simply making it inaccessible by providing a separate paging structure stack.
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of A P
Sent: Wednesday, July 22, 2009 9:11 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] cr3 contains junk??
answering all of your questions below:
No I don’t care about the value of cr3, it is just that I wanted to understand how things are working in more detail. So I expected, that when the user process makes a transition to kernel mode, the value of cr3 should be changed to the respective kernel mode ones. But this i what I do not see, ofcourse everything works like clock work, making me ore curios as to how it is working if cr3 still has tland process spcific value.
How I saw cr3? well in windbg, i do a rcr3 to get the adress. the address contains the user mode address. Also, I use !dc to view physical memory. and !vtp to convert virtual addresses to physical ones.
Thanks
ap
On Thu, Jul 23, 2009 at 12:41 AM, > wrote:
> i see that windows in app mod sets this value to the dr base addr for the add
Perhaps you should look better - accessing control register is a privileged operation, so that it just cannot be modified by the UM code under ANY OS…
Anton Bassov
—
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
— NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer