NickJohnson wrote:
Technique 2 involves putting the physical address of the page directory into the last entry of the page directory, thereby making it a valid page table as well.
You can indeed extend the tricky to support mapping page directory into any entry, for instant, I map last entry on 32-bit flat paging, and entry 510 (-512GB ~ -256GB) on 64-bit build, furthermore I use flexible macro instead of hard-code those magic number so that it can be easily changed.
Then, you can also adopt an hybrid mix of the two methods - access local pages with recursive, while have method (1) to case-by-case specially handle situations for cross address-space access, like having a small section of each process mapping globally.