Commit 591d8796 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 4660e168 674c5ff0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@ static __always_inline void __stackleak_poison(unsigned long erase_low,
		"	j	4f\n"
		"3:	mvc	8(1,%[addr]),0(%[addr])\n"
		"4:"
		: [addr] "+&a" (erase_low), [count] "+&d" (count), [tmp] "=&a" (tmp)
		: [addr] "+&a" (erase_low), [count] "+&a" (count), [tmp] "=&a" (tmp)
		: [poison] "d" (poison)
		: "memory", "cc"
		);
+5 −6
Original line number Diff line number Diff line
@@ -28,8 +28,8 @@ static void xor_xc_2(unsigned long bytes, unsigned long * __restrict p1,
		"	j	3f\n"
		"2:	xc	0(1,%1),0(%2)\n"
		"3:"
		: : "d" (bytes), "a" (p1), "a" (p2)
		: "0", "cc", "memory");
		: "+a" (bytes), "+a" (p1), "+a" (p2)
		: : "0", "cc", "memory");
}

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,
		"2:	xc	0(1,%1),0(%2)\n"
		"3:	xc	0(1,%1),0(%3)\n"
		"4:"
		: "+d" (bytes), "+a" (p1), "+a" (p2), "+a" (p3)
		: "+a" (bytes), "+a" (p1), "+a" (p2), "+a" (p3)
		: : "0", "cc", "memory");
}

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

@@ -96,7 +96,6 @@ static void xor_xc_5(unsigned long bytes, unsigned long * __restrict p1,
		     const unsigned long * __restrict p5)
{
	asm volatile(
		"	larl	1,2f\n"
		"	aghi	%0,-1\n"
		"	jm	6f\n"
		"	srlg	0,%0,8\n"
@@ -122,7 +121,7 @@ static void xor_xc_5(unsigned long bytes, unsigned long * __restrict p1,
		"4:	xc	0(1,%1),0(%4)\n"
		"5:	xc	0(1,%1),0(%5)\n"
		"6:"
		: "+d" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4),
		: "+a" (bytes), "+a" (p1), "+a" (p2), "+a" (p3), "+a" (p4),
		  "+a" (p5)
		: : "0", "cc", "memory");
}