Repository navigation
AArch64: vg_dit_enter writes PSTATE.DIT only if it was off - #4328
Closed
reaperhulk wants to merge 1 commit into
Closed
reaperhulk wants to merge 1 commit into
reaperhulk wants to merge 1 commit into
Conversation
This was referenced Nov 6, 2026
This was referenced Nov 6, 2026
reaperhulk
force-pushed
the
claude/dit-skip
branch
from
November 7, 2026 00:25
eda13fd to
f335cdd
Compare
`mrs`, then `cbz` past the `msr` when data independent timing is already on. Its contract makes the mode public (`Spec/Dit.lean`), and the proof shows that it leaks only whether the mode was off (`enter_leak`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ajQWwnPmAfvKpXDUq9Tjq
reaperhulk
force-pushed
the
claude/dit-skip
branch
from
November 7, 2026 01:12
f335cdd to
3af64e1
Compare
This was referenced Nov 7, 2026
Member
Author
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.
vg_dit_enternow writes PSTATE.DIT only if it was off. It is stacked on the Spec change #4327, which is stacked on the TCB change #4326.Proofs (
Proof/Dit/AArch64.lean)enter_leak: every run leaks exactly[.branch (!s.dit)].ConstantTime.of_leakagegives it underSpec.Dit.enterContract, whosepubnow includes the mode (Spec/Dit: vg_dit_enter's contract makes the mode public #4327).enter_wpandenter_dit: unchanged in meaning. Afterwards DIT is on, andx0holds its old value.Rust
No changes.
src/dit.rsalready callsvg_dit_clearonly whenvg_dit_enterreturned 0. So when DIT is already on, an operation now costs onemrsand nomsr. The existing testdit::tests::enter_and_clearcallsvg_dit_enterwith DIT both on and off, so it runs both paths. It passes under QEMU with-cpu max; with-cpu cortex-a72, which lacks FEAT_DIT, the code is never called.What it does not speed up
It only helps when DIT is already on, for example when the application turns it on for the whole thread. #4210 never nests guards, so a library operation called with DIT off still pays one write to turn it on and one to turn it off.
🤖 Generated with Claude Code
https://claude.ai/code/session_015ajQWwnPmAfvKpXDUq9Tjq