Skip to content

Commit 259acc5

Browse files
heicarstMartin Schwidefsky
authored andcommitted
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>
1 parent 6d7b2ee commit 259acc5

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

‎arch/s390/include/asm/cpu_mf.h‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,14 @@ static inline int stcctm5(u64 num, u64 *val)
213213
/* Query sampling information */
214214
static inline int qsi(struct hws_qsi_info_block *info)
215215
{
216-
int cc;
217-
cc = 1;
216+
int cc = 1;
218217

219218
asm volatile(
220-
"0: .insn s,0xb2860000,0(%1)\n"
219+
"0: .insn s,0xb2860000,%1\n"
221220
"1: lhi %0,0\n"
222221
"2:\n"
223222
EX_TABLE(0b, 2b) EX_TABLE(1b, 2b)
224-
: "=d" (cc), "+a" (info)
225-
: "m" (*info)
226-
: "cc", "memory");
227-
223+
: "+d" (cc), "+Q" (*info));
228224
return cc ? -EINVAL : 0;
229225
}
230226

0 commit comments

Comments
 (0)