Self-referencing PML4 - what are the advantages

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Self-referencing PML4 - what are the advantages

Post by gerryg400 »

Having spent some time figuring out how this little trick works and implementing it, I'm now wondering whether I really need it.

In long mode it's possible to contiguously map the entire of physical memory somewhere in the upper half, let's say at 0xffff'8000'0000'0000 and then to have a function/macro that can convert any physical address to a kernel accessable linear address by simply adding 0xffff'8000'0000'0000. Wouldn't that then give me permanent access to the page-tables etc. of any process by simply walking down from that process's cr3 using my simple phys_to_kern function ?

Am I missing something here ?
If a trainstation is where trains stop, what is a workstation ?
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Self-referencing PML4 - what are the advantages

Post by Owen »

Yes.

For a start, theres more physical address space than there is virtual.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: Self-referencing PML4 - what are the advantages

Post by gerryg400 »

True, but for the next few years, no-one's gonna have enough RAM for that to matter are they? There's 128TB-2GB of 'spare' virtual mem in the higher half....
If a trainstation is where trains stop, what is a workstation ?
Post Reply