Skip to content

Commit 6d685e5

Browse files
Jiri Slabysuryasaimadhu
authored andcommitted
x86/asm/32: Change all ENTRY+ENDPROC to SYM_FUNC_*
These are all functions which are invoked from elsewhere, so annotate them as global using the new SYM_FUNC_START and their ENDPROC's by SYM_FUNC_END. Now, ENTRY/ENDPROC can be forced to be undefined on X86, so do so. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Cc: Allison Randal <[email protected]> Cc: Andrey Ryabinin <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Bill Metzenthen <[email protected]> Cc: Boris Ostrovsky <[email protected]> Cc: Darren Hart <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Herbert Xu <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: [email protected] Cc: [email protected] Cc: linux-efi <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Mark Rutland <[email protected]> Cc: Matt Fleming <[email protected]> Cc: Pavel Machek <[email protected]> Cc: [email protected] Cc: "Rafael J. Wysocki" <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Will Deacon <[email protected]> Cc: x86-ml <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 5e63306 commit 6d685e5

26 files changed

+104
-108
lines changed

arch/x86/boot/compressed/efi_stub_32.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525

2626
.text
27-
ENTRY(efi_call_phys)
27+
SYM_FUNC_START(efi_call_phys)
2828
/*
2929
* 0. The function can only be called in Linux kernel. So CS has been
3030
* set to 0x0010, DS and SS have been set to 0x0018. In EFI, I found
@@ -77,7 +77,7 @@ ENTRY(efi_call_phys)
7777
movl saved_return_addr(%edx), %ecx
7878
pushl %ecx
7979
ret
80-
ENDPROC(efi_call_phys)
80+
SYM_FUNC_END(efi_call_phys)
8181
.previous
8282

8383
.data

arch/x86/boot/compressed/head_32.S

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
.hidden _egot
6262

6363
__HEAD
64-
ENTRY(startup_32)
64+
SYM_FUNC_START(startup_32)
6565
cld
6666
/*
6767
* Test KEEP_SEGMENTS flag to see if the bootloader is asking
@@ -142,14 +142,14 @@ ENTRY(startup_32)
142142
*/
143143
leal .Lrelocated(%ebx), %eax
144144
jmp *%eax
145-
ENDPROC(startup_32)
145+
SYM_FUNC_END(startup_32)
146146

147147
#ifdef CONFIG_EFI_STUB
148148
/*
149149
* We don't need the return address, so set up the stack so efi_main() can find
150150
* its arguments.
151151
*/
152-
ENTRY(efi_pe_entry)
152+
SYM_FUNC_START(efi_pe_entry)
153153
add $0x4, %esp
154154

155155
call 1f
@@ -174,9 +174,9 @@ ENTRY(efi_pe_entry)
174174
pushl %eax
175175
pushl %ecx
176176
jmp 2f /* Skip efi_config initialization */
177-
ENDPROC(efi_pe_entry)
177+
SYM_FUNC_END(efi_pe_entry)
178178

179-
ENTRY(efi32_stub_entry)
179+
SYM_FUNC_START(efi32_stub_entry)
180180
add $0x4, %esp
181181
popl %ecx
182182
popl %edx
@@ -205,7 +205,7 @@ fail:
205205
movl BP_code32_start(%esi), %eax
206206
leal startup_32(%eax), %eax
207207
jmp *%eax
208-
ENDPROC(efi32_stub_entry)
208+
SYM_FUNC_END(efi32_stub_entry)
209209
#endif
210210

211211
.text

arch/x86/crypto/serpent-sse2-i586-asm_32.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@
497497
pxor t0, x3; \
498498
movdqu x3, (3*4*4)(out);
499499

500-
ENTRY(__serpent_enc_blk_4way)
500+
SYM_FUNC_START(__serpent_enc_blk_4way)
501501
/* input:
502502
* arg_ctx(%esp): ctx, CTX
503503
* arg_dst(%esp): dst
@@ -559,9 +559,9 @@ ENTRY(__serpent_enc_blk_4way)
559559
xor_blocks(%eax, RA, RB, RC, RD, RT0, RT1, RE);
560560

561561
ret;
562-
ENDPROC(__serpent_enc_blk_4way)
562+
SYM_FUNC_END(__serpent_enc_blk_4way)
563563

564-
ENTRY(serpent_dec_blk_4way)
564+
SYM_FUNC_START(serpent_dec_blk_4way)
565565
/* input:
566566
* arg_ctx(%esp): ctx, CTX
567567
* arg_dst(%esp): dst
@@ -613,4 +613,4 @@ ENTRY(serpent_dec_blk_4way)
613613
write_blocks(%eax, RC, RD, RB, RE, RT0, RT1, RA);
614614

615615
ret;
616-
ENDPROC(serpent_dec_blk_4way)
616+
SYM_FUNC_END(serpent_dec_blk_4way)

arch/x86/crypto/twofish-i586-asm_32.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
xor %esi, d ## D;\
208208
ror $1, d ## D;
209209

210-
ENTRY(twofish_enc_blk)
210+
SYM_FUNC_START(twofish_enc_blk)
211211
push %ebp /* save registers according to calling convention*/
212212
push %ebx
213213
push %esi
@@ -261,9 +261,9 @@ ENTRY(twofish_enc_blk)
261261
pop %ebp
262262
mov $1, %eax
263263
ret
264-
ENDPROC(twofish_enc_blk)
264+
SYM_FUNC_END(twofish_enc_blk)
265265

266-
ENTRY(twofish_dec_blk)
266+
SYM_FUNC_START(twofish_dec_blk)
267267
push %ebp /* save registers according to calling convention*/
268268
push %ebx
269269
push %esi
@@ -318,4 +318,4 @@ ENTRY(twofish_dec_blk)
318318
pop %ebp
319319
mov $1, %eax
320320
ret
321-
ENDPROC(twofish_dec_blk)
321+
SYM_FUNC_END(twofish_dec_blk)

arch/x86/entry/entry_32.S

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ SYM_CODE_END(__switch_to_asm)
757757
* asmlinkage function so its argument has to be pushed on the stack. This
758758
* wrapper creates a proper "end of stack" frame header before the call.
759759
*/
760-
ENTRY(schedule_tail_wrapper)
760+
SYM_FUNC_START(schedule_tail_wrapper)
761761
FRAME_BEGIN
762762

763763
pushl %eax
@@ -766,7 +766,7 @@ ENTRY(schedule_tail_wrapper)
766766

767767
FRAME_END
768768
ret
769-
ENDPROC(schedule_tail_wrapper)
769+
SYM_FUNC_END(schedule_tail_wrapper)
770770
/*
771771
* A newly forked process directly context switches into this address.
772772
*
@@ -885,7 +885,7 @@ SYM_CODE_END(xen_sysenter_target)
885885
* ebp user stack
886886
* 0(%ebp) arg6
887887
*/
888-
ENTRY(entry_SYSENTER_32)
888+
SYM_FUNC_START(entry_SYSENTER_32)
889889
/*
890890
* On entry-stack with all userspace-regs live - save and
891891
* restore eflags and %eax to use it as scratch-reg for the cr3
@@ -1013,7 +1013,7 @@ ENTRY(entry_SYSENTER_32)
10131013
popfl
10141014
jmp .Lsysenter_flags_fixed
10151015
SYM_ENTRY(__end_SYSENTER_singlestep_region, SYM_L_GLOBAL, SYM_A_NONE)
1016-
ENDPROC(entry_SYSENTER_32)
1016+
SYM_FUNC_END(entry_SYSENTER_32)
10171017

10181018
/*
10191019
* 32-bit legacy system call entry.
@@ -1043,7 +1043,7 @@ ENDPROC(entry_SYSENTER_32)
10431043
* edi arg5
10441044
* ebp arg6
10451045
*/
1046-
ENTRY(entry_INT80_32)
1046+
SYM_FUNC_START(entry_INT80_32)
10471047
ASM_CLAC
10481048
pushl %eax /* pt_regs->orig_ax */
10491049

@@ -1120,7 +1120,7 @@ SYM_CODE_START(iret_exc)
11201120
SYM_CODE_END(iret_exc)
11211121
.previous
11221122
_ASM_EXTABLE(.Lirq_return, iret_exc)
1123-
ENDPROC(entry_INT80_32)
1123+
SYM_FUNC_END(entry_INT80_32)
11241124

11251125
.macro FIXUP_ESPFIX_STACK
11261126
/*
@@ -1213,7 +1213,7 @@ SYM_CODE_START_LOCAL(common_interrupt)
12131213
SYM_CODE_END(common_interrupt)
12141214

12151215
#define BUILD_INTERRUPT3(name, nr, fn) \
1216-
ENTRY(name) \
1216+
SYM_FUNC_START(name) \
12171217
ASM_CLAC; \
12181218
pushl $~(nr); \
12191219
SAVE_ALL switch_stacks=1; \
@@ -1222,7 +1222,7 @@ ENTRY(name) \
12221222
movl %esp, %eax; \
12231223
call fn; \
12241224
jmp ret_from_intr; \
1225-
ENDPROC(name)
1225+
SYM_FUNC_END(name)
12261226

12271227
#define BUILD_INTERRUPT(name, nr) \
12281228
BUILD_INTERRUPT3(name, nr, smp_##name); \
@@ -1341,7 +1341,7 @@ SYM_CODE_START(spurious_interrupt_bug)
13411341
SYM_CODE_END(spurious_interrupt_bug)
13421342

13431343
#ifdef CONFIG_XEN_PV
1344-
ENTRY(xen_hypervisor_callback)
1344+
SYM_FUNC_START(xen_hypervisor_callback)
13451345
pushl $-1 /* orig_ax = -1 => not a system call */
13461346
SAVE_ALL
13471347
ENCODE_FRAME_POINTER
@@ -1369,7 +1369,7 @@ SYM_INNER_LABEL_ALIGN(xen_do_upcall, SYM_L_GLOBAL)
13691369
call xen_maybe_preempt_hcall
13701370
#endif
13711371
jmp ret_from_intr
1372-
ENDPROC(xen_hypervisor_callback)
1372+
SYM_FUNC_END(xen_hypervisor_callback)
13731373

13741374
/*
13751375
* Hypervisor uses this for application faults while it executes.
@@ -1383,7 +1383,7 @@ ENDPROC(xen_hypervisor_callback)
13831383
* to pop the stack frame we end up in an infinite loop of failsafe callbacks.
13841384
* We distinguish between categories by maintaining a status value in EAX.
13851385
*/
1386-
ENTRY(xen_failsafe_callback)
1386+
SYM_FUNC_START(xen_failsafe_callback)
13871387
pushl %eax
13881388
movl $1, %eax
13891389
1: mov 4(%esp), %ds
@@ -1420,7 +1420,7 @@ ENTRY(xen_failsafe_callback)
14201420
_ASM_EXTABLE(2b, 7b)
14211421
_ASM_EXTABLE(3b, 8b)
14221422
_ASM_EXTABLE(4b, 9b)
1423-
ENDPROC(xen_failsafe_callback)
1423+
SYM_FUNC_END(xen_failsafe_callback)
14241424
#endif /* CONFIG_XEN_PV */
14251425

14261426
#ifdef CONFIG_XEN_PVHVM

arch/x86/kernel/head_32.S

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,12 @@ SYM_CODE_END(startup_32)
180180
* up already except stack. We just set up stack here. Then call
181181
* start_secondary().
182182
*/
183-
ENTRY(start_cpu0)
183+
SYM_FUNC_START(start_cpu0)
184184
movl initial_stack, %ecx
185185
movl %ecx, %esp
186186
call *(initial_code)
187187
1: jmp 1b
188-
ENDPROC(start_cpu0)
188+
SYM_FUNC_END(start_cpu0)
189189
#endif
190190

191191
/*
@@ -196,7 +196,7 @@ ENDPROC(start_cpu0)
196196
* If cpu hotplug is not supported then this code can go in init section
197197
* which will be freed later
198198
*/
199-
ENTRY(startup_32_smp)
199+
SYM_FUNC_START(startup_32_smp)
200200
cld
201201
movl $(__BOOT_DS),%eax
202202
movl %eax,%ds
@@ -363,7 +363,7 @@ ENTRY(startup_32_smp)
363363

364364
call *(initial_code)
365365
1: jmp 1b
366-
ENDPROC(startup_32_smp)
366+
SYM_FUNC_END(startup_32_smp)
367367

368368
#include "verify_cpu.S"
369369

@@ -393,7 +393,7 @@ setup_once:
393393
andl $0,setup_once_ref /* Once is enough, thanks */
394394
ret
395395

396-
ENTRY(early_idt_handler_array)
396+
SYM_FUNC_START(early_idt_handler_array)
397397
# 36(%esp) %eflags
398398
# 32(%esp) %cs
399399
# 28(%esp) %eip
@@ -408,7 +408,7 @@ ENTRY(early_idt_handler_array)
408408
i = i + 1
409409
.fill early_idt_handler_array + i*EARLY_IDT_HANDLER_SIZE - ., 1, 0xcc
410410
.endr
411-
ENDPROC(early_idt_handler_array)
411+
SYM_FUNC_END(early_idt_handler_array)
412412

413413
SYM_CODE_START_LOCAL(early_idt_handler_common)
414414
/*
@@ -464,7 +464,7 @@ SYM_CODE_START_LOCAL(early_idt_handler_common)
464464
SYM_CODE_END(early_idt_handler_common)
465465

466466
/* This is the default interrupt "handler" :-) */
467-
ENTRY(early_ignore_irq)
467+
SYM_FUNC_START(early_ignore_irq)
468468
cld
469469
#ifdef CONFIG_PRINTK
470470
pushl %eax
@@ -499,7 +499,7 @@ ENTRY(early_ignore_irq)
499499
hlt_loop:
500500
hlt
501501
jmp hlt_loop
502-
ENDPROC(early_ignore_irq)
502+
SYM_FUNC_END(early_ignore_irq)
503503

504504
__INITDATA
505505
.align 4

arch/x86/lib/atomic64_386_32.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121
#define BEGIN(op) \
2222
.macro endp; \
23-
ENDPROC(atomic64_##op##_386); \
23+
SYM_FUNC_END(atomic64_##op##_386); \
2424
.purgem endp; \
2525
.endm; \
26-
ENTRY(atomic64_##op##_386); \
26+
SYM_FUNC_START(atomic64_##op##_386); \
2727
LOCK v;
2828

2929
#define ENDP endp

0 commit comments

Comments
 (0)