- ia64-kprobe-invalidate-icache-of-jump-buffer.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     IA64: kprobe invalidate icache of jump buffer

has been removed from the -mm tree.  Its filename is

     ia64-kprobe-invalidate-icache-of-jump-buffer.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: IA64: kprobe invalidate icache of jump buffer
From: "bibo, mao" <bibo.mao@xxxxxxxxx>

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@xxxxxxxxx>
Acked-by: "Luck, Tony" <tony.luck@xxxxxxxxx>
Acked-by: Keshavamurthy Anil S <anil.s.keshavamurthy@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/ia64/kernel/kprobes.c    |    9 +++++++++
 include/asm-i386/kprobes.h    |    1 +
 include/asm-ia64/kprobes.h    |    1 +
 include/asm-powerpc/kprobes.h |    1 +
 include/asm-sparc64/kprobes.h |    1 +
 include/asm-x86_64/kprobes.h  |    1 +
 kernel/kprobes.c              |    1 +
 7 files changed, 15 insertions(+)

diff -puN arch/ia64/kernel/kprobes.c~ia64-kprobe-invalidate-icache-of-jump-buffer arch/ia64/kernel/kprobes.c
--- a/arch/ia64/kernel/kprobes.c~ia64-kprobe-invalidate-icache-of-jump-buffer
+++ a/arch/ia64/kernel/kprobes.c
@@ -448,11 +448,20 @@ int __kprobes arch_prepare_kprobe(struct
 	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));
 }
diff -puN include/asm-i386/kprobes.h~ia64-kprobe-invalidate-icache-of-jump-buffer include/asm-i386/kprobes.h
--- a/include/asm-i386/kprobes.h~ia64-kprobe-invalidate-icache-of-jump-buffer
+++ a/include/asm-i386/kprobes.h
@@ -45,6 +45,7 @@ typedef u8 kprobe_opcode_t;
 #define JPROBE_ENTRY(pentry)	(kprobe_opcode_t *)pentry
 #define ARCH_SUPPORTS_KRETPROBES
 #define  ARCH_INACTIVE_KPROBE_COUNT 0
+#define flush_insn_slot(p)	do { } while (0)
 
 void arch_remove_kprobe(struct kprobe *p);
 void kretprobe_trampoline(void);
diff -puN include/asm-ia64/kprobes.h~ia64-kprobe-invalidate-icache-of-jump-buffer include/asm-ia64/kprobes.h
--- a/include/asm-ia64/kprobes.h~ia64-kprobe-invalidate-icache-of-jump-buffer
+++ a/include/asm-ia64/kprobes.h
@@ -125,5 +125,6 @@ static inline void jprobe_return(void)
 }
 extern void invalidate_stacked_regs(void);
 extern void flush_register_stack(void);
+extern void flush_insn_slot(struct kprobe *p);
 
 #endif				/* _ASM_KPROBES_H */
diff -puN include/asm-powerpc/kprobes.h~ia64-kprobe-invalidate-icache-of-jump-buffer include/asm-powerpc/kprobes.h
--- a/include/asm-powerpc/kprobes.h~ia64-kprobe-invalidate-icache-of-jump-buffer
+++ a/include/asm-powerpc/kprobes.h
@@ -51,6 +51,7 @@ typedef unsigned int kprobe_opcode_t;
 
 #define ARCH_SUPPORTS_KRETPROBES
 #define  ARCH_INACTIVE_KPROBE_COUNT 1
+#define flush_insn_slot(p)	do { } while (0)
 
 void kretprobe_trampoline(void);
 extern void arch_remove_kprobe(struct kprobe *p);
diff -puN include/asm-sparc64/kprobes.h~ia64-kprobe-invalidate-icache-of-jump-buffer include/asm-sparc64/kprobes.h
--- a/include/asm-sparc64/kprobes.h~ia64-kprobe-invalidate-icache-of-jump-buffer
+++ a/include/asm-sparc64/kprobes.h
@@ -13,6 +13,7 @@ typedef u32 kprobe_opcode_t;
 #define JPROBE_ENTRY(pentry)	(kprobe_opcode_t *)pentry
 #define arch_remove_kprobe(p)	do {} while (0)
 #define  ARCH_INACTIVE_KPROBE_COUNT 0
+#define flush_insn_slot(p)	do { } while (0)
 
 /* Architecture specific copy of original instruction*/
 struct arch_specific_insn {
diff -puN include/asm-x86_64/kprobes.h~ia64-kprobe-invalidate-icache-of-jump-buffer include/asm-x86_64/kprobes.h
--- a/include/asm-x86_64/kprobes.h~ia64-kprobe-invalidate-icache-of-jump-buffer
+++ a/include/asm-x86_64/kprobes.h
@@ -47,6 +47,7 @@ typedef u8 kprobe_opcode_t;
 
 void kretprobe_trampoline(void);
 extern void arch_remove_kprobe(struct kprobe *p);
+#define flush_insn_slot(p)	do { } while (0)
 
 /* Architecture specific copy of original instruction*/
 struct arch_specific_insn {
diff -puN kernel/kprobes.c~ia64-kprobe-invalidate-icache-of-jump-buffer kernel/kprobes.c
--- a/kernel/kprobes.c~ia64-kprobe-invalidate-icache-of-jump-buffer
+++ a/kernel/kprobes.c
@@ -393,6 +393,7 @@ static int __kprobes add_new_kprobe(stru
 static inline void add_aggr_kprobe(struct kprobe *ap, struct kprobe *p)
 {
 	copy_kprobe(p, ap);
+	flush_insn_slot(ap);
 	ap->addr = p->addr;
 	ap->pre_handler = aggr_pre_handler;
 	ap->fault_handler = aggr_fault_handler;
_

Patches currently in -mm which might be from bibo.mao@xxxxxxxxx are

origin.patch
ia64-kprobe-invalidate-icache-of-jump-buffer-s390-fix.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux