Skip to contentSkip to conversation

lib: s390x: css: Cleanup chsc inline assembly

PATCH In review Janosch Frank 2 participants 2 messages Feb 6, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib: s390x: css: Cleanup chsc inline assembly

Name the CHSC command block pointer instead of naming it "p".

Also replace the two "m" constraints with a memory globber so the constraints are easier to read.

---

To me it makes more sense to have a separate commit that has a message explaining why we changed it instead of sending a v2, so here it is.

---
 lib/s390x/css.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
lib/s390x/css.h +5 -5
index 06bb59c7..167f8e83 100644
@@ -364,16 +364,16 @@ bool get_chsc_scsc(void);
 #define CHSC_RSP_EBUSY	0x000B
 #define CHSC_RSP_MAX	0x000B
 
-static inline int _chsc(void *p)
+static inline int _chsc(void *com_blk)
 {
 	int cc;
 
-	asm volatile(" .insn   rre,0xb25f0000,%2,0\n"
+	asm volatile(" .insn   rre,0xb25f0000,%[com_blk],0\n"
 		     " ipm     %[cc]\n"
 		     " srl     %[cc],28\n"
-		     : [cc] "=d" (cc), "=m" (p)
-		     : "d" (p), "m" (p)
-		     : "cc");
+		     : [cc] "=d" (cc)
+		     : [com_blk] "d" (com_blk)
+		     : "cc", "memory");
 
 	return cc;
 }
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · On Thu, 6 Feb 2025 14:58:49 +0000 Janosch Frank <[email protected]> wrote:

Name the CHSC command block pointer instead of naming it "p".

Also replace the two "m" constraints with a memory globber so the constraints are easier to read.

Quoted 4 lines

---

To me it makes more sense to have a separate commit that has a message explaining why we changed it instead of sending a v2, so here it is.

makes sense

Quoted 31 lines
---
 lib/s390x/css.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
lib/s390x/css.h +5 -5
index 06bb59c7..167f8e83 100644
@@ -364,16 +364,16 @@ bool get_chsc_scsc(void);
 #define CHSC_RSP_EBUSY	0x000B
 #define CHSC_RSP_MAX	0x000B
 
-static inline int _chsc(void *p)
+static inline int _chsc(void *com_blk)
 {
 	int cc;
 
-	asm volatile(" .insn   rre,0xb25f0000,%2,0\n"
+	asm volatile(" .insn   rre,0xb25f0000,%[com_blk],0\n"
 		     " ipm     %[cc]\n"
 		     " srl     %[cc],28\n"
-		     : [cc] "=d" (cc), "=m" (p)
-		     : "d" (p), "m" (p)
-		     : "cc");
+		     : [cc] "=d" (cc)
+		     : [com_blk] "d" (com_blk)
+		     : "cc", "memory");
 
 	return cc;
 }