Commit 2a520073 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull s390 fixes from Vasily Gorbik:

 - Fix return address recovery of traced function in ftrace to ensure
   reliable stack unwinding

 - Fix compiler warnings and runtime crashes of vDSO selftests on s390
   by introducing a dedicated GNU hash bucket pointer with correct
   32-bit entry size

 - Fix test_monitor_call() inline asm, which misses CC clobber, by
   switching to an instruction that doesn't modify CC

* tag 's390-6.14-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/ftrace: Fix return address recovery of traced function
  selftests/vDSO: Fix GNU hash table entry size for s390x
  s390/traps: Fix test_monitor_call() inline assembly
parents 21e4543a b4a1dec1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -266,12 +266,13 @@ void ftrace_graph_func(unsigned long ip, unsigned long parent_ip,
		       struct ftrace_ops *op, struct ftrace_regs *fregs)
{
	unsigned long *parent = &arch_ftrace_regs(fregs)->regs.gprs[14];
	unsigned long sp = arch_ftrace_regs(fregs)->regs.gprs[15];

	if (unlikely(ftrace_graph_is_dead()))
		return;
	if (unlikely(atomic_read(&current->tracing_graph_pause)))
		return;
	if (!function_graph_enter_regs(*parent, ip, 0, parent, fregs))
	if (!function_graph_enter_regs(*parent, ip, 0, (unsigned long *)sp, fregs))
		*parent = (unsigned long)&return_to_handler;
}

+3 −3
Original line number Diff line number Diff line
@@ -285,10 +285,10 @@ static void __init test_monitor_call(void)
		return;
	asm volatile(
		"	mc	0,0\n"
		"0:	xgr	%0,%0\n"
		"0:	lhi	%[val],0\n"
		"1:\n"
		EX_TABLE(0b, 1b)
		: "+d" (val));
		: [val] "+d" (val));
	if (!val)
		panic("Monitor call doesn't work!\n");
}
+5 −5
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ static struct vdso_info
	/* Symbol table */
	ELF(Sym) *symtab;
	const char *symstrings;
	ELF(Word) *gnu_hash;
	ELF(Word) *gnu_hash, *gnu_bucket;
	ELF_HASH_ENTRY *bucket, *chain;
	ELF_HASH_ENTRY nbucket, nchain;

@@ -185,7 +185,7 @@ void vdso_init_from_sysinfo_ehdr(uintptr_t base)
		/* The bucket array is located after the header (4 uint32) and the bloom
		 * filter (size_t array of gnu_hash[2] elements).
		 */
		vdso_info.bucket = vdso_info.gnu_hash + 4 +
		vdso_info.gnu_bucket = vdso_info.gnu_hash + 4 +
				       sizeof(size_t) / 4 * vdso_info.gnu_hash[2];
	} else {
		vdso_info.nbucket = hash[0];
@@ -268,11 +268,11 @@ void *vdso_sym(const char *version, const char *name)
	if (vdso_info.gnu_hash) {
		uint32_t h1 = gnu_hash(name), h2, *hashval;

		i = vdso_info.bucket[h1 % vdso_info.nbucket];
		i = vdso_info.gnu_bucket[h1 % vdso_info.nbucket];
		if (i == 0)
			return 0;
		h1 |= 1;
		hashval = vdso_info.bucket + vdso_info.nbucket +
		hashval = vdso_info.gnu_bucket + vdso_info.nbucket +
			  (i - vdso_info.gnu_hash[1]);
		for (;; i++) {
			ELF(Sym) *sym = &vdso_info.symtab[i];