Self-referencing PML4 - what are the advantages
Posted: Mon Jun 28, 2010 6:48 pm
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 ?
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 ?