diff options
author | David S. Miller <davem@davemloft.net> | 2018-10-18 00:28:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-18 00:29:23 -0400 |
commit | 776ca1543b5fe673aaf1beb244fcc2429d378083 (patch) | |
tree | c40d5e40a9a3746b21520c2d57a45d0de01ed6fe | |
parent | c343db455eb3105f11bb5ac290d77ab2006b0209 (diff) |
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>
-rw-r--r-- | arch/sparc/vdso/vclock_gettime.c | 12 | ||||
-rw-r--r-- | tools/perf/util/event.c | 5 |
2 files changed, 16 insertions, 1 deletions
diff --git a/arch/sparc/vdso/vclock_gettime.c b/arch/sparc/vdso/vclock_gettime.c index 3feb3d960ca5..75dca9aab737 100644 --- a/arch/sparc/vdso/vclock_gettime.c +++ b/arch/sparc/vdso/vclock_gettime.c | |||
@@ -33,9 +33,19 @@ | |||
33 | #define TICK_PRIV_BIT (1ULL << 63) | 33 | #define TICK_PRIV_BIT (1ULL << 63) |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | #ifdef CONFIG_SPARC64 | ||
36 | #define SYSCALL_STRING \ | 37 | #define SYSCALL_STRING \ |
37 | "ta 0x6d;" \ | 38 | "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 | ||
39 | 49 | ||
40 | #define SYSCALL_CLOBBERS \ | 50 | #define SYSCALL_CLOBBERS \ |
41 | "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ | 51 | "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ |
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 0cd42150f712..651cd6f6762c 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -1081,6 +1081,7 @@ void *cpu_map_data__alloc(struct cpu_map *map, size_t *size, u16 *type, int *max | |||
1081 | } | 1081 | } |
1082 | 1082 | ||
1083 | *size += sizeof(struct cpu_map_data); | 1083 | *size += sizeof(struct cpu_map_data); |
1084 | *size = PERF_ALIGN(*size, sizeof(u64)); | ||
1084 | return zalloc(*size); | 1085 | return zalloc(*size); |
1085 | } | 1086 | } |
1086 | 1087 | ||
@@ -1560,7 +1561,9 @@ struct map *thread__find_map(struct thread *thread, u8 cpumode, u64 addr, | |||
1560 | 1561 | ||
1561 | return NULL; | 1562 | return NULL; |
1562 | } | 1563 | } |
1564 | #if 0 | ||
1563 | try_again: | 1565 | try_again: |
1566 | #endif | ||
1564 | al->map = map_groups__find(mg, al->addr); | 1567 | al->map = map_groups__find(mg, al->addr); |
1565 | if (al->map == NULL) { | 1568 | if (al->map == NULL) { |
1566 | /* | 1569 | /* |
@@ -1572,6 +1575,7 @@ try_again: | |||
1572 | * "[vdso]" dso, but for now lets use the old trick of looking | 1575 | * "[vdso]" dso, but for now lets use the old trick of looking |
1573 | * in the whole kernel symbol list. | 1576 | * in the whole kernel symbol list. |
1574 | */ | 1577 | */ |
1578 | #if 0 | ||
1575 | if (cpumode == PERF_RECORD_MISC_USER && machine && | 1579 | if (cpumode == PERF_RECORD_MISC_USER && machine && |
1576 | mg != &machine->kmaps && | 1580 | mg != &machine->kmaps && |
1577 | machine__kernel_ip(machine, al->addr)) { | 1581 | machine__kernel_ip(machine, al->addr)) { |
@@ -1579,6 +1583,7 @@ try_again: | |||
1579 | load_map = true; | 1583 | load_map = true; |
1580 | goto try_again; | 1584 | goto try_again; |
1581 | } | 1585 | } |
1586 | #endif | ||
1582 | } else { | 1587 | } else { |
1583 | /* | 1588 | /* |
1584 | * Kernel maps might be changed when loading symbols so loading | 1589 | * Kernel maps might be changed when loading symbols so loading |