Commit 6d685e53 authored by Jiri Slaby's avatar Jiri Slaby Committed by Borislav Petkov
Browse files

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: default avatarJiri Slaby <jslaby@suse.cz>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Cc: Allison Randal <allison@lohutok.net>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Andy Shevchenko <andy@infradead.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Bill Metzenthen <billm@melbpc.org.au>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Darren Hart <dvhart@infradead.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-arch@vger.kernel.org
Cc: linux-crypto@vger.kernel.org
Cc: linux-efi <linux-efi@vger.kernel.org>
Cc: linux-efi@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: platform-driver-x86@vger.kernel.org
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Cc: x86-ml <x86@kernel.org>
Link: https://lkml.kernel.org/r/20191011115108.12392-28-jslaby@suse.cz
parent 5e63306f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@
 */

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

.data
+6 −6
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@
	.hidden _egot

	__HEAD
ENTRY(startup_32)
SYM_FUNC_START(startup_32)
	cld
	/*
	 * Test KEEP_SEGMENTS flag to see if the bootloader is asking
@@ -142,14 +142,14 @@ ENTRY(startup_32)
 */
	leal	.Lrelocated(%ebx), %eax
	jmp	*%eax
ENDPROC(startup_32)
SYM_FUNC_END(startup_32)

#ifdef CONFIG_EFI_STUB
/*
 * We don't need the return address, so set up the stack so efi_main() can find
 * its arguments.
 */
ENTRY(efi_pe_entry)
SYM_FUNC_START(efi_pe_entry)
	add	$0x4, %esp

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

ENTRY(efi32_stub_entry)
SYM_FUNC_START(efi32_stub_entry)
	add	$0x4, %esp
	popl	%ecx
	popl	%edx
@@ -205,7 +205,7 @@ fail:
	movl	BP_code32_start(%esi), %eax
	leal	startup_32(%eax), %eax
	jmp	*%eax
ENDPROC(efi32_stub_entry)
SYM_FUNC_END(efi32_stub_entry)
#endif

	.text
+4 −4
Original line number Diff line number Diff line
@@ -497,7 +497,7 @@
	pxor t0,		x3; \
	movdqu x3,		(3*4*4)(out);

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

	ret;
ENDPROC(__serpent_enc_blk_4way)
SYM_FUNC_END(__serpent_enc_blk_4way)

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

	ret;
ENDPROC(serpent_dec_blk_4way)
SYM_FUNC_END(serpent_dec_blk_4way)
+4 −4
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@
	xor	%esi,		d ## D;\
	ror	$1,		d ## D;

ENTRY(twofish_enc_blk)
SYM_FUNC_START(twofish_enc_blk)
	push	%ebp			/* save registers according to calling convention*/
	push    %ebx
	push    %esi
@@ -261,9 +261,9 @@ ENTRY(twofish_enc_blk)
	pop	%ebp
	mov	$1,	%eax
	ret
ENDPROC(twofish_enc_blk)
SYM_FUNC_END(twofish_enc_blk)

ENTRY(twofish_dec_blk)
SYM_FUNC_START(twofish_dec_blk)
	push	%ebp			/* save registers according to calling convention*/
	push    %ebx
	push    %esi
@@ -318,4 +318,4 @@ ENTRY(twofish_dec_blk)
	pop	%ebp
	mov	$1,	%eax
	ret
ENDPROC(twofish_dec_blk)
SYM_FUNC_END(twofish_dec_blk)
+12 −12
Original line number Diff line number Diff line
@@ -757,7 +757,7 @@ SYM_CODE_END(__switch_to_asm)
 * asmlinkage function so its argument has to be pushed on the stack.  This
 * wrapper creates a proper "end of stack" frame header before the call.
 */
ENTRY(schedule_tail_wrapper)
SYM_FUNC_START(schedule_tail_wrapper)
	FRAME_BEGIN

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

	FRAME_END
	ret
ENDPROC(schedule_tail_wrapper)
SYM_FUNC_END(schedule_tail_wrapper)
/*
 * A newly forked process directly context switches into this address.
 *
@@ -885,7 +885,7 @@ SYM_CODE_END(xen_sysenter_target)
 * ebp  user stack
 * 0(%ebp) arg6
 */
ENTRY(entry_SYSENTER_32)
SYM_FUNC_START(entry_SYSENTER_32)
	/*
	 * On entry-stack with all userspace-regs live - save and
	 * restore eflags and %eax to use it as scratch-reg for the cr3
@@ -1013,7 +1013,7 @@ ENTRY(entry_SYSENTER_32)
	popfl
	jmp	.Lsysenter_flags_fixed
SYM_ENTRY(__end_SYSENTER_singlestep_region, SYM_L_GLOBAL, SYM_A_NONE)
ENDPROC(entry_SYSENTER_32)
SYM_FUNC_END(entry_SYSENTER_32)

/*
 * 32-bit legacy system call entry.
@@ -1043,7 +1043,7 @@ ENDPROC(entry_SYSENTER_32)
 * edi  arg5
 * ebp  arg6
 */
ENTRY(entry_INT80_32)
SYM_FUNC_START(entry_INT80_32)
	ASM_CLAC
	pushl	%eax			/* pt_regs->orig_ax */

@@ -1120,7 +1120,7 @@ SYM_CODE_START(iret_exc)
SYM_CODE_END(iret_exc)
.previous
	_ASM_EXTABLE(.Lirq_return, iret_exc)
ENDPROC(entry_INT80_32)
SYM_FUNC_END(entry_INT80_32)

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

#define BUILD_INTERRUPT3(name, nr, fn)			\
ENTRY(name)						\
SYM_FUNC_START(name)					\
	ASM_CLAC;					\
	pushl	$~(nr);					\
	SAVE_ALL switch_stacks=1;			\
@@ -1222,7 +1222,7 @@ ENTRY(name) \
	movl	%esp, %eax;				\
	call	fn;					\
	jmp	ret_from_intr;				\
ENDPROC(name)
SYM_FUNC_END(name)

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

#ifdef CONFIG_XEN_PV
ENTRY(xen_hypervisor_callback)
SYM_FUNC_START(xen_hypervisor_callback)
	pushl	$-1				/* orig_ax = -1 => not a system call */
	SAVE_ALL
	ENCODE_FRAME_POINTER
@@ -1369,7 +1369,7 @@ SYM_INNER_LABEL_ALIGN(xen_do_upcall, SYM_L_GLOBAL)
	call	xen_maybe_preempt_hcall
#endif
	jmp	ret_from_intr
ENDPROC(xen_hypervisor_callback)
SYM_FUNC_END(xen_hypervisor_callback)

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

#ifdef CONFIG_XEN_PVHVM
Loading