Skip to content

Commit ac5bf06

Browse files
hcahcaAlexander Gordeev
authored andcommitted
s390/page: Add memory clobber to page_set_storage_key()
Add memory clobbers to the page_set_storage_key() inline assemblies. This allows for data dependencies from other code, which is important to prevent the compiler from reordering instructions if required. Note that this doesn't fix a bug in existing code; this is just a prerequisite for upcoming code changes. Reviewed-by: Claudio Imbrenda <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Alexander Gordeev <[email protected]>
1 parent 839d364 commit ac5bf06

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/s390/include/asm/page.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,14 @@ static inline void page_set_storage_key(unsigned long addr,
134134
asm volatile(
135135
" .insn rrf,0xb22b0000,%[skey],%[addr],8,0"
136136
:
137-
: [skey] "d" (skey), [addr] "a" (addr));
137+
: [skey] "d" (skey), [addr] "a" (addr)
138+
: "memory");
138139
} else {
139140
asm volatile(
140141
" sske %[skey],%[addr]"
141142
:
142-
: [skey] "d" (skey), [addr] "a" (addr));
143+
: [skey] "d" (skey), [addr] "a" (addr)
144+
: "memory");
143145
}
144146
}
145147

0 commit comments

Comments
 (0)