Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80116
b: refs/heads/master
c: 31f80e4
h: refs/heads/master
v: v3
  • Loading branch information
Harvey Harrison authored and Ingo Molnar committed Jan 30, 2008
1 parent 5401bb7 commit 4c3b98d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9930927f36ac3e39ffa674dc23ef06f13c39cef7
refs/heads/master: 31f80e45ea26008939790b4363a4fdcff240e0d6
9 changes: 5 additions & 4 deletions trunk/arch/x86/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,16 @@ static int __kprobes is_IF_modifier(kprobe_opcode_t *insn)
return 0;
}

#ifdef CONFIG_X86_64
/*
* Adjust the displacement if the instruction uses the %rip-relative
* addressing mode.
* If it does, Return the address of the 32-bit displacement word.
* If not, return null.
* Only applicable to 64-bit x86.
*/
static void __kprobes fix_riprel(struct kprobe *p)
{
#ifdef CONFIG_X86_64
u8 *insn = p->ainsn.insn;
s64 disp;
int need_modrm;
Expand Down Expand Up @@ -335,15 +336,15 @@ static void __kprobes fix_riprel(struct kprobe *p)
*(s32 *)insn = (s32) disp;
}
}
}
#endif
}

static void __kprobes arch_copy_kprobe(struct kprobe *p)
{
memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t));
#ifdef CONFIG_X86_64

fix_riprel(p);
#endif

if (can_boost(p->addr))
p->ainsn.boostable = 0;
else
Expand Down

0 comments on commit 4c3b98d

Please sign in to comment.