Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 32927
b: refs/heads/master
c: a9ad965
h: refs/heads/master
i:
  32925: ce940d4
  32923: 1ef7809
  32919: b5ce645
  32911: e7f2883
  32895: 5b717f5
v: v3
  • Loading branch information
bibo, mao authored and Linus Torvalds committed Jul 31, 2006
1 parent 85c835e commit ef213ca
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 25c8716cb08dea386c7d6220b82eba732ccbf976
refs/heads/master: a9ad965ea9a6d719daf333847a2ceb0e363994bd
9 changes: 9 additions & 0 deletions trunk/arch/ia64/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-i386/kprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-ia64/kprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
1 change: 1 addition & 0 deletions trunk/include/asm-powerpc/kprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-sparc64/kprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86_64/kprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions trunk/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ static int __kprobes add_new_kprobe(struct kprobe *old_p, struct kprobe *p)
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;
Expand Down

0 comments on commit ef213ca

Please sign in to comment.