]>
Commit | Line | Data |
---|---|---|
1c16a62d JB |
1 | FIXME: verify x32 ABI support in regs_load.S |
2 | --- linux-5.11/tools/scripts/Makefile.arch.orig 2021-02-25 19:40:18.181160970 +0100 | |
3 | +++ linux-5.11/tools/scripts/Makefile.arch 2021-02-25 19:46:07.599314457 +0100 | |
4 | @@ -34,8 +34,15 @@ | |
5 | endif | |
bedc6c43 JR |
6 | |
7 | LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1) | |
8 | +ILP32 := $(shell echo __ILP32__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1) | |
e1e434f5 | 9 | +X86_64 := $(shell echo __x86_64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1) |
bedc6c43 JR |
10 | ifeq ($(LP64), 1) |
11 | IS_64_BIT := 1 | |
12 | else | |
13 | IS_64_BIT := 0 | |
14 | endif | |
19d253ca | 15 | +ifeq ($(X86_64)_$(ILP32), 1_1) |
bedc6c43 JR |
16 | + IS_X32_BIT := 1 |
17 | +else | |
18 | + IS_X32_BIT := 0 | |
19 | +endif | |
1c16a62d JB |
20 | --- linux-5.11/tools/perf/Makefile.config.orig 2021-02-25 19:40:18.184494476 +0100 |
21 | +++ linux-5.11/tools/perf/Makefile.config 2021-02-25 19:48:36.007024754 +0100 | |
22 | @@ -61,6 +61,11 @@ | |
51feff82 | 23 | LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind |
bedc6c43 JR |
24 | endif |
25 | NO_PERF_REGS := 0 | |
26 | + ifeq (${IS_X32_BIT}, 1) | |
27 | + CFLAGS += -DHAVE_ARCH_X32_SUPPORT | |
388d18e6 JR |
28 | + ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S |
29 | + LIBUNWIND_LIBS = -lunwind-x86_64 -llzma -lunwind | |
bedc6c43 JR |
30 | + endif |
31 | endif | |
32 | ||
1c16a62d JB |
33 | ifeq ($(SRCARCH),arm) |
34 | --- linux-5.11/tools/perf/arch/x86/tests/regs_load.S.orig 2021-02-14 23:32:24.000000000 +0100 | |
35 | +++ linux-5.11/tools/perf/arch/x86/tests/regs_load.S 2021-02-25 21:46:57.425008548 +0100 | |
36 | @@ -62,6 +62,41 @@ | |
37 | ret | |
def4eb6e | 38 | SYM_FUNC_END(perf_regs_load) |
bedc6c43 | 39 | #else |
60bb5701 | 40 | +#ifdef HAVE_ARCH_X32_SUPPORT |
1c16a62d JB |
41 | +SYM_FUNC_START(perf_regs_load) |
42 | + movq %rax, AX(%edi) | |
43 | + movq %rbx, BX(%edi) | |
44 | + movq %rcx, CX(%edi) | |
45 | + movq %rdx, DX(%edi) | |
46 | + movq %rsi, SI(%edi) | |
47 | + movq %rdi, DI(%edi) | |
48 | + movq %rbp, BP(%edi) | |
49 | + | |
50 | + leaq 8(%rsp), %rax /* exclude this call. */ | |
51 | + movq %rax, SP(%edi) | |
52 | + | |
53 | + movq 0(%rsp), %rax | |
54 | + movq %rax, IP(%edi) | |
55 | + | |
56 | + movq $0, FLAGS(%edi) | |
57 | + movq $0, CS(%edi) | |
58 | + movq $0, SS(%edi) | |
59 | + movq $0, DS(%edi) | |
60 | + movq $0, ES(%edi) | |
61 | + movq $0, FS(%edi) | |
62 | + movq $0, GS(%edi) | |
63 | + | |
64 | + movq %r8, R8(%edi) | |
65 | + movq %r9, R9(%edi) | |
66 | + movq %r10, R10(%edi) | |
67 | + movq %r11, R11(%edi) | |
68 | + movq %r12, R12(%edi) | |
69 | + movq %r13, R13(%edi) | |
70 | + movq %r14, R14(%edi) | |
71 | + movq %r15, R15(%edi) | |
72 | + ret | |
73 | +SYM_FUNC_END(perf_regs_load) | |
bedc6c43 | 74 | +#else |
1c16a62d JB |
75 | SYM_FUNC_START(perf_regs_load) |
76 | push %edi | |
bedc6c43 | 77 | movl 8(%esp), %edi |
1c16a62d JB |
78 | @@ -90,6 +125,7 @@ |
79 | ret | |
80 | SYM_FUNC_END(perf_regs_load) | |
81 | #endif | |
bedc6c43 | 82 | +#endif |
bedc6c43 | 83 | |
1c16a62d JB |
84 | /* |
85 | * We need to provide note.GNU-stack section, saying that we want | |
bedc6c43 JR |
86 | --- linux-3.19/tools/perf/builtin-kvm.c~ 2015-02-09 03:54:22.000000000 +0100 |
87 | +++ linux-3.19/tools/perf/builtin-kvm.c 2015-04-11 12:36:00.511251770 +0200 | |
1c16a62d | 88 | @@ -565,7 +565,7 @@ |
bedc6c43 JR |
89 | gettimeofday(&tv, NULL); |
90 | if (localtime_r(&tv.tv_sec, <ime)) { | |
91 | strftime(date, sizeof(date), "%H:%M:%S", <ime); | |
1c16a62d JB |
92 | - pr_info("%s.%06ld", date, tv.tv_usec); |
93 | + pr_info("%s.%06lld", date, (long long) tv.tv_usec); | |
bedc6c43 JR |
94 | } else |
95 | pr_info("00:00:00.000000"); | |
96 | ||
1c16a62d JB |
97 | --- linux-5.11/tools/perf/arch/x86/util/unwind-libunwind.c.orig 2021-02-25 20:23:15.561804956 +0100 |
98 | +++ linux-5.11/tools/perf/arch/x86/util/unwind-libunwind.c 2021-02-25 20:39:56.170430285 +0100 | |
388d18e6 | 99 | @@ -8,7 +8,7 @@ |
1c16a62d | 100 | #include "../../util/unwind.h" |
388d18e6 JR |
101 | #endif |
102 | ||
103 | -#ifdef HAVE_ARCH_X86_64_SUPPORT | |
104 | +#if defined(HAVE_ARCH_X86_64_SUPPORT) || defined(HAVE_ARCH_X32_SUPPORT) | |
105 | int LIBUNWIND__ARCH_REG_ID(int regnum) | |
106 | { | |
107 | int id; |