Skip to content

PTW: traverse check GPA bits higher than HGATP mode also if table - #3788

Merged
ingallsj merged 1 commit into
masterfrom
ptw_gpa
Apr 21, 2026
Merged

PTW: traverse check GPA bits higher than HGATP mode also if table#3788
ingallsj merged 1 commit into
masterfrom
ptw_gpa

Conversation

@ingallsj

Copy link
Copy Markdown
Contributor

Related issue: Introduced by previous fix #3651.

Type of change: bug report

Impact: functional fix

Development Phase: implementation

Release Notes
In the failing scenario, a Stage-1 (VS-mode) table (non-leaf) PTE PPN is larger than the Stage-2 (G-stage) input GPA maximum size. The previous fix only validated GPA bits higher than the HGATP mode for leaf PTEs, but the specification requires this check for all PTEs during page table traversal, including non-leaf (table) PTEs, which this fix does.

Changes in PTW.scala:

  1. In equation gf: qualify the previous fix PTW: traverse check GPA bits higher than HGATP mode only if leaf #3651 to check for just pte.leaf() at the last level only. At non-last levels, this allows both leaf (superpage) and non-leaf entries.
  2. In equation ae: suppress access exceptions when a guest page fault gf should be taken instead.
  3. Capture the upper bits of the Stage-1 (VS-mode) PTE PPN in gpa_pgoff, even if they are higher than the r_pte can hold, to use in reporting the faulting GPA in the equation resp.bits.gpa.bits.
  4. Do not advance the PTW FSM state or count to the s_fragment_superpage state when reporting a fault from the PTW, so that the r_pte captured does not change in the equation resp.bits.gpa.bits.

@ingallsj
ingallsj merged commit 118ba74 into master Apr 21, 2026
29 checks passed
@ingallsj
ingallsj deleted the ptw_gpa branch April 21, 2026 22:24
pipelinedestroyer added a commit to soct-org/rocket-chip that referenced this pull request May 20, 2026
Incorporates upstream changes:
- PTW: access vs guest page fault exception prioritization for Stage-1 PTEs with unsupported GPA sizes (chipsalliance#3789)
- PTW: traverse check GPA bits higher than HGATP mode also if table (chipsalliance#3788)
- PeripheryBus: named in/out xbars in getOrElse path
- TraceEncoderController: add hartId parameter

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants