Skip to content

Commit 06607c7

Browse files
brooniewilldeacon
authored andcommitted
arm64: entry: Refactor and modernise annotation for ret_to_user
As part of an effort to clarify and clean up the assembler annotations new macros have been introduced which annotate the start and end of blocks of code in assembler files. Currently ret_to_user has an out of line slow path work_pending placed above the main function which makes annotating the start and end of these blocks of code awkward. Since work_pending is only referenced from within ret_to_user try to make things a bit clearer by moving it after the current ret_to_user and then marking both ret_to_user and work_pending as part of a single ret_to_user code block. Signed-off-by: Mark Brown <[email protected]> Acked-by: Mark Rutland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent bf60333 commit 06607c7

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

arch/arm64/kernel/entry.S

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -727,21 +727,10 @@ el0_error_naked:
727727
b ret_to_user
728728
SYM_CODE_END(el0_error)
729729

730-
/*
731-
* Ok, we need to do extra processing, enter the slow path.
732-
*/
733-
work_pending:
734-
mov x0, sp // 'regs'
735-
bl do_notify_resume
736-
#ifdef CONFIG_TRACE_IRQFLAGS
737-
bl trace_hardirqs_on // enabled while in userspace
738-
#endif
739-
ldr x1, [tsk, #TSK_TI_FLAGS] // re-check for single-step
740-
b finish_ret_to_user
741730
/*
742731
* "slow" syscall return path.
743732
*/
744-
ret_to_user:
733+
SYM_CODE_START_LOCAL(ret_to_user)
745734
disable_daif
746735
gic_prio_kentry_setup tmp=x3
747736
ldr x1, [tsk, #TSK_TI_FLAGS]
@@ -753,7 +742,19 @@ finish_ret_to_user:
753742
bl stackleak_erase
754743
#endif
755744
kernel_exit 0
756-
ENDPROC(ret_to_user)
745+
746+
/*
747+
* Ok, we need to do extra processing, enter the slow path.
748+
*/
749+
work_pending:
750+
mov x0, sp // 'regs'
751+
bl do_notify_resume
752+
#ifdef CONFIG_TRACE_IRQFLAGS
753+
bl trace_hardirqs_on // enabled while in userspace
754+
#endif
755+
ldr x1, [tsk, #TSK_TI_FLAGS] // re-check for single-step
756+
b finish_ret_to_user
757+
SYM_CODE_END(ret_to_user)
757758

758759
.popsection // .entry.text
759760

0 commit comments

Comments
 (0)