Skip to content

Fix aarch64 page table parsing for 5 level paging#158

Merged
cfernald merged 3 commits intomicrosoft:mainfrom
cfernald:level_fix
Mar 4, 2026
Merged

Fix aarch64 page table parsing for 5 level paging#158
cfernald merged 3 commits intomicrosoft:mainfrom
cfernald:level_fix

Conversation

@cfernald
Copy link
Contributor

@cfernald cfernald commented Mar 4, 2026

With 2511, the arm mmu library added support for an additional paging level. When this occurs the current debugger logic will underflow and start parsing the page tables with garbage levels and entry counts. This change updates the level calculation to reflect the arm mmu library changes.

Description

With 2511, the arm mmu library added support for an additional paging level. When this occurs the current debugger logic will underflow and start parsing the page tables with garbage levels and entry counts. This change updates the level calculation to reflect the arm mmu library changes.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Tested on SBSA initial breakpoint

Integration Instructions

N/A

With 2511, the arm mmu library added support for an additional paging level.
When this occurs the current debugger logic will underflow and start parsing
the page tables with garbage levels and entry counts. This change updates
the level calculation to reflect the arm mmu library changes.
@mu-automation mu-automation bot added the impact:non-functional Does not have a functional impact label Mar 4, 2026
@cfernald cfernald added bug Something isn't working and removed impact:non-functional Does not have a functional impact labels Mar 4, 2026
@cfernald cfernald requested review from apop5, Copilot, kuqin12 and os-d March 4, 2026 20:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the AArch64 debugger’s page-table walking logic to account for the Arm MMU library introducing an additional paging level (5-level paging), preventing level calculation underflow that can lead to garbage parsing.

Changes:

  • Change the page-table walker’s TableLevel type from UINTN to INTN to allow representing an extra top level.
  • Add a guard so TableLevel becomes -1 when T0SZ < MIN_T0SZ (5-level paging scenario).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cfernald cfernald enabled auto-merge (squash) March 4, 2026 21:09
@cfernald cfernald merged commit aee730d into microsoft:main Mar 4, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants