Skip to contentSkip to conversation

Kprobes - i386 add KPROBE_END macro for .popsection

PATCH Applied S. P. Prasanna 2 participants 2 messages Aug 16, 2006

lore
Share & tools
lore
#0 lore raw

This patch add a macro KPROBE_END() to add .popsection after each KPROBE_ENTRY() usage, as suggested by Jan Beulich. This patch also replace .popsection with the KPROBE_END() macro.
This will be helpful for the conversions like the recent
.section -> .pushsection and .previous -> .popsection to be
confined to the header defining these macros, without need to touch any assembly files.

 arch/i386/kernel/entry.S |   10 +++++-----
 include/linux/linkage.h  |    4 ++++
 2 files changed, 9 insertions(+), 5 deletions(-)
arch/i386/kernel/entry.S renamed from arch/i386/kernel/entry.S~kprobes-add-popsection-macro-for-assembly-stub +5 -5
diff -puN arch/i386/kernel/entry.S~kprobes-add-popsection-macro-for-assembly-stub arch/i386/kernel/entry.S
@@ -646,7 +646,7 @@ error_code:
 	call *%edi
 	jmp ret_from_exception
 	CFI_ENDPROC
-.popsection
+KPROBE_END(page_fault)
 
 ENTRY(coprocessor_error)
 	RING0_INT_FRAME
@@ -722,7 +722,7 @@ debug_stack_correct:
 	call do_debug
 	jmp ret_from_exception
 	CFI_ENDPROC
-.popsection
+KPROBE_END(debug)
 
 /*
  * NMI is doubly nasty. It can happen _while_ we're handling
@@ -807,7 +807,7 @@ nmi_16bit_stack:
 .section __ex_table,"a"
 	.align 4
 	.long 1b,iret_exc
-.previous
+KPROBE_END(nmi)
 
 KPROBE_ENTRY(int3)
 	RING0_INT_FRAME
@@ -819,7 +819,7 @@ KPROBE_ENTRY(int3)
 	call do_int3
 	jmp ret_from_exception
 	CFI_ENDPROC
-.popsection
+KPROBE_END(int3)
 
 ENTRY(overflow)
 	RING0_INT_FRAME
@@ -884,7 +884,7 @@ KPROBE_ENTRY(general_protection)
 	CFI_ADJUST_CFA_OFFSET 4
 	jmp error_code
 	CFI_ENDPROC
-.popsection
+KPROBE_END(general_protection)
 
 ENTRY(alignment_check)
 	RING0_EC_FRAME
include/linux/linkage.h renamed from include/linux/linkage.h~kprobes-add-popsection-macro-for-assembly-stub +4 -0
diff -puN include/linux/linkage.h~kprobes-add-popsection-macro-for-assembly-stub include/linux/linkage.h
@@ -43,6 +43,10 @@
   .size name, .-name
 #endif
 
+#define KPROBE_END(name) \
+   END(name); \
+  .popsection
+
 #ifndef ENDPROC
 #define ENDPROC(name) \
   .type name, @function; \

_

Signature · 5 lines
Prasanna S.P.
Linux Technology Center
India Software Labs, IBM Bangalore
Email: [email protected]
Ph: 91-80-41776329
Applied
#1 lore raw
Quoted 7 lines · On Wed, 16 Aug 2006 19:19:32 +0530 "S. P. Prasanna" <[email protected]> wrote:

This patch add a macro KPROBE_END() to add .popsection after each KPROBE_ENTRY() usage, as suggested by Jan Beulich. This patch also replace .popsection with the KPROBE_END() macro.
This will be helpful for the conversions like the recent
.section -> .pushsection and .previous -> .popsection to be
confined to the header defining these macros, without need to touch any assembly files.

I merged it with the existing patches. Thanks.

-Andi