]> git.pld-linux.org Git - packages/kernel-tools.git/blob - x32.patch
- rediffed patches
[packages/kernel-tools.git] / x32.patch
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
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)
9 +X86_64 := $(shell echo __x86_64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
10  ifeq ($(LP64), 1)
11    IS_64_BIT := 1
12  else
13    IS_64_BIT := 0
14  endif
15 +ifeq ($(X86_64)_$(ILP32), 1_1)
16 +  IS_X32_BIT := 1
17 +else
18 +  IS_X32_BIT := 0
19 +endif
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 @@
23      LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
24    endif
25    NO_PERF_REGS := 0
26 +  ifeq (${IS_X32_BIT}, 1)
27 +    CFLAGS += -DHAVE_ARCH_X32_SUPPORT
28 +    ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
29 +    LIBUNWIND_LIBS = -lunwind-x86_64 -llzma -lunwind
30 +  endif
31  endif
32  
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
38  SYM_FUNC_END(perf_regs_load)
39  #else
40 +#ifdef(HAVE_ARCH_X32_SUPPORT)
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)
74 +#else
75  SYM_FUNC_START(perf_regs_load)
76         push %edi
77         movl 8(%esp), %edi
78 @@ -90,6 +125,7 @@
79         ret
80  SYM_FUNC_END(perf_regs_load)
81  #endif
82 +#endif
83  
84  /*
85   * We need to provide note.GNU-stack section, saying that we want
86 --- linux-3.19/tools/perf/bench/sched-messaging.c~      2015-02-09 03:54:22.000000000 +0100
87 +++ linux-3.19/tools/perf/bench/sched-messaging.c       2015-04-11 12:33:22.587917365 +0200
88 @@ -310,13 +310,13 @@
89                 printf("# %d groups == %d %s run\n\n",
90                        num_groups, num_groups * 2 * num_fds,
91                        thread_mode ? "threads" : "processes");
92 -               printf(" %14s: %lu.%03lu [sec]\n", "Total time",
93 -                      diff.tv_sec,
94 -                      (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
95 +               printf(" %14s: %llu.%03llu [sec]\n", "Total time",
96 +                      (unsigned long long) diff.tv_sec,
97 +                      (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
98                 break;
99         case BENCH_FORMAT_SIMPLE:
100 -               printf("%lu.%03lu\n", diff.tv_sec,
101 -                      (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
102 +               printf("%llu.%03llu\n", (unsigned long long) diff.tv_sec,
103 +                      (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
104                 break;
105         default:
106                 /* reaching here is something disaster */
107 --- linux-5.11/tools/perf/bench/sched-pipe.c.orig       2021-02-14 23:32:24.000000000 +0100
108 +++ linux-5.11/tools/perf/bench/sched-pipe.c    2021-02-25 20:38:57.380710973 +0100
109 @@ -155,9 +155,9 @@
110                 result_usec = diff.tv_sec * USEC_PER_SEC;
111                 result_usec += diff.tv_usec;
112  
113 -               printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
114 -                      diff.tv_sec,
115 -                      (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
116 +               printf(" %14s: %llu.%03llu [sec]\n\n", "Total time",
117 +                      (unsigned long long) diff.tv_sec,
118 +                      (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
119  
120                 printf(" %14lf usecs/op\n",
121                        (double)result_usec / (double)loops);
122 @@ -167,9 +167,9 @@
123                 break;
124  
125         case BENCH_FORMAT_SIMPLE:
126 -               printf("%lu.%03lu\n",
127 -                      diff.tv_sec,
128 -                      (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
129 +               printf("%llu.%03llu\n",
130 +                      (unsigned long long) diff.tv_sec,
131 +                      (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
132                 break;
133  
134         default:
135 --- linux-3.19/tools/perf/builtin-kvm.c~        2015-02-09 03:54:22.000000000 +0100
136 +++ linux-3.19/tools/perf/builtin-kvm.c 2015-04-11 12:36:00.511251770 +0200
137 @@ -565,7 +565,7 @@
138         gettimeofday(&tv, NULL);
139         if (localtime_r(&tv.tv_sec, &ltime)) {
140                 strftime(date, sizeof(date), "%H:%M:%S", &ltime);
141 -               pr_info("%s.%06ld", date, tv.tv_usec);
142 +               pr_info("%s.%06lld", date, (long long) tv.tv_usec);
143         } else
144                 pr_info("00:00:00.000000");
145  
146 --- linux-5.11/tools/perf/arch/x86/util/unwind-libunwind.c.orig 2021-02-25 20:23:15.561804956 +0100
147 +++ linux-5.11/tools/perf/arch/x86/util/unwind-libunwind.c      2021-02-25 20:39:56.170430285 +0100
148 @@ -8,7 +8,7 @@
149  #include "../../util/unwind.h"
150  #endif
151  
152 -#ifdef HAVE_ARCH_X86_64_SUPPORT
153 +#if defined(HAVE_ARCH_X86_64_SUPPORT) || defined(HAVE_ARCH_X32_SUPPORT)
154  int LIBUNWIND__ARCH_REG_ID(int regnum)
155  {
156         int id;
This page took 0.035349 seconds and 4 git commands to generate.