Skip to content

Commit 591d879

Browse files
committed
Merge tag 's390-7.0-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Vasily Gorbik: - Fix stackleak and xor lib inline asm, constraints and clobbers to prevent miscompilations and incomplete stack poisoning * tag 's390-7.0-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390/stackleak: Fix __stackleak_poison() inline assembly constraint s390/xor: Improve inline assembly constraints s390/xor: Fix xor_xc_2() inline assembly constraints s390/xor: Fix xor_xc_5() inline assembly
2 parents 4660e16 + 674c5ff commit 591d879

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

arch/s390/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static __always_inline void __stackleak_poison(unsigned long erase_low,
159159
" j 4f\n"
160160
"3: mvc 8(1,%[addr]),0(%[addr])\n"
161161
"4:"
162-
: [addr] "+&a" (erase_low), [count] "+&d" (count), [tmp] "=&a" (tmp)
162+
: [addr] "+&a" (erase_low), [count] "+&a" (count), [tmp] "=&a" (tmp)
163163
: [poison] "d" (poison)
164164
: "memory", "cc"
165165
);

arch/s390/lib/xor.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ static void xor_xc_2(unsigned long bytes, unsigned long * __restrict p1,
2828
" j 3f\n"
2929
"2: xc 0(1,%1),0(%2)\n"
3030
"3:"
31-
: : "d" (bytes), "a" (p1), "a" (p2)
32-
: "0", "cc", "memory");
31+
: "+a" (bytes), "+a" (p1), "+a" (p2)
32+
: : "0", "cc", "memory");
3333
}
3434

3535
static void xor_xc_3(unsigned long bytes, unsigned long * __restrict p1,
@@ -54,7 +54,7 @@ static void xor_xc_3(unsigned long bytes, unsigned long * __restrict p1,
5454
"2: xc 0(1,%1),0(%2)\n"
5555
"3: xc 0(1,%1),0(%3)\n"
5656
"4:"
57-
: "+d" (bytes), "+a" (p1), "+a" (p2), "+a" (p3)
57+
: "+a" (bytes), "+a" (p1), "+a" (p2), "+a" (p3)
5858
: : "0", "cc", "memory");
5959
}
6060

@@ -85,7 +85,7 @@ static void xor_xc_4(unsigned long bytes, unsigned long * __restrict p1,
8585
"3: xc 0(1,%1),0(%3)\n"
8686
"4: xc 0(1,%1),0(%4)\n"
8787
"5:"
88-
: "+d" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4)
88+
: "+a" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4)
8989
: : "0", "cc", "memory");
9090
}
9191

@@ -96,7 +96,6 @@ static void xor_xc_5(unsigned long bytes, unsigned long * __restrict p1,
9696
const unsigned long * __restrict p5)
9797
{
9898
asm volatile(
99-
" larl 1,2f\n"
10099
" aghi %0,-1\n"
101100
" jm 6f\n"
102101
" srlg 0,%0,8\n"
@@ -122,7 +121,7 @@ static void xor_xc_5(unsigned long bytes, unsigned long * __restrict p1,
122121
"4: xc 0(1,%1),0(%4)\n"
123122
"5: xc 0(1,%1),0(%5)\n"
124123
"6:"
125-
: "+d" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4),
124+
: "+a" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4),
126125
"+a" (p5)
127126
: : "0", "cc", "memory");
128127
}

0 commit comments

Comments
 (0)