Skip to content

Commit 8c0fa8a

Browse files
committed
x86/entry/32: Move non entry code into .text section
All ASM code which is not part of the entry functionality can move out into the .text section. No reason to keep it in the non-instrumentable entry section. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Alexandre Chartre <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent b9f6976 commit 8c0fa8a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

arch/x86/entry/entry_32.S

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,7 @@
730730
* %eax: prev task
731731
* %edx: next task
732732
*/
733+
.pushsection .text, "ax"
733734
SYM_CODE_START(__switch_to_asm)
734735
/*
735736
* Save callee-saved registers
@@ -776,6 +777,7 @@ SYM_CODE_START(__switch_to_asm)
776777

777778
jmp __switch_to
778779
SYM_CODE_END(__switch_to_asm)
780+
.popsection
779781

780782
/*
781783
* The unwinder expects the last frame on the stack to always be at the same
@@ -784,6 +786,7 @@ SYM_CODE_END(__switch_to_asm)
784786
* asmlinkage function so its argument has to be pushed on the stack. This
785787
* wrapper creates a proper "end of stack" frame header before the call.
786788
*/
789+
.pushsection .text, "ax"
787790
SYM_FUNC_START(schedule_tail_wrapper)
788791
FRAME_BEGIN
789792

@@ -794,13 +797,16 @@ SYM_FUNC_START(schedule_tail_wrapper)
794797
FRAME_END
795798
ret
796799
SYM_FUNC_END(schedule_tail_wrapper)
800+
.popsection
801+
797802
/*
798803
* A newly forked process directly context switches into this address.
799804
*
800805
* eax: prev task we switched from
801806
* ebx: kernel thread func (NULL for user thread)
802807
* edi: kernel thread arg
803808
*/
809+
.pushsection .text, "ax"
804810
SYM_CODE_START(ret_from_fork)
805811
call schedule_tail_wrapper
806812

@@ -825,6 +831,7 @@ SYM_CODE_START(ret_from_fork)
825831
movl $0, PT_EAX(%esp)
826832
jmp 2b
827833
SYM_CODE_END(ret_from_fork)
834+
.popsection
828835

829836
/*
830837
* Return to user mode is not as complex as all this looks,
@@ -1691,6 +1698,7 @@ SYM_CODE_START(general_protection)
16911698
jmp common_exception
16921699
SYM_CODE_END(general_protection)
16931700

1701+
.pushsection .text, "ax"
16941702
SYM_CODE_START(rewind_stack_do_exit)
16951703
/* Prevent any naive code from trying to unwind to our caller. */
16961704
xorl %ebp, %ebp
@@ -1701,3 +1709,4 @@ SYM_CODE_START(rewind_stack_do_exit)
17011709
call do_exit
17021710
1: jmp 1b
17031711
SYM_CODE_END(rewind_stack_do_exit)
1712+
.popsection

0 commit comments

Comments
 (0)