This commit fixes the page table walk when using 4-level mappings. Linux can use 64-bit memory to store tables, and masking off the upper 32-bits prevents the walk from functioning properly. Additionally, the physical instruction calculation was using the incorrect logical address bits for each level. Finally, the last PTE doesn't have the 7th bit flag a valid page, we just check the first bit to ensure the entry is present, and calculate the PTE address.
This commit fixes the page table walk when using 4-level mappings. Linux can use 64-bit memory to store tables, and masking off the upper 32-bits prevents the walk from functioning properly. Additionally, the physical instruction calculation was using the incorrect logical address bits for each level. Finally, the last PTE doesn't have the 7th bit flag a valid page, we just check the first bit to ensure the entry is present, and calculate the PTE address.