Skip to contentSkip to conversation

x86-64/entry: fold identical code paths

PATCH New Jan Beulich 2 participants 2 messages Jun 1, 2015 – Jun 2, 2015 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86-64/entry: fold identical code paths

retint_kernel doesn't require %rcx to be pointing to thread info (anymore?), and the code on the two alternative paths is - not really surprisingly - identical.

Cc Andy Lutomirski <[email protected]>
---
 arch/x86/kernel/entry_64.S |   10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
arch/x86/kernel/entry_64.S +2 -8
@@ -744,7 +744,7 @@ ret_from_intr:
 	testl $3,CS(%rsp)
 	je retint_kernel
 	/* Interrupt came from user space */
-
+retint_user:
 	GET_THREAD_INFO(%rcx)
 	/*
 	 * %rcx: thread info. Interrupts off.
@@ -1380,15 +1380,9 @@ ENTRY(error_exit)
 	RESTORE_EXTRA_REGS
 	DISABLE_INTERRUPTS(CLBR_NONE)
 	TRACE_IRQS_OFF
-	GET_THREAD_INFO(%rcx)
 	testl %eax,%eax
 	jne retint_kernel
-	LOCKDEP_SYS_EXIT_IRQ
-	movl TI_flags(%rcx),%edx
-	movl $_TIF_WORK_MASK,%edi
-	andl %edi,%edx
-	jnz retint_careful
-	jmp retint_swapgs
+	jmp retint_user
 	CFI_ENDPROC
 END(error_exit)
 
#1 lore raw

[tip:x86/asm] x86/asm/entry/64: Fold identical code paths

x86/asm/entry/64: Fold identical code paths
Commit-ID:  2f63b9db7260beba3c19d66d6c11b0b78ea84a8c
Gitweb:     http://git.kernel.org/tip/2f63b9db7260beba3c19d66d6c11b0b78ea84a8c
Author:     Jan Beulich <[email protected]>
AuthorDate: Mon, 1 Jun 2015 13:03:59 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 2 Jun 2015 10:10:09 +0200

x86/asm/entry/64: Fold identical code paths

retint_kernel doesn't require %rcx to be pointing to thread info (anymore?), and the code on the two alternative paths is - not really surprisingly - identical.

Cc Andy Lutomirski <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Brian Gerst <[email protected]>
Cc Denys Vlasenko <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/x86/kernel/entry_64.S | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
arch/x86/kernel/entry_64.S +2 -8
index b84cec5..4ad79e9 100644
@@ -615,7 +615,7 @@ ret_from_intr:
 	testb	$3, CS(%rsp)
 	jz	retint_kernel
 	/* Interrupt came from user space */
-
+retint_user:
 	GET_THREAD_INFO(%rcx)
 	/*
 	 * %rcx: thread info. Interrupts off.
@@ -1194,15 +1194,9 @@ ENTRY(error_exit)
 	RESTORE_EXTRA_REGS
 	DISABLE_INTERRUPTS(CLBR_NONE)
 	TRACE_IRQS_OFF
-	GET_THREAD_INFO(%rcx)
 	testl %eax,%eax
 	jnz retint_kernel
-	LOCKDEP_SYS_EXIT_IRQ
-	movl TI_flags(%rcx),%edx
-	movl $_TIF_WORK_MASK,%edi
-	andl %edi,%edx
-	jnz retint_careful
-	jmp retint_swapgs
+	jmp retint_user
 END(error_exit)
 
 /* Runs on exception stack */