Skip to content

Commit 2a52007

Browse files
committed
Merge tag 's390-6.14-6' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
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
2 parents 21e4543 + b4a1dec commit 2a52007

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

arch/s390/kernel/ftrace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,13 @@ void ftrace_graph_func(unsigned long ip, unsigned long parent_ip,
266266
struct ftrace_ops *op, struct ftrace_regs *fregs)
267267
{
268268
unsigned long *parent = &arch_ftrace_regs(fregs)->regs.gprs[14];
269+
unsigned long sp = arch_ftrace_regs(fregs)->regs.gprs[15];
269270

270271
if (unlikely(ftrace_graph_is_dead()))
271272
return;
272273
if (unlikely(atomic_read(&current->tracing_graph_pause)))
273274
return;
274-
if (!function_graph_enter_regs(*parent, ip, 0, parent, fregs))
275+
if (!function_graph_enter_regs(*parent, ip, 0, (unsigned long *)sp, fregs))
275276
*parent = (unsigned long)&return_to_handler;
276277
}
277278

arch/s390/kernel/traps.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,10 @@ static void __init test_monitor_call(void)
285285
return;
286286
asm volatile(
287287
" mc 0,0\n"
288-
"0: xgr %0,%0\n"
288+
"0: lhi %[val],0\n"
289289
"1:\n"
290-
EX_TABLE(0b,1b)
291-
: "+d" (val));
290+
EX_TABLE(0b, 1b)
291+
: [val] "+d" (val));
292292
if (!val)
293293
panic("Monitor call doesn't work!\n");
294294
}

tools/testing/selftests/vDSO/parse_vdso.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ static struct vdso_info
5353
/* Symbol table */
5454
ELF(Sym) *symtab;
5555
const char *symstrings;
56-
ELF(Word) *gnu_hash;
56+
ELF(Word) *gnu_hash, *gnu_bucket;
5757
ELF_HASH_ENTRY *bucket, *chain;
5858
ELF_HASH_ENTRY nbucket, nchain;
5959

@@ -185,8 +185,8 @@ void vdso_init_from_sysinfo_ehdr(uintptr_t base)
185185
/* The bucket array is located after the header (4 uint32) and the bloom
186186
* filter (size_t array of gnu_hash[2] elements).
187187
*/
188-
vdso_info.bucket = vdso_info.gnu_hash + 4 +
189-
sizeof(size_t) / 4 * vdso_info.gnu_hash[2];
188+
vdso_info.gnu_bucket = vdso_info.gnu_hash + 4 +
189+
sizeof(size_t) / 4 * vdso_info.gnu_hash[2];
190190
} else {
191191
vdso_info.nbucket = hash[0];
192192
vdso_info.nchain = hash[1];
@@ -268,11 +268,11 @@ void *vdso_sym(const char *version, const char *name)
268268
if (vdso_info.gnu_hash) {
269269
uint32_t h1 = gnu_hash(name), h2, *hashval;
270270

271-
i = vdso_info.bucket[h1 % vdso_info.nbucket];
271+
i = vdso_info.gnu_bucket[h1 % vdso_info.nbucket];
272272
if (i == 0)
273273
return 0;
274274
h1 |= 1;
275-
hashval = vdso_info.bucket + vdso_info.nbucket +
275+
hashval = vdso_info.gnu_bucket + vdso_info.nbucket +
276276
(i - vdso_info.gnu_hash[1]);
277277
for (;; i++) {
278278
ELF(Sym) *sym = &vdso_info.symtab[i];

0 commit comments

Comments
 (0)