Repository navigation
Don't update A/D in the HPTW for leaf PTEs with reserved encodings - #1965
Open
davidharrishmc wants to merge 1 commit into
Open
davidharrishmc wants to merge 1 commit into
davidharrishmc wants to merge 1 commit into
Conversation
On a TLB miss with Svadu, the walker wrote A/D back to a leaf PTE whose reserved bits (60:54), PBMT, or N encoding cause a page fault, because its fault check omitted those conditions. The spec stops the walk at step 3 for reserved encodings, before the A/D update in step 9. Use the same conditions as tlbcontrol's BadReserved, BadPBMT, and BadNAPOT. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With Svadu (menvcfg.ADUE=1), a TLB miss on a leaf PTE with A=0 and a reserved encoding (nonzero bits 60:54, PBMT=3 or PBMT≠0 without Svpbmt/PBMTE, or a reserved NAPOT encoding) wrote A/D back to memory before tlbcontrol raised the page fault. The hptw's
OtherPageFaultomitted these checks, although tlbcontrol's TLB-hit path already gated its update with them.The privileged spec stops translation at step 3 when "any bits or encodings that are reserved for future standard use are set within pte", before the A/D update in step 9, so the PTE must not change. The fix adds the same conditions as tlbcontrol's
BadReserved/BadPBMT/BadNAPOTto the walker's fault check.Found by the new ACT
Svadu_sv{39,48,57}_Svadu_fault_Smodetests (reserved bit 54 case), which now pass. All 677 rv64gc and 54 rv32gc privileged/virtual-memory ACT tests pass in Verilator, and lint is clean.🤖 Generated with Claude Code