Преглед изворни кода

s390/cpumf: fix qsi inline assembly

The qsi inline assembly takes an initialized "cc" variable as output
operand but specifies it as write-to operand only instead of
read/write operand. This allows the compiler to omit the
initialization, which in fact it also does (gcc 6.1).

Use the "+" constraint modifier to fix this. In addition also use the
Q constraint to specify the hws_qsi_info_block memory location, so the
compiler can generate slightly better code. Also get rid of the cc
clobber since none of the instructions within the inline assembly
modify the condition code.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Heiko Carstens пре 9 година
родитељ
комит
259acc5c25
1 измењених фајлова са 3 додато и 7 уклоњено
  1. 3 7
      arch/s390/include/asm/cpu_mf.h

+ 3 - 7
arch/s390/include/asm/cpu_mf.h

@@ -213,18 +213,14 @@ static inline int stcctm5(u64 num, u64 *val)
 /* Query sampling information */
 /* Query sampling information */
 static inline int qsi(struct hws_qsi_info_block *info)
 static inline int qsi(struct hws_qsi_info_block *info)
 {
 {
-	int cc;
-	cc = 1;
+	int cc = 1;
 
 
 	asm volatile(
 	asm volatile(
-		"0:	.insn	s,0xb2860000,0(%1)\n"
+		"0:	.insn	s,0xb2860000,%1\n"
 		"1:	lhi	%0,0\n"
 		"1:	lhi	%0,0\n"
 		"2:\n"
 		"2:\n"
 		EX_TABLE(0b, 2b) EX_TABLE(1b, 2b)
 		EX_TABLE(0b, 2b) EX_TABLE(1b, 2b)
-		: "=d" (cc), "+a" (info)
-		: "m" (*info)
-		: "cc", "memory");
-
+		: "+d" (cc), "+Q" (*info));
 	return cc ? -EINVAL : 0;
 	return cc ? -EINVAL : 0;
 }
 }