Skip to contentSkip to conversation

x86_64:inline root irq thunks

PATCH In review Jan Kiszka 2 participants 2 messages Dec 29, 2007 – Dec 30, 2007 x86

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 2/5 x86_64:inline root irq thunks

Align x86_64 with x86_32 by inlining the xirq and virq trampolines. This saves a few bytes of text and avoids holes in the function backtraces you see with the tracer.

Jan

---
 arch/x86/kernel/entry_64.S |   51 +------------------------
 include/asm-x86/ipipe_64.h |   89 +++++++++++++++++++++++++++++++++++++--------
 2 files changed, 77 insertions(+), 63 deletions(-)
arch/x86/kernel/entry_64.S +2 -49
Index: linux-2.6.24-rc6-xeno/arch/x86/kernel/entry_64.S
===================================================================
@@ -582,54 +582,8 @@ END(stub_rt_sigreturn)
 #endif
 	.endm
 
-#ifdef CONFIG_IPIPE
-
-	/* %rdi=negated _vector_ number, %rsi=handler, %rdx=regs */
-ENTRY(__ipipe_root_xirq_thunk)
-	movq %rsp, %rax
-	pushq $0
-	pushq %rax
-	pushfq
-	pushq $__KERNEL_CS
-	pushq $1f
-	pushq %rdi
-	XCPT_FRAME
-	SAVE_ARGS
-	movq %rdi, ORIG_RAX(%rdx)	# regs->orig_eax = ~irq_vector
-	movq %rdx, %rdi		     	# regs for handler
-	call *%rsi
-	jmp exit_intr
-	CFI_ENDPROC
-1:
-	cli
-        ret
-END(__ipipe_root_xirq_thunk)
-	
-	/* %rdi=virq number, %rsi=cookie, %rdx=handler */
-ENTRY(__ipipe_root_virq_thunk)
-	movq %rsp, %rax
-	pushq $0
-	pushq %rax
-	pushfq
-	pushq $__KERNEL_CS
-	pushq $1f
-	pushq $-1
-	XCPT_FRAME
-	SAVE_ARGS
-	call irq_enter
-	movq RDI-ARGOFFSET(%rsp), %rdi
-	movq RSI-ARGOFFSET(%rsp), %rsi
-	movq RDX-ARGOFFSET(%rsp), %rdx
-	call *%rdx
-	call irq_exit
-	jmp exit_intr
-	CFI_ENDPROC
-1:
-	cli
-        ret
-END(__ipipe_root_virq_thunk)
-	
 ENTRY(common_interrupt)
+#ifdef CONFIG_IPIPE
 	XCPT_FRAME
 	interrupt __ipipe_handle_irq
 	testl %eax, %eax
@@ -643,7 +597,6 @@ ENTRY(common_interrupt)
 	swapgs
 	jmp restore_args
 #else /* !CONFIG_IPIPE */
-ENTRY(common_interrupt)
 	XCPT_FRAME
 	interrupt do_IRQ
 #endif /* !CONFIG_IPIPE */	
@@ -655,7 +608,7 @@ ret_from_intr:
 	leaveq
 	CFI_DEF_CFA_REGISTER	rsp
 	CFI_ADJUST_CFA_OFFSET	-8
-exit_intr:
+ENTRY(exit_intr)
 	GET_THREAD_INFO(%rcx)
 	testl $3,CS-ARGOFFSET(%rsp)
 	je retint_kernel
include/asm-x86/ipipe_64.h +75 -14

108 lines not on this page · raw message

#1 lore raw
Quoted 4 lines · Jan Kiszka

Align x86_64 with x86_32 by inlining the xirq and virq trampolines. This saves a few bytes of text and avoids holes in the function backtraces you see with the tracer.

Ok, the same kind of changes from the last patch series badly broke the kernel at boot time for both 32/64 archs, so this patch is held until the needed time can be dedicated to test it extensively.

Signature · 1 line
Philippe.