summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2025-06-16 17:00:28 +0200
committerAlexander Gordeev <agordeev@linux.ibm.com>2025-06-29 13:12:01 +0200
commitac5bf0665011db2b4aa167e971195a166e0d8d2f (patch)
tree0759a778c13de7cefdeabb38db8a97c69cd5062f
parent839d364e41c064cb8bee1c028822f1e97b206ef6 (diff)
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 <imbrenda@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
-rw-r--r--arch/s390/include/asm/page.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/s390/include/asm/page.h b/arch/s390/include/asm/page.h
index 79db884b8e3e..843c5cba882f 100644
--- a/arch/s390/include/asm/page.h
+++ b/arch/s390/include/asm/page.h
@@ -134,12 +134,14 @@ static inline void page_set_storage_key(unsigned long addr,
asm volatile(
" .insn rrf,0xb22b0000,%[skey],%[addr],8,0"
:
- : [skey] "d" (skey), [addr] "a" (addr));
+ : [skey] "d" (skey), [addr] "a" (addr)
+ : "memory");
} else {
asm volatile(
" sske %[skey],%[addr]"
:
- : [skey] "d" (skey), [addr] "a" (addr));
+ : [skey] "d" (skey), [addr] "a" (addr)
+ : "memory");
}
}