Skip to content

Commit 53a0868

Browse files
Michael HolzheuMartin Schwidefsky
authored andcommitted
[S390] zcore: fix inline assembly in memcpy_real()
memcpy_real uses the mvcle instruction. This instruction alters all used registers (source, destination and 2 x count). Therefore we have to flag those registers as input/output registers (+d). In addition to that, we have to specify, that we read from memory designated by "src" and write to memory designated by "dest". Signed-off-by: Michael Holzheu <holzheu@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent cebe0fe commit 53a0868

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎drivers/s390/char/zcore.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,16 @@ static int memcpy_real(void *dest, unsigned long src, size_t count)
141141

142142
if (count == 0)
143143
return 0;
144-
flags = __raw_local_irq_stnsm(0xf8); /* switch to real mode */
144+
flags = __raw_local_irq_stnsm(0xf8UL); /* switch to real mode */
145145
asm volatile (
146146
"0: mvcle %1,%2,0x0\n"
147147
"1: jo 0b\n"
148148
" lhi %0,0x0\n"
149149
"2:\n"
150150
EX_TABLE(1b,2b)
151-
: "+d" (rc)
152-
: "d" (_dest), "d" (_src), "d" (_len1), "d" (_len2)
151+
: "+d" (rc), "+d" (_dest), "+d" (_src), "+d" (_len1),
152+
"+d" (_len2), "=m" (*((long*)dest))
153+
: "m" (*((long*)src))
153154
: "cc", "memory");
154155
__raw_local_irq_ssm(flags);
155156

0 commit comments

Comments
 (0)