kernel/x86_64: Correct address mask in DebugGetReverseMappingInfo.

With how we currently use virtual address spaces, the old and
new computations should produce identical results even on LA57,
but this should be more correct if we ever do use more than just
48 bits of the address space.

Change-Id: I61915fceff8e7998032e0a9895010ef9c26b7b94
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9121
Haiku-Format: Haiku-format Bot <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Augustin Cavalier
2025-03-13 12:55:59 +00:00
committed by waddlesplash
parent d68fa86ee1
commit 80f7969714
@@ -786,8 +786,13 @@ X86VMTranslationMap64Bit::DebugGetReverseMappingInfo(phys_addr_t physicalAddress
if ((virtualPML4[i] & X86_64_PML4E_PRESENT) == 0)
continue;
uint64 addressMask = 0;
if (i >= 256)
addressMask = fLA57 ? 0xff00000000000000LL : 0xfffff00000000000LL;
if (fLA57) {
if (p >= 256)
addressMask = 0xff00000000000000LL;
} else {
if (i >= 256)
addressMask = 0xfffff00000000000LL;
}
const uint64* virtualPDPT = (uint64*)fPageMapper->GetPageTableAt(
virtualPML4[i] & X86_64_PML4E_ADDRESS_MASK);