hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/arch/x86/include/asm/asm.h
....@@ -7,9 +7,11 @@
77 # define __ASM_FORM_RAW(x) x
88 # define __ASM_FORM_COMMA(x) x,
99 #else
10
-# define __ASM_FORM(x) " " #x " "
11
-# define __ASM_FORM_RAW(x) #x
12
-# define __ASM_FORM_COMMA(x) " " #x ","
10
+#include <linux/stringify.h>
11
+
12
+# define __ASM_FORM(x) " " __stringify(x) " "
13
+# define __ASM_FORM_RAW(x) __stringify(x)
14
+# define __ASM_FORM_COMMA(x) " " __stringify(x) ","
1315 #endif
1416
1517 #ifndef __x86_64__
....@@ -130,46 +132,26 @@
130132 # define _ASM_EXTABLE(from, to) \
131133 _ASM_EXTABLE_HANDLE(from, to, ex_handler_default)
132134
135
+# define _ASM_EXTABLE_UA(from, to) \
136
+ _ASM_EXTABLE_HANDLE(from, to, ex_handler_uaccess)
137
+
138
+# define _ASM_EXTABLE_CPY(from, to) \
139
+ _ASM_EXTABLE_HANDLE(from, to, ex_handler_copy)
140
+
133141 # define _ASM_EXTABLE_FAULT(from, to) \
134142 _ASM_EXTABLE_HANDLE(from, to, ex_handler_fault)
135143
136
-# define _ASM_EXTABLE_EX(from, to) \
137
- _ASM_EXTABLE_HANDLE(from, to, ex_handler_ext)
138
-
139
-# define _ASM_EXTABLE_REFCOUNT(from, to) \
140
- _ASM_EXTABLE_HANDLE(from, to, ex_handler_refcount)
141
-
142
-# define _ASM_NOKPROBE(entry) \
144
+# ifdef CONFIG_KPROBES
145
+# define _ASM_NOKPROBE(entry) \
143146 .pushsection "_kprobe_blacklist","aw" ; \
144147 _ASM_ALIGN ; \
145148 _ASM_PTR (entry); \
146149 .popsection
150
+# else
151
+# define _ASM_NOKPROBE(entry)
152
+# endif
147153
148
-.macro ALIGN_DESTINATION
149
- /* check for bad alignment of destination */
150
- movl %edi,%ecx
151
- andl $7,%ecx
152
- jz 102f /* already aligned */
153
- subl $8,%ecx
154
- negl %ecx
155
- subl %ecx,%edx
156
-100: movb (%rsi),%al
157
-101: movb %al,(%rdi)
158
- incq %rsi
159
- incq %rdi
160
- decl %ecx
161
- jnz 100b
162
-102:
163
- .section .fixup,"ax"
164
-103: addl %ecx,%edx /* ecx is zerorest also */
165
- jmp copy_user_handle_tail
166
- .previous
167
-
168
- _ASM_EXTABLE(100b,103b)
169
- _ASM_EXTABLE(101b,103b)
170
- .endm
171
-
172
-#else
154
+#else /* ! __ASSEMBLY__ */
173155 # define _EXPAND_EXTABLE_HANDLE(x) #x
174156 # define _ASM_EXTABLE_HANDLE(from, to, handler) \
175157 " .pushsection \"__ex_table\",\"a\"\n" \
....@@ -182,19 +164,17 @@
182164 # define _ASM_EXTABLE(from, to) \
183165 _ASM_EXTABLE_HANDLE(from, to, ex_handler_default)
184166
167
+# define _ASM_EXTABLE_UA(from, to) \
168
+ _ASM_EXTABLE_HANDLE(from, to, ex_handler_uaccess)
169
+
170
+# define _ASM_EXTABLE_CPY(from, to) \
171
+ _ASM_EXTABLE_HANDLE(from, to, ex_handler_copy)
172
+
185173 # define _ASM_EXTABLE_FAULT(from, to) \
186174 _ASM_EXTABLE_HANDLE(from, to, ex_handler_fault)
187175
188
-# define _ASM_EXTABLE_EX(from, to) \
189
- _ASM_EXTABLE_HANDLE(from, to, ex_handler_ext)
190
-
191
-# define _ASM_EXTABLE_REFCOUNT(from, to) \
192
- _ASM_EXTABLE_HANDLE(from, to, ex_handler_refcount)
193
-
194176 /* For C file, we already have NOKPROBE_SYMBOL macro */
195
-#endif
196177
197
-#ifndef __ASSEMBLY__
198178 /*
199179 * This output constraint should be used for any inline asm which has a "call"
200180 * instruction. Otherwise the asm may be inserted before the frame pointer
....@@ -203,6 +183,6 @@
203183 */
204184 register unsigned long current_stack_pointer asm(_ASM_SP);
205185 #define ASM_CALL_CONSTRAINT "+r" (current_stack_pointer)
206
-#endif
186
+#endif /* __ASSEMBLY__ */
207187
208188 #endif /* _ASM_X86_ASM_H */