Skip to content

Commit 2c2a793

Browse files
authored
Clarify that protection checks apply to failed SC (riscv#1893)
Resolves riscv#1892
1 parent 9d9adde commit 2c2a793

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/a-st-ext.adoc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,14 @@ if the reservation is still valid and the reservation set contains the
6666
bytes being written. If the SC.W succeeds, the instruction writes the
6767
word in _rs2_ to memory, and it writes zero to _rd_. If the SC.W fails,
6868
the instruction does not write to memory, and it writes a nonzero value
69-
to _rd_. For the purposes of memory protection, a failed SC.W may be
70-
treated like a store. Regardless of success or failure, executing an
69+
to _rd_.
70+
No SC.W instruction shall retire unless it passes memory permission checks,
71+
but it is UNSPECIFIED whether any side effects of implicit address translation
72+
and protection memory accesses (such as setting a page-table entry D bit)
73+
occur on a failed SC.W.
74+
For the purposes of memory protection, a failed SC.W may be
75+
treated like a store.
76+
Regardless of success or failure, executing an
7177
SC.W instruction invalidates any reservation held by this hart. LR.D and
7278
SC.D act analogously on doublewords and are only available on RV64. For
7379
RV64, LR.W and SC.W sign-extend the value placed in _rd_.

0 commit comments

Comments
 (0)