Commit ef79ed20 authored by Peter Zijlstra's avatar Peter Zijlstra
Browse files

x86/entry: Make sync_regs() invocation a tail call



No point in having a call there. Spare the call/ret overhead.

Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220915111146.539578813@infradead.org
parent 5a9c361a
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1062,11 +1062,8 @@ SYM_CODE_START_LOCAL(error_entry)
	UNTRAIN_RET

	leaq	8(%rsp), %rdi			/* arg0 = pt_regs pointer */
.Lerror_entry_from_usermode_after_swapgs:

	/* Put us onto the real thread stack. */
	call	sync_regs
	RET
	jmp	sync_regs

	/*
	 * There are two places in the kernel that can potentially fault with
@@ -1124,7 +1121,7 @@ SYM_CODE_START_LOCAL(error_entry)
	leaq	8(%rsp), %rdi			/* arg0 = pt_regs pointer */
	call	fixup_bad_iret
	mov	%rax, %rdi
	jmp	.Lerror_entry_from_usermode_after_swapgs
	jmp	sync_regs
SYM_CODE_END(error_entry)

SYM_CODE_START_LOCAL(error_return)