Skip to content

Commit

Permalink
[PATCH] Kprobes ia64 qp fix
Browse files Browse the repository at this point in the history
Fix a bug where a kprobe still fires when the instruction is predicated
off.  So given the p6=0, and we have an instruction like:

(p6) move loc1=0

we should not be triggering the kprobe.  This is handled by carrying over
the qp section of the original instruction into the break instruction.

Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: Rusty Lynch <Rusty.lynch@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Rusty Lynch authored and Linus Torvalds committed Jun 23, 2005
1 parent 8bc7677 commit 13608d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/ia64/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ int arch_prepare_kprobe(struct kprobe *p)
case 0:
major_opcode = (bundle->quad0.slot0 >> SLOT0_OPCODE_SHIFT);
kprobe_inst = bundle->quad0.slot0;
bundle->quad0.slot0 = BREAK_INST;
bundle->quad0.slot0 = BREAK_INST | (0x3f & kprobe_inst);
break;
case 1:
major_opcode = (bundle->quad1.slot1_p1 >> SLOT1_p1_OPCODE_SHIFT);
kprobe_inst = (bundle->quad0.slot1_p0 |
(bundle->quad1.slot1_p1 << (64-46)));
bundle->quad0.slot1_p0 = BREAK_INST;
bundle->quad0.slot1_p0 = BREAK_INST | (0x3f & kprobe_inst);
bundle->quad1.slot1_p1 = (BREAK_INST >> (64-46));
break;
case 2:
major_opcode = (bundle->quad1.slot2 >> SLOT2_OPCODE_SHIFT);
kprobe_inst = bundle->quad1.slot2;
bundle->quad1.slot2 = BREAK_INST;
bundle->quad1.slot2 = BREAK_INST | (0x3f & kprobe_inst);
break;
}

Expand Down

0 comments on commit 13608d6

Please sign in to comment.