Repository navigation
Svvptc: do not cache invalid PTEs in the TLB - #1974
Open
davidharrishmc wants to merge 3 commits into
Open
davidharrishmc wants to merge 3 commits into
davidharrishmc wants to merge 3 commits into
Conversation
The HPTW wrote a walk that ended at an invalid (V=0) leaf or non-leaf PTE into the ITLB/DTLB, and later hits raised the page fault from the cached entry until an SFENCE.VMA. A handler that sets V=1 and retries without SFENCE.VMA (legal with Svvptc, an RVA23 option) then faults forever. The walker now raises the page fault itself from LEAF through the existing FAULT path, as it does for reserved non-leaf PTE bits, and writes nothing into the TLB. The next access re-walks and sees the updated PTE. Since the TLB never holds an invalid PTE, tlbcontrol no longer checks PTE.V; the ITLB ENVCFG_ADUE_1 coverage exclusion moves from row 18 to row 16 accordingly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The HPTW no longer caches invalid PTEs, so these configurations implement Svvptc, as their sail.json files already claim. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
davidharrishmc
force-pushed
the
dh/svvptc
branch
from
October 11, 2026 22:22
65ca95a to
a914dfb
Compare
This was referenced Oct 12, 2026
riscv-arch-test#2770 turned Svvptc off in the ACT copies of the rv32gc and rv64gc Sail configurations because the walker cached invalid PTEs, and cvw#1985 brings that to main. This branch fixes the walker, so Svvptc stays supported here. The comment touches the same lines, so the next merge of main into rva23 conflicts instead of silently turning Svvptc off. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: David Harris <David_Harris@hmc.edu>
Contributor
|
This is an interesting change. Originally the hptw did not write invalid entries into the TLB. We switched it because an ITLB fault would occur multiple times for each instruction in the pipeline until the faulting instruction made it to the Memory stage wasting many cycles. With this change we should also prevent the subsequent instruction fetches from making requests until the ITLB fault makes it to the Memory stage. |
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.
Implements Svvptc, an RVA23 option. Wally's walker wrote the entry for an invalid PTE (V=0, at any level) into the I-TLB/D-TLB, so the replayed access kept faulting until SFENCE.VMA or eviction; Svvptc requires stores that set V from 0 to 1 to become visible to later implicit accesses in bounded time (
norm:Svvptc_explicit_stores_update_valid_bit).hptw.sv:InvalidPTEFaultMsends LEAF to FAULT, blocks the TLB write, and raises the page fault through the existing walk-fault path (which already handles fetch spills, misaligned spills and pending walks).tlbcontrol.sv:~PTE_Vdrops out of the hit-path page fault (the TLB can no longer hold V=0); the ITLB ADUE coverage-exclusion row moves accordingly.sail.jsonalready did).Found by FORCE-RISCV in ImperasDV lockstep. The FORCE reproducers and directed load/store/fetch, leaf/non-leaf, fetch-spill and misaligned-spill tests pass (also on Sail); the new ACT Svvptc suite (riscv/riscv-arch-test#2776) fails on rva23 and passes with this change; lockstep over all rv64gc/rv32gc Sv priv suites, Misalign and coverage tests shows only the existing Svnapot waivers; Verilator regression and
lint-wallyare unchanged.🤖 Generated with Claude Code