diff options
author | bibo, mao | 2006-07-30 12:03:26 +0200 |
---|---|---|
committer | Linus Torvalds | 2006-07-31 22:28:38 +0200 |
commit | a9ad965ea9a6d719daf333847a2ceb0e363994bd (patch) | |
tree | 9ecb71f533c16eb790909f13fefd67fd939ffb2b /arch/ia64/kernel/kprobes.c | |
parent | [PATCH] arch/alpha: Use ARRAY_SIZE macro (diff) | |
download | kernel-qcow2-linux-a9ad965ea9a6d719daf333847a2ceb0e363994bd.tar.gz kernel-qcow2-linux-a9ad965ea9a6d719daf333847a2ceb0e363994bd.tar.xz kernel-qcow2-linux-a9ad965ea9a6d719daf333847a2ceb0e363994bd.zip |
[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>
Diffstat (limited to 'arch/ia64/kernel/kprobes.c')
-rw-r--r-- | arch/ia64/kernel/kprobes.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c index 00d9c83b8020..781960f80b6f 100644 --- a/arch/ia64/kernel/kprobes.c +++ b/arch/ia64/kernel/kprobes.c @@ -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)); } |