Skip to content

Commit 4aec216

Browse files
Jiri Slabysuryasaimadhu
authored andcommitted
x86/asm/64: Add ENDs to some functions and relabel with SYM_CODE_*
All these are functions which are invoked from elsewhere but they are not typical C functions. So annotate them using the new SYM_CODE_START. All these were not balanced with any END, so mark their ends by SYM_CODE_END appropriately too. Signed-off-by: Jiri Slaby <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> [xen bits] Acked-by: Rafael J. Wysocki <[email protected]> [power mgmt] Cc: Andy Shevchenko <[email protected]> Cc: Cao jin <[email protected]> Cc: Darren Hart <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Juergen Gross <[email protected]> Cc: "Kirill A. Shutemov" <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Pavel Machek <[email protected]> Cc: Pingfan Liu <[email protected]> Cc: [email protected] Cc: "Rafael J. Wysocki" <[email protected]> Cc: Stefano Stabellini <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Wei Huang <[email protected]> Cc: x86-ml <[email protected]> Cc: [email protected] Cc: Xiaoyao Li <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent f13ad88 commit 4aec216

File tree

7 files changed

+25
-12
lines changed

7 files changed

+25
-12
lines changed

arch/x86/boot/compressed/head_64.S

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ ENDPROC(efi32_stub_entry)
250250

251251
.code64
252252
.org 0x200
253-
ENTRY(startup_64)
253+
SYM_CODE_START(startup_64)
254254
/*
255255
* 64bit entry is 0x200 and it is ABI so immutable!
256256
* We come here either from startup_32 or directly from a
@@ -442,6 +442,7 @@ trampoline_return:
442442
*/
443443
leaq .Lrelocated(%rbx), %rax
444444
jmp *%rax
445+
SYM_CODE_END(startup_64)
445446

446447
#ifdef CONFIG_EFI_STUB
447448

@@ -571,7 +572,7 @@ SYM_FUNC_END(.Lrelocated)
571572
* ECX contains the base address of the trampoline memory.
572573
* Non zero RDX means trampoline needs to enable 5-level paging.
573574
*/
574-
ENTRY(trampoline_32bit_src)
575+
SYM_CODE_START(trampoline_32bit_src)
575576
/* Set up data and stack segments */
576577
movl $__KERNEL_DS, %eax
577578
movl %eax, %ds
@@ -634,6 +635,7 @@ ENTRY(trampoline_32bit_src)
634635
movl %eax, %cr0
635636

636637
lret
638+
SYM_CODE_END(trampoline_32bit_src)
637639

638640
.code64
639641
SYM_FUNC_START_LOCAL_NOALIGN(.Lpaging_enabled)

arch/x86/platform/olpc/xo1-wakeup.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ restore_registers:
9090

9191
ret
9292

93-
ENTRY(do_olpc_suspend_lowlevel)
93+
SYM_CODE_START(do_olpc_suspend_lowlevel)
9494
call save_processor_state
9595
call save_registers
9696

@@ -110,6 +110,7 @@ ret_point:
110110
call restore_registers
111111
call restore_processor_state
112112
ret
113+
SYM_CODE_END(do_olpc_suspend_lowlevel)
113114

114115
.data
115116
saved_gdt: .long 0,0

arch/x86/power/hibernate_asm_64.S

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ENTRY(swsusp_arch_suspend)
5252
ret
5353
ENDPROC(swsusp_arch_suspend)
5454

55-
ENTRY(restore_image)
55+
SYM_CODE_START(restore_image)
5656
/* prepare to jump to the image kernel */
5757
movq restore_jump_address(%rip), %r8
5858
movq restore_cr3(%rip), %r9
@@ -67,9 +67,10 @@ ENTRY(restore_image)
6767
/* jump to relocated restore code */
6868
movq relocated_restore_code(%rip), %rcx
6969
jmpq *%rcx
70+
SYM_CODE_END(restore_image)
7071

7172
/* code below has been relocated to a safe page */
72-
ENTRY(core_restore_code)
73+
SYM_CODE_START(core_restore_code)
7374
/* switch to temporary page tables */
7475
movq %rax, %cr3
7576
/* flush TLB */
@@ -97,6 +98,7 @@ ENTRY(core_restore_code)
9798
.Ldone:
9899
/* jump to the restore_registers address from the image header */
99100
jmpq *%r8
101+
SYM_CODE_END(core_restore_code)
100102

101103
/* code below belongs to the image kernel */
102104
.align PAGE_SIZE

arch/x86/realmode/rm/reboot.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
.section ".text32", "ax"
2121
.code32
22-
ENTRY(machine_real_restart_asm)
22+
SYM_CODE_START(machine_real_restart_asm)
2323

2424
#ifdef CONFIG_X86_64
2525
/* Switch to trampoline GDT as it is guaranteed < 4 GiB */
@@ -63,6 +63,7 @@ SYM_INNER_LABEL(machine_real_restart_paging_off, SYM_L_GLOBAL)
6363
movl %ecx, %gs
6464
movl %ecx, %ss
6565
ljmpw $8, $1f
66+
SYM_CODE_END(machine_real_restart_asm)
6667

6768
/*
6869
* This is 16-bit protected mode code to disable paging and the cache,

arch/x86/realmode/rm/trampoline_64.S

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
.code16
3939

4040
.balign PAGE_SIZE
41-
ENTRY(trampoline_start)
41+
SYM_CODE_START(trampoline_start)
4242
cli # We should be safe anyway
4343
wbinvd
4444

@@ -78,12 +78,14 @@ ENTRY(trampoline_start)
7878
no_longmode:
7979
hlt
8080
jmp no_longmode
81+
SYM_CODE_END(trampoline_start)
82+
8183
#include "../kernel/verify_cpu.S"
8284

8385
.section ".text32","ax"
8486
.code32
8587
.balign 4
86-
ENTRY(startup_32)
88+
SYM_CODE_START(startup_32)
8789
movl %edx, %ss
8890
addl $pa_real_mode_base, %esp
8991
movl %edx, %ds
@@ -137,13 +139,15 @@ ENTRY(startup_32)
137139
* the new gdt/idt that has __KERNEL_CS with CS.L = 1.
138140
*/
139141
ljmpl $__KERNEL_CS, $pa_startup_64
142+
SYM_CODE_END(startup_32)
140143

141144
.section ".text64","ax"
142145
.code64
143146
.balign 4
144-
ENTRY(startup_64)
147+
SYM_CODE_START(startup_64)
145148
# Now jump into the kernel using virtual addresses
146149
jmpq *tr_start(%rip)
150+
SYM_CODE_END(startup_64)
147151

148152
.section ".rodata","a"
149153
# Duplicate the global descriptor table

arch/x86/realmode/rm/wakeup_asm.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ SYM_DATA_END(wakeup_header)
3737
.code16
3838

3939
.balign 16
40-
ENTRY(wakeup_start)
40+
SYM_CODE_START(wakeup_start)
4141
cli
4242
cld
4343

@@ -135,6 +135,7 @@ ENTRY(wakeup_start)
135135
#else
136136
jmp trampoline_start
137137
#endif
138+
SYM_CODE_END(wakeup_start)
138139

139140
bogus_real_magic:
140141
1:

arch/x86/xen/xen-asm_64.S

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,12 @@ hypercall_iret = hypercall_page + __HYPERVISOR_iret * 32
8585
* r11 }<-- pushed by hypercall page
8686
* rsp->rax }
8787
*/
88-
ENTRY(xen_iret)
88+
SYM_CODE_START(xen_iret)
8989
pushq $0
9090
jmp hypercall_iret
91+
SYM_CODE_END(xen_iret)
9192

92-
ENTRY(xen_sysret64)
93+
SYM_CODE_START(xen_sysret64)
9394
/*
9495
* We're already on the usermode stack at this point, but
9596
* still with the kernel gs, so we can easily switch back.
@@ -107,6 +108,7 @@ ENTRY(xen_sysret64)
107108

108109
pushq $VGCF_in_syscall
109110
jmp hypercall_iret
111+
SYM_CODE_END(xen_sysret64)
110112

111113
/*
112114
* Xen handles syscall callbacks much like ordinary exceptions, which

0 commit comments

Comments
 (0)