Skip to content

Commit b1c41ac

Browse files
heicarstVasily Gorbik
authored andcommitted
KVM: s390: fix __insn32_query() inline assembly
The inline assembly constraints of __insn32_query() tell the compiler that only the first byte of "query" is being written to. Intended was probably that 32 bytes are written to. Fix and simplify the code and just use a "memory" clobber. Fixes: d668139 ("KVM: s390: provide query function for instructions returning 32 byte") Cc: [email protected] # v5.2+ Acked-by: Christian Borntraeger <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 61c3134 commit b1c41ac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/s390/kvm/kvm-s390.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,17 +332,17 @@ static inline int plo_test_bit(unsigned char nr)
332332
return cc == 0;
333333
}
334334

335-
static inline void __insn32_query(unsigned int opcode, u8 query[32])
335+
static inline void __insn32_query(unsigned int opcode, u8 *query)
336336
{
337337
register unsigned long r0 asm("0") = 0; /* query function */
338338
register unsigned long r1 asm("1") = (unsigned long) query;
339339

340340
asm volatile(
341341
/* Parameter regs are ignored */
342342
" .insn rrf,%[opc] << 16,2,4,6,0\n"
343-
: "=m" (*query)
343+
:
344344
: "d" (r0), "a" (r1), [opc] "i" (opcode)
345-
: "cc");
345+
: "cc", "memory");
346346
}
347347

348348
#define INSN_SORTL 0xb938

0 commit comments

Comments
 (0)