Skip to content

Commit 776ca15

Browse files
committed
sparc: Fix syscall fallback bugs in VDSO.
First, the trap number for 32-bit syscalls is 0x10. Also, only negate the return value when syscall error is indicated by the carry bit being set. Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c343db4 commit 776ca15

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

arch/sparc/vdso/vclock_gettime.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,19 @@
3333
#define TICK_PRIV_BIT (1ULL << 63)
3434
#endif
3535

36+
#ifdef CONFIG_SPARC64
3637
#define SYSCALL_STRING \
3738
"ta 0x6d;" \
38-
"sub %%g0, %%o0, %%o0;" \
39+
"bcs,a 1f;" \
40+
" sub %%g0, %%o0, %%o0;" \
41+
"1:"
42+
#else
43+
#define SYSCALL_STRING \
44+
"ta 0x10;" \
45+
"bcs,a 1f;" \
46+
" sub %%g0, %%o0, %%o0;" \
47+
"1:"
48+
#endif
3949

4050
#define SYSCALL_CLOBBERS \
4151
"f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \

tools/perf/util/event.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,7 @@ void *cpu_map_data__alloc(struct cpu_map *map, size_t *size, u16 *type, int *max
10811081
}
10821082

10831083
*size += sizeof(struct cpu_map_data);
1084+
*size = PERF_ALIGN(*size, sizeof(u64));
10841085
return zalloc(*size);
10851086
}
10861087

@@ -1560,7 +1561,9 @@ struct map *thread__find_map(struct thread *thread, u8 cpumode, u64 addr,
15601561

15611562
return NULL;
15621563
}
1564+
#if 0
15631565
try_again:
1566+
#endif
15641567
al->map = map_groups__find(mg, al->addr);
15651568
if (al->map == NULL) {
15661569
/*
@@ -1572,13 +1575,15 @@ struct map *thread__find_map(struct thread *thread, u8 cpumode, u64 addr,
15721575
* "[vdso]" dso, but for now lets use the old trick of looking
15731576
* in the whole kernel symbol list.
15741577
*/
1578+
#if 0
15751579
if (cpumode == PERF_RECORD_MISC_USER && machine &&
15761580
mg != &machine->kmaps &&
15771581
machine__kernel_ip(machine, al->addr)) {
15781582
mg = &machine->kmaps;
15791583
load_map = true;
15801584
goto try_again;
15811585
}
1586+
#endif
15821587
} else {
15831588
/*
15841589
* Kernel maps might be changed when loading symbols so loading

0 commit comments

Comments
 (0)