Skip to content

Commit 5e63306

Browse files
Jiri Slabysuryasaimadhu
authored andcommitted
x86/asm/32: Change all ENTRY+END to SYM_CODE_*
Change all assembly code which is marked using END (and not ENDPROC) to appropriate new markings SYM_CODE_START and SYM_CODE_END. And since the last user of END on X86 is gone now, make sure that END is not defined there. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Boris Ostrovsky <[email protected]> Cc: Herbert Xu <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: [email protected] Cc: Mark Rutland <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Cc: "Steven Rostedt (VMware)" <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: x86-ml <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 78762b0 commit 5e63306

File tree

3 files changed

+58
-56
lines changed

3 files changed

+58
-56
lines changed

arch/x86/entry/entry_32.S

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@
709709
* %eax: prev task
710710
* %edx: next task
711711
*/
712-
ENTRY(__switch_to_asm)
712+
SYM_CODE_START(__switch_to_asm)
713713
/*
714714
* Save callee-saved registers
715715
* This must match the order in struct inactive_task_frame
@@ -748,7 +748,7 @@ ENTRY(__switch_to_asm)
748748
popl %ebp
749749

750750
jmp __switch_to
751-
END(__switch_to_asm)
751+
SYM_CODE_END(__switch_to_asm)
752752

753753
/*
754754
* The unwinder expects the last frame on the stack to always be at the same
@@ -774,7 +774,7 @@ ENDPROC(schedule_tail_wrapper)
774774
* ebx: kernel thread func (NULL for user thread)
775775
* edi: kernel thread arg
776776
*/
777-
ENTRY(ret_from_fork)
777+
SYM_CODE_START(ret_from_fork)
778778
call schedule_tail_wrapper
779779

780780
testl %ebx, %ebx
@@ -797,7 +797,7 @@ ENTRY(ret_from_fork)
797797
*/
798798
movl $0, PT_EAX(%esp)
799799
jmp 2b
800-
END(ret_from_fork)
800+
SYM_CODE_END(ret_from_fork)
801801

802802
/*
803803
* Return to user mode is not as complex as all this looks,
@@ -1161,27 +1161,27 @@ ENDPROC(entry_INT80_32)
11611161
* We pack 1 stub into every 8-byte block.
11621162
*/
11631163
.align 8
1164-
ENTRY(irq_entries_start)
1164+
SYM_CODE_START(irq_entries_start)
11651165
vector=FIRST_EXTERNAL_VECTOR
11661166
.rept (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR)
11671167
pushl $(~vector+0x80) /* Note: always in signed byte range */
11681168
vector=vector+1
11691169
jmp common_interrupt
11701170
.align 8
11711171
.endr
1172-
END(irq_entries_start)
1172+
SYM_CODE_END(irq_entries_start)
11731173

11741174
#ifdef CONFIG_X86_LOCAL_APIC
11751175
.align 8
1176-
ENTRY(spurious_entries_start)
1176+
SYM_CODE_START(spurious_entries_start)
11771177
vector=FIRST_SYSTEM_VECTOR
11781178
.rept (NR_VECTORS - FIRST_SYSTEM_VECTOR)
11791179
pushl $(~vector+0x80) /* Note: always in signed byte range */
11801180
vector=vector+1
11811181
jmp common_spurious
11821182
.align 8
11831183
.endr
1184-
END(spurious_entries_start)
1184+
SYM_CODE_END(spurious_entries_start)
11851185

11861186
SYM_CODE_START_LOCAL(common_spurious)
11871187
ASM_CLAC
@@ -1230,14 +1230,14 @@ ENDPROC(name)
12301230
/* The include is where all of the SMP etc. interrupts come from */
12311231
#include <asm/entry_arch.h>
12321232

1233-
ENTRY(coprocessor_error)
1233+
SYM_CODE_START(coprocessor_error)
12341234
ASM_CLAC
12351235
pushl $0
12361236
pushl $do_coprocessor_error
12371237
jmp common_exception
1238-
END(coprocessor_error)
1238+
SYM_CODE_END(coprocessor_error)
12391239

1240-
ENTRY(simd_coprocessor_error)
1240+
SYM_CODE_START(simd_coprocessor_error)
12411241
ASM_CLAC
12421242
pushl $0
12431243
#ifdef CONFIG_X86_INVD_BUG
@@ -1249,96 +1249,96 @@ ENTRY(simd_coprocessor_error)
12491249
pushl $do_simd_coprocessor_error
12501250
#endif
12511251
jmp common_exception
1252-
END(simd_coprocessor_error)
1252+
SYM_CODE_END(simd_coprocessor_error)
12531253

1254-
ENTRY(device_not_available)
1254+
SYM_CODE_START(device_not_available)
12551255
ASM_CLAC
12561256
pushl $-1 # mark this as an int
12571257
pushl $do_device_not_available
12581258
jmp common_exception
1259-
END(device_not_available)
1259+
SYM_CODE_END(device_not_available)
12601260

12611261
#ifdef CONFIG_PARAVIRT
1262-
ENTRY(native_iret)
1262+
SYM_CODE_START(native_iret)
12631263
iret
12641264
_ASM_EXTABLE(native_iret, iret_exc)
1265-
END(native_iret)
1265+
SYM_CODE_END(native_iret)
12661266
#endif
12671267

1268-
ENTRY(overflow)
1268+
SYM_CODE_START(overflow)
12691269
ASM_CLAC
12701270
pushl $0
12711271
pushl $do_overflow
12721272
jmp common_exception
1273-
END(overflow)
1273+
SYM_CODE_END(overflow)
12741274

1275-
ENTRY(bounds)
1275+
SYM_CODE_START(bounds)
12761276
ASM_CLAC
12771277
pushl $0
12781278
pushl $do_bounds
12791279
jmp common_exception
1280-
END(bounds)
1280+
SYM_CODE_END(bounds)
12811281

1282-
ENTRY(invalid_op)
1282+
SYM_CODE_START(invalid_op)
12831283
ASM_CLAC
12841284
pushl $0
12851285
pushl $do_invalid_op
12861286
jmp common_exception
1287-
END(invalid_op)
1287+
SYM_CODE_END(invalid_op)
12881288

1289-
ENTRY(coprocessor_segment_overrun)
1289+
SYM_CODE_START(coprocessor_segment_overrun)
12901290
ASM_CLAC
12911291
pushl $0
12921292
pushl $do_coprocessor_segment_overrun
12931293
jmp common_exception
1294-
END(coprocessor_segment_overrun)
1294+
SYM_CODE_END(coprocessor_segment_overrun)
12951295

1296-
ENTRY(invalid_TSS)
1296+
SYM_CODE_START(invalid_TSS)
12971297
ASM_CLAC
12981298
pushl $do_invalid_TSS
12991299
jmp common_exception
1300-
END(invalid_TSS)
1300+
SYM_CODE_END(invalid_TSS)
13011301

1302-
ENTRY(segment_not_present)
1302+
SYM_CODE_START(segment_not_present)
13031303
ASM_CLAC
13041304
pushl $do_segment_not_present
13051305
jmp common_exception
1306-
END(segment_not_present)
1306+
SYM_CODE_END(segment_not_present)
13071307

1308-
ENTRY(stack_segment)
1308+
SYM_CODE_START(stack_segment)
13091309
ASM_CLAC
13101310
pushl $do_stack_segment
13111311
jmp common_exception
1312-
END(stack_segment)
1312+
SYM_CODE_END(stack_segment)
13131313

1314-
ENTRY(alignment_check)
1314+
SYM_CODE_START(alignment_check)
13151315
ASM_CLAC
13161316
pushl $do_alignment_check
13171317
jmp common_exception
1318-
END(alignment_check)
1318+
SYM_CODE_END(alignment_check)
13191319

1320-
ENTRY(divide_error)
1320+
SYM_CODE_START(divide_error)
13211321
ASM_CLAC
13221322
pushl $0 # no error code
13231323
pushl $do_divide_error
13241324
jmp common_exception
1325-
END(divide_error)
1325+
SYM_CODE_END(divide_error)
13261326

13271327
#ifdef CONFIG_X86_MCE
1328-
ENTRY(machine_check)
1328+
SYM_CODE_START(machine_check)
13291329
ASM_CLAC
13301330
pushl $0
13311331
pushl machine_check_vector
13321332
jmp common_exception
1333-
END(machine_check)
1333+
SYM_CODE_END(machine_check)
13341334
#endif
13351335

1336-
ENTRY(spurious_interrupt_bug)
1336+
SYM_CODE_START(spurious_interrupt_bug)
13371337
ASM_CLAC
13381338
pushl $0
13391339
pushl $do_spurious_interrupt_bug
13401340
jmp common_exception
1341-
END(spurious_interrupt_bug)
1341+
SYM_CODE_END(spurious_interrupt_bug)
13421342

13431343
#ifdef CONFIG_XEN_PV
13441344
ENTRY(xen_hypervisor_callback)
@@ -1442,11 +1442,11 @@ BUILD_INTERRUPT3(hv_stimer0_callback_vector, HYPERV_STIMER0_VECTOR,
14421442

14431443
#endif /* CONFIG_HYPERV */
14441444

1445-
ENTRY(page_fault)
1445+
SYM_CODE_START(page_fault)
14461446
ASM_CLAC
14471447
pushl $do_page_fault
14481448
jmp common_exception_read_cr2
1449-
END(page_fault)
1449+
SYM_CODE_END(page_fault)
14501450

14511451
SYM_CODE_START_LOCAL_NOALIGN(common_exception_read_cr2)
14521452
/* the function address is in %gs's slot on the stack */
@@ -1495,15 +1495,15 @@ SYM_CODE_START_LOCAL_NOALIGN(common_exception)
14951495
jmp ret_from_exception
14961496
SYM_CODE_END(common_exception)
14971497

1498-
ENTRY(debug)
1498+
SYM_CODE_START(debug)
14991499
/*
15001500
* Entry from sysenter is now handled in common_exception
15011501
*/
15021502
ASM_CLAC
15031503
pushl $-1 # mark this as an int
15041504
pushl $do_debug
15051505
jmp common_exception
1506-
END(debug)
1506+
SYM_CODE_END(debug)
15071507

15081508
/*
15091509
* NMI is doubly nasty. It can happen on the first instruction of
@@ -1512,7 +1512,7 @@ END(debug)
15121512
* switched stacks. We handle both conditions by simply checking whether we
15131513
* interrupted kernel code running on the SYSENTER stack.
15141514
*/
1515-
ENTRY(nmi)
1515+
SYM_CODE_START(nmi)
15161516
ASM_CLAC
15171517

15181518
#ifdef CONFIG_X86_ESPFIX32
@@ -1577,9 +1577,9 @@ ENTRY(nmi)
15771577
lss 12+4(%esp), %esp # back to espfix stack
15781578
jmp .Lirq_return
15791579
#endif
1580-
END(nmi)
1580+
SYM_CODE_END(nmi)
15811581

1582-
ENTRY(int3)
1582+
SYM_CODE_START(int3)
15831583
ASM_CLAC
15841584
pushl $-1 # mark this as an int
15851585

@@ -1590,22 +1590,22 @@ ENTRY(int3)
15901590
movl %esp, %eax # pt_regs pointer
15911591
call do_int3
15921592
jmp ret_from_exception
1593-
END(int3)
1593+
SYM_CODE_END(int3)
15941594

1595-
ENTRY(general_protection)
1595+
SYM_CODE_START(general_protection)
15961596
pushl $do_general_protection
15971597
jmp common_exception
1598-
END(general_protection)
1598+
SYM_CODE_END(general_protection)
15991599

16001600
#ifdef CONFIG_KVM_GUEST
1601-
ENTRY(async_page_fault)
1601+
SYM_CODE_START(async_page_fault)
16021602
ASM_CLAC
16031603
pushl $do_async_page_fault
16041604
jmp common_exception_read_cr2
1605-
END(async_page_fault)
1605+
SYM_CODE_END(async_page_fault)
16061606
#endif
16071607

1608-
ENTRY(rewind_stack_do_exit)
1608+
SYM_CODE_START(rewind_stack_do_exit)
16091609
/* Prevent any naive code from trying to unwind to our caller. */
16101610
xorl %ebp, %ebp
16111611

@@ -1614,4 +1614,4 @@ ENTRY(rewind_stack_do_exit)
16141614

16151615
call do_exit
16161616
1: jmp 1b
1617-
END(rewind_stack_do_exit)
1617+
SYM_CODE_END(rewind_stack_do_exit)

arch/x86/kernel/ftrace_32.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ SYM_FUNC_START(function_hook)
2525
ret
2626
SYM_FUNC_END(function_hook)
2727

28-
ENTRY(ftrace_caller)
28+
SYM_CODE_START(ftrace_caller)
2929

3030
#ifdef CONFIG_FRAME_POINTER
3131
/*
@@ -87,7 +87,7 @@ ftrace_graph_call:
8787
/* This is weak to keep gas from relaxing the jumps */
8888
WEAK(ftrace_stub)
8989
ret
90-
END(ftrace_caller)
90+
SYM_CODE_END(ftrace_caller)
9191

9292
SYM_CODE_START(ftrace_regs_caller)
9393
/*
@@ -166,7 +166,7 @@ SYM_INNER_LABEL(ftrace_regs_call, SYM_L_GLOBAL)
166166
SYM_CODE_END(ftrace_regs_caller)
167167

168168
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
169-
ENTRY(ftrace_graph_caller)
169+
SYM_CODE_START(ftrace_graph_caller)
170170
pushl %eax
171171
pushl %ecx
172172
pushl %edx
@@ -180,7 +180,7 @@ ENTRY(ftrace_graph_caller)
180180
popl %ecx
181181
popl %eax
182182
ret
183-
END(ftrace_graph_caller)
183+
SYM_CODE_END(ftrace_graph_caller)
184184

185185
.globl return_to_handler
186186
return_to_handler:

include/linux/linkage.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,13 @@
129129
SYM_FUNC_START_WEAK(name)
130130
#endif
131131

132+
#ifndef CONFIG_X86
132133
#ifndef END
133134
/* deprecated, use SYM_FUNC_END, SYM_DATA_END, or SYM_END */
134135
#define END(name) \
135136
.size name, .-name
136137
#endif
138+
#endif /* CONFIG_X86 */
137139

138140
#ifndef CONFIG_X86_64
139141
/* If symbol 'name' is treated as a subroutine (gets called, and returns)

0 commit comments

Comments
 (0)