Skip to content

Commit bc7b11c

Browse files
Jiri Slabysuryasaimadhu
authored andcommitted
x86/asm/64: Change all ENTRY+END to SYM_CODE_*
Change all assembly code which is marked using END (and not ENDPROC). Switch all these to the appropriate new annotation SYM_CODE_START and SYM_CODE_END. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> [xen bits] Cc: Andy Lutomirski <[email protected]> Cc: Cao jin <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Juergen Gross <[email protected]> Cc: [email protected] Cc: Maran Wilson <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stefano Stabellini <[email protected]> Cc: "Steven Rostedt (VMware)" <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: x86-ml <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 4aec216 commit bc7b11c

File tree

6 files changed

+46
-46
lines changed

6 files changed

+46
-46
lines changed

arch/x86/entry/entry_64.S

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@
4646
.section .entry.text, "ax"
4747

4848
#ifdef CONFIG_PARAVIRT
49-
ENTRY(native_usergs_sysret64)
49+
SYM_CODE_START(native_usergs_sysret64)
5050
UNWIND_HINT_EMPTY
5151
swapgs
5252
sysretq
53-
END(native_usergs_sysret64)
53+
SYM_CODE_END(native_usergs_sysret64)
5454
#endif /* CONFIG_PARAVIRT */
5555

5656
.macro TRACE_IRQS_FLAGS flags:req
@@ -142,7 +142,7 @@ END(native_usergs_sysret64)
142142
* with them due to bugs in both AMD and Intel CPUs.
143143
*/
144144

145-
ENTRY(entry_SYSCALL_64)
145+
SYM_CODE_START(entry_SYSCALL_64)
146146
UNWIND_HINT_EMPTY
147147
/*
148148
* Interrupts are off on entry.
@@ -273,13 +273,13 @@ syscall_return_via_sysret:
273273
popq %rdi
274274
popq %rsp
275275
USERGS_SYSRET64
276-
END(entry_SYSCALL_64)
276+
SYM_CODE_END(entry_SYSCALL_64)
277277

278278
/*
279279
* %rdi: prev task
280280
* %rsi: next task
281281
*/
282-
ENTRY(__switch_to_asm)
282+
SYM_CODE_START(__switch_to_asm)
283283
UNWIND_HINT_FUNC
284284
/*
285285
* Save callee-saved registers
@@ -321,7 +321,7 @@ ENTRY(__switch_to_asm)
321321
popq %rbp
322322

323323
jmp __switch_to
324-
END(__switch_to_asm)
324+
SYM_CODE_END(__switch_to_asm)
325325

326326
/*
327327
* A newly forked process directly context switches into this address.
@@ -330,7 +330,7 @@ END(__switch_to_asm)
330330
* rbx: kernel thread func (NULL for user thread)
331331
* r12: kernel thread arg
332332
*/
333-
ENTRY(ret_from_fork)
333+
SYM_CODE_START(ret_from_fork)
334334
UNWIND_HINT_EMPTY
335335
movq %rax, %rdi
336336
call schedule_tail /* rdi: 'prev' task parameter */
@@ -357,14 +357,14 @@ ENTRY(ret_from_fork)
357357
*/
358358
movq $0, RAX(%rsp)
359359
jmp 2b
360-
END(ret_from_fork)
360+
SYM_CODE_END(ret_from_fork)
361361

362362
/*
363363
* Build the entry stubs with some assembler magic.
364364
* We pack 1 stub into every 8-byte block.
365365
*/
366366
.align 8
367-
ENTRY(irq_entries_start)
367+
SYM_CODE_START(irq_entries_start)
368368
vector=FIRST_EXTERNAL_VECTOR
369369
.rept (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR)
370370
UNWIND_HINT_IRET_REGS
@@ -373,10 +373,10 @@ ENTRY(irq_entries_start)
373373
.align 8
374374
vector=vector+1
375375
.endr
376-
END(irq_entries_start)
376+
SYM_CODE_END(irq_entries_start)
377377

378378
.align 8
379-
ENTRY(spurious_entries_start)
379+
SYM_CODE_START(spurious_entries_start)
380380
vector=FIRST_SYSTEM_VECTOR
381381
.rept (NR_VECTORS - FIRST_SYSTEM_VECTOR)
382382
UNWIND_HINT_IRET_REGS
@@ -385,7 +385,7 @@ ENTRY(spurious_entries_start)
385385
.align 8
386386
vector=vector+1
387387
.endr
388-
END(spurious_entries_start)
388+
SYM_CODE_END(spurious_entries_start)
389389

390390
.macro DEBUG_ENTRY_ASSERT_IRQS_OFF
391391
#ifdef CONFIG_DEBUG_ENTRY
@@ -511,7 +511,7 @@ END(spurious_entries_start)
511511
* | return address |
512512
* +----------------------------------------------------+
513513
*/
514-
ENTRY(interrupt_entry)
514+
SYM_CODE_START(interrupt_entry)
515515
UNWIND_HINT_FUNC
516516
ASM_CLAC
517517
cld
@@ -579,7 +579,7 @@ ENTRY(interrupt_entry)
579579
TRACE_IRQS_OFF
580580

581581
ret
582-
END(interrupt_entry)
582+
SYM_CODE_END(interrupt_entry)
583583
_ASM_NOKPROBE(interrupt_entry)
584584

585585

@@ -795,15 +795,15 @@ _ASM_NOKPROBE(common_interrupt)
795795
* APIC interrupts.
796796
*/
797797
.macro apicinterrupt3 num sym do_sym
798-
ENTRY(\sym)
798+
SYM_CODE_START(\sym)
799799
UNWIND_HINT_IRET_REGS
800800
pushq $~(\num)
801801
.Lcommon_\sym:
802802
call interrupt_entry
803803
UNWIND_HINT_REGS indirect=1
804804
call \do_sym /* rdi points to pt_regs */
805805
jmp ret_from_intr
806-
END(\sym)
806+
SYM_CODE_END(\sym)
807807
_ASM_NOKPROBE(\sym)
808808
.endm
809809

@@ -968,7 +968,7 @@ apicinterrupt IRQ_WORK_VECTOR irq_work_interrupt smp_irq_work_interrupt
968968
* #DF: if the thread stack is somehow unusable, we'll still get a useful OOPS.
969969
*/
970970
.macro idtentry sym do_sym has_error_code:req paranoid=0 shift_ist=-1 ist_offset=0 create_gap=0 read_cr2=0
971-
ENTRY(\sym)
971+
SYM_CODE_START(\sym)
972972
UNWIND_HINT_IRET_REGS offset=\has_error_code*8
973973

974974
/* Sanity check */
@@ -1018,7 +1018,7 @@ ENTRY(\sym)
10181018
.endif
10191019

10201020
_ASM_NOKPROBE(\sym)
1021-
END(\sym)
1021+
SYM_CODE_END(\sym)
10221022
.endm
10231023

10241024
idtentry divide_error do_divide_error has_error_code=0
@@ -1135,7 +1135,7 @@ SYM_CODE_END(xen_do_hypervisor_callback)
11351135
* We distinguish between categories by comparing each saved segment register
11361136
* with its current contents: any discrepancy means we in category 1.
11371137
*/
1138-
ENTRY(xen_failsafe_callback)
1138+
SYM_CODE_START(xen_failsafe_callback)
11391139
UNWIND_HINT_EMPTY
11401140
movl %ds, %ecx
11411141
cmpw %cx, 0x10(%rsp)
@@ -1165,7 +1165,7 @@ ENTRY(xen_failsafe_callback)
11651165
PUSH_AND_CLEAR_REGS
11661166
ENCODE_FRAME_POINTER
11671167
jmp error_exit
1168-
END(xen_failsafe_callback)
1168+
SYM_CODE_END(xen_failsafe_callback)
11691169
#endif /* CONFIG_XEN_PV */
11701170

11711171
#ifdef CONFIG_XEN_PVHVM
@@ -1384,7 +1384,7 @@ SYM_CODE_END(error_exit)
13841384
* %r14: Used to save/restore the CR3 of the interrupted context
13851385
* when PAGE_TABLE_ISOLATION is in use. Do not clobber.
13861386
*/
1387-
ENTRY(nmi)
1387+
SYM_CODE_START(nmi)
13881388
UNWIND_HINT_IRET_REGS
13891389

13901390
/*
@@ -1719,21 +1719,21 @@ nmi_restore:
17191719
* about espfix64 on the way back to kernel mode.
17201720
*/
17211721
iretq
1722-
END(nmi)
1722+
SYM_CODE_END(nmi)
17231723

17241724
#ifndef CONFIG_IA32_EMULATION
17251725
/*
17261726
* This handles SYSCALL from 32-bit code. There is no way to program
17271727
* MSRs to fully disable 32-bit SYSCALL.
17281728
*/
1729-
ENTRY(ignore_sysret)
1729+
SYM_CODE_START(ignore_sysret)
17301730
UNWIND_HINT_EMPTY
17311731
mov $-ENOSYS, %eax
17321732
sysret
1733-
END(ignore_sysret)
1733+
SYM_CODE_END(ignore_sysret)
17341734
#endif
17351735

1736-
ENTRY(rewind_stack_do_exit)
1736+
SYM_CODE_START(rewind_stack_do_exit)
17371737
UNWIND_HINT_FUNC
17381738
/* Prevent any naive code from trying to unwind to our caller. */
17391739
xorl %ebp, %ebp
@@ -1743,4 +1743,4 @@ ENTRY(rewind_stack_do_exit)
17431743
UNWIND_HINT_FUNC sp_offset=PTREGS_SIZE
17441744

17451745
call do_exit
1746-
END(rewind_stack_do_exit)
1746+
SYM_CODE_END(rewind_stack_do_exit)

arch/x86/entry/entry_64_compat.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ ENDPROC(entry_SYSENTER_compat)
196196
* esp user stack
197197
* 0(%esp) arg6
198198
*/
199-
ENTRY(entry_SYSCALL_compat)
199+
SYM_CODE_START(entry_SYSCALL_compat)
200200
/* Interrupts are off on entry. */
201201
swapgs
202202

@@ -311,7 +311,7 @@ sysret32_from_system_call:
311311
xorl %r10d, %r10d
312312
swapgs
313313
sysretl
314-
END(entry_SYSCALL_compat)
314+
SYM_CODE_END(entry_SYSCALL_compat)
315315

316316
/*
317317
* 32-bit legacy system call entry.
@@ -339,7 +339,7 @@ END(entry_SYSCALL_compat)
339339
* edi arg5
340340
* ebp arg6
341341
*/
342-
ENTRY(entry_INT80_compat)
342+
SYM_CODE_START(entry_INT80_compat)
343343
/*
344344
* Interrupts are off on entry.
345345
*/
@@ -416,4 +416,4 @@ ENTRY(entry_INT80_compat)
416416
/* Go back to user mode. */
417417
TRACE_IRQS_ON
418418
jmp swapgs_restore_regs_and_return_to_usermode
419-
END(entry_INT80_compat)
419+
SYM_CODE_END(entry_INT80_compat)

arch/x86/kernel/ftrace_64.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ ENTRY(ftrace_graph_caller)
296296
retq
297297
ENDPROC(ftrace_graph_caller)
298298

299-
ENTRY(return_to_handler)
299+
SYM_CODE_START(return_to_handler)
300300
UNWIND_HINT_EMPTY
301301
subq $24, %rsp
302302

@@ -312,5 +312,5 @@ ENTRY(return_to_handler)
312312
movq (%rsp), %rax
313313
addq $24, %rsp
314314
JMP_NOSPEC %rdi
315-
END(return_to_handler)
315+
SYM_CODE_END(return_to_handler)
316316
#endif

arch/x86/kernel/head_64.S

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ SYM_CODE_START_NOALIGN(startup_64)
9191
jmp 1f
9292
SYM_CODE_END(startup_64)
9393

94-
ENTRY(secondary_startup_64)
94+
SYM_CODE_START(secondary_startup_64)
9595
UNWIND_HINT_EMPTY
9696
/*
9797
* At this point the CPU runs in 64bit mode CS.L = 1 CS.D = 0,
@@ -241,7 +241,7 @@ ENTRY(secondary_startup_64)
241241
pushq %rax # target address in negative space
242242
lretq
243243
.Lafter_lret:
244-
END(secondary_startup_64)
244+
SYM_CODE_END(secondary_startup_64)
245245

246246
#include "verify_cpu.S"
247247

@@ -251,11 +251,11 @@ END(secondary_startup_64)
251251
* up already except stack. We just set up stack here. Then call
252252
* start_secondary() via .Ljump_to_C_code.
253253
*/
254-
ENTRY(start_cpu0)
254+
SYM_CODE_START(start_cpu0)
255255
UNWIND_HINT_EMPTY
256256
movq initial_stack(%rip), %rsp
257257
jmp .Ljump_to_C_code
258-
END(start_cpu0)
258+
SYM_CODE_END(start_cpu0)
259259
#endif
260260

261261
/* Both SMP bootup and ACPI suspend change these variables */
@@ -272,7 +272,7 @@ SYM_DATA(initial_stack, .quad init_thread_union + THREAD_SIZE - SIZEOF_PTREGS)
272272
__FINITDATA
273273

274274
__INIT
275-
ENTRY(early_idt_handler_array)
275+
SYM_CODE_START(early_idt_handler_array)
276276
i = 0
277277
.rept NUM_EXCEPTION_VECTORS
278278
.if ((EXCEPTION_ERRCODE_MASK >> i) & 1) == 0
@@ -288,7 +288,7 @@ ENTRY(early_idt_handler_array)
288288
.fill early_idt_handler_array + i*EARLY_IDT_HANDLER_SIZE - ., 1, 0xcc
289289
.endr
290290
UNWIND_HINT_IRET_REGS offset=16
291-
END(early_idt_handler_array)
291+
SYM_CODE_END(early_idt_handler_array)
292292

293293
SYM_CODE_START_LOCAL(early_idt_handler_common)
294294
/*

arch/x86/xen/xen-asm_64.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
#include <linux/linkage.h>
2121

2222
.macro xen_pv_trap name
23-
ENTRY(xen_\name)
23+
SYM_CODE_START(xen_\name)
2424
pop %rcx
2525
pop %r11
2626
jmp \name
27-
END(xen_\name)
27+
SYM_CODE_END(xen_\name)
2828
_ASM_NOKPROBE(xen_\name)
2929
.endm
3030

@@ -57,7 +57,7 @@ xen_pv_trap entry_INT80_compat
5757
xen_pv_trap hypervisor_callback
5858

5959
__INIT
60-
ENTRY(xen_early_idt_handler_array)
60+
SYM_CODE_START(xen_early_idt_handler_array)
6161
i = 0
6262
.rept NUM_EXCEPTION_VECTORS
6363
pop %rcx
@@ -66,7 +66,7 @@ ENTRY(xen_early_idt_handler_array)
6666
i = i + 1
6767
.fill xen_early_idt_handler_array + i*XEN_EARLY_IDT_HANDLER_SIZE - ., 1, 0xcc
6868
.endr
69-
END(xen_early_idt_handler_array)
69+
SYM_CODE_END(xen_early_idt_handler_array)
7070
__FINIT
7171

7272
hypercall_iret = hypercall_page + __HYPERVISOR_iret * 32

arch/x86/xen/xen-head.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#ifdef CONFIG_XEN_PV
2424
__INIT
25-
ENTRY(startup_xen)
25+
SYM_CODE_START(startup_xen)
2626
UNWIND_HINT_EMPTY
2727
cld
2828

@@ -52,13 +52,13 @@ ENTRY(startup_xen)
5252
#endif
5353

5454
jmp xen_start_kernel
55-
END(startup_xen)
55+
SYM_CODE_END(startup_xen)
5656
__FINIT
5757
#endif
5858

5959
.pushsection .text
6060
.balign PAGE_SIZE
61-
ENTRY(hypercall_page)
61+
SYM_CODE_START(hypercall_page)
6262
.rept (PAGE_SIZE / 32)
6363
UNWIND_HINT_EMPTY
6464
.skip 32
@@ -69,7 +69,7 @@ ENTRY(hypercall_page)
6969
.type xen_hypercall_##n, @function; .size xen_hypercall_##n, 32
7070
#include <asm/xen-hypercalls.h>
7171
#undef HYPERCALL
72-
END(hypercall_page)
72+
SYM_CODE_END(hypercall_page)
7373
.popsection
7474

7575
ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux")

0 commit comments

Comments
 (0)