Skip to content

Commit

Permalink
Add commentary about multi-hit/failing to SFENCE.VMA
Browse files Browse the repository at this point in the history
  • Loading branch information
aswaterman committed Apr 6, 2020
1 parent 59b2b80 commit 3ebf610
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/supervisor.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,24 @@ \subsection{Supervisor Memory-Management Fence Instruction}
memory locations, an SFENCE.VMA instruction must be executed after the writes
to flush the relevant cached translations.

\begin{commentary}
A consequence of this specification is that an implementation may use any
translation for an address that was valid at any time since the most recent
SFENCE.VMA that subsumes that address.
In particular, if a leaf PTE is modified but a subsuming SFENCE.VMA is not
executed, either the old translation or the new translation will be used, but
the choice is unpredictable.
The behavior is otherwise well-defined.

In a conventional TLB design, it is possible for multiple entries to match a
single address if, for example, a page is upgraded to a superpage without first
clearing the original non-leaf PTE's valid bit and executing an SFENCE.VMA with
{\em rs1}={\tt x0}.
In this case, a similar remark applies: it is unpredictable whether the old
non-leaf PTE or the new leaf PTE is used, but the behavior is otherwise well
defined.
\end{commentary}

Implementations must only perform implicit reads of the translation
data structures pointed to by the current contents of the {\tt satp}
register, and must only raise exceptions for implicit accesses that are
Expand Down

0 comments on commit 3ebf610

Please sign in to comment.