Skip to contentSkip to conversation

ia64 enable trap code on slot 1

PATCH In review bibo,mao 2 participants 4 messages Nov 14, 2006 – Nov 15, 2006

lore
Share & tools
lore

bibo,mao

author
#0 lore raw

PATCH 1/1 ia64 enable trap code on slot 1

Hi,
Because slot 1 of one instr bundle crosses border of two
consecutive 8-bytes, kprobe on slot 1 is disabled. This patch enables kprobe on slot1, it only replaces higher 8-bytes trap major code and immediate sum, and remains lower 8-bytes the same.
For those instructions which must execute regardless qp bits,
kprobe on slot 1 is still disabled.

(sorry if you receive duplicates, my original was not sent to
linux-ia64 mailing list)

thanks
bibo,mao

-----------------------------------------------------

arch/ia64/kernel/jprobes.S |    3 +-
arch/ia64/kernel/kprobes.c |   51 ++++++++++++++++++---
include/asm-ia64/break.h   |    4 +--
include/asm-ia64/kprobes.h |    1
4 files changed, 42 insertions(+), 17 deletions(-)
arch/ia64/kernel/jprobes.S +2 -1
index 5cd6226..6216302 100644
@@ -45,13 +45,14 @@
  * to the correct location.
  */
 #include <asm/asmmacro.h>
+#include <asm-ia64/break.h>
 
 	/*
 	 * void jprobe_break(void)
 	 */
 	.section .kprobes.text, "ax"
 ENTRY(jprobe_break)
-	break.m 0x80300
+	break.m __IA64_BREAK_JPROBE
 END(jprobe_break)
 
 	/*
arch/ia64/kernel/kprobes.c +37 -14

85 lines not on this page · raw message

include/asm-ia64/break.h +2 -2
index 8167828..875c1d2 100644
@@ -12,8 +12,8 @@ #define _ASM_IA64_BREAK_H
  * OS-specific debug break numbers:
  */
 #define __IA64_BREAK_KDB		0x80100
-#define __IA64_BREAK_KPROBE		0x80200
-#define __IA64_BREAK_JPROBE		0x80300
+#define __IA64_BREAK_KPROBE		0x81000
+#define __IA64_BREAK_JPROBE		0x82000
 
 /*
  * OS-specific break numbers:
include/asm-ia64/kprobes.h +1 -0
index 1b45b71..828ae00 100644
@@ -115,6 +115,7 @@ struct arch_specific_insn {
  #define INST_FLAG_BREAK_INST			4
  	unsigned long inst_flag;
  	unsigned short target_br_reg;
+	unsigned short slot;
 };
 
 extern int kprobe_exceptions_notify(struct notifier_block *self,
#1 lore raw

-#define __IA64_BREAK_KPROBE 0x80200
-#define __IA64_BREAK_JPROBE 0x80300
+#define __IA64_BREAK_KPROBE 0x81000
+#define __IA64_BREAK_JPROBE 0x82000

I think a comment here in break.h would be useful ... noting that for JPROBE and KPROBE the low 12-bits are ignored.

Otherwise this looks like a neat solution to a tricky problem.

-Tony

#2 lore raw
In reply to bibo,mao
Quoted 2 lines

I think a comment here in break.h would be useful ... noting that for JPROBE and KPROBE the low 12-bits are ignored.

I added a teeny comment ... so break.h diff looks like this. Ok?

include/asm-ia64/break.h +2 -2
index 8167828..f034020 100644
@@ -12,8 +12,8 @@ #define _ASM_IA64_BREAK_H
  * OS-specific debug break numbers:
  */
 #define __IA64_BREAK_KDB		0x80100
-#define __IA64_BREAK_KPROBE		0x80200
-#define __IA64_BREAK_JPROBE		0x80300
+#define __IA64_BREAK_KPROBE		0x81000 /* .. 0x81fff */
+#define __IA64_BREAK_JPROBE		0x82000
 
author
#3 lore raw
In reply to bibo,mao
Quoted 4 lines · Tony
Quoted 2 lines

I think a comment here in break.h would be useful ... noting that for JPROBE and KPROBE the low 12-bits are ignored.

I added a teeny comment ... so break.h diff looks like this. Ok?

yes, it looks better and clearer with this comment.

thanks
bibo,mao

Quoted 14 lines
include/asm-ia64/break.h +2 -2
index 8167828..f034020 100644
@@ -12,8 +12,8 @@ #define _ASM_IA64_BREAK_H
  * OS-specific debug break numbers:
  */
 #define __IA64_BREAK_KDB		0x80100
-#define __IA64_BREAK_KPROBE		0x80200
-#define __IA64_BREAK_JPROBE		0x80300
+#define __IA64_BREAK_KPROBE		0x81000 /* .. 0x81fff */
+#define __IA64_BREAK_JPROBE		0x82000