[PATCH] IA64: kprobe invalidate icache of jump buffer

Kprobe inserts breakpoint instruction in probepoint and then jumps to
instruction slot when breakpoint is hit, the instruction slot icache must
be consistent with dcache.  Here is the patch which invalidates instruction
slot icache area.

Without this patch, in some machines there will be fault when executing
instruction slot where icache content is inconsistent with dcache.

Signed-off-by: bibo,mao <bibo.mao@intel.com>
Acked-by: "Luck, Tony" <tony.luck@intel.com>
Acked-by: Keshavamurthy Anil S <anil.s.keshavamurthy@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
bibo, mao
2006-07-30 03:03:26 -07:00
committed by Linus Torvalds
parent 25c8716cb0
commit a9ad965ea9
7 changed files with 15 additions and 0 deletions

View File

@@ -448,11 +448,20 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
return 0;
}
void __kprobes flush_insn_slot(struct kprobe *p)
{
unsigned long arm_addr;
arm_addr = ((unsigned long)&p->opcode.bundle) & ~0xFULL;
flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t));
}
void __kprobes arch_arm_kprobe(struct kprobe *p)
{
unsigned long addr = (unsigned long)p->addr;
unsigned long arm_addr = addr & ~0xFULL;
flush_insn_slot(p);
memcpy((char *)arm_addr, &p->ainsn.insn.bundle, sizeof(bundle_t));
flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t));
}