From aa470140e86e45723cf8387292edbce9106ddc1f Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Wed, 30 Jan 2008 13:31:21 +0100 Subject: x86: kprobe-booster for x86-64 This patch adds kprobe-booster to kprobes_64.c. - Changes are based on x86-32. - Add REX prefix checking code. Signed-off-by: Masami Hiramatsu Signed-off-by: Jim Keniston Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner --- include/asm-x86/kprobes_64.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/asm-x86/kprobes_64.h') diff --git a/include/asm-x86/kprobes_64.h b/include/asm-x86/kprobes_64.h index 8c919d35cdd3..e7e921dac7c2 100644 --- a/include/asm-x86/kprobes_64.h +++ b/include/asm-x86/kprobes_64.h @@ -34,6 +34,7 @@ struct kprobe; typedef u8 kprobe_opcode_t; #define BREAKPOINT_INSTRUCTION 0xcc +#define RELATIVEJUMP_INSTRUCTION 0xe9 #define MAX_INSN_SIZE 15 #define MAX_STACK_SIZE 64 #define MIN_STACK_SIZE(ADDR) (((MAX_STACK_SIZE) < \ @@ -52,6 +53,15 @@ extern void arch_remove_kprobe(struct kprobe *p); struct arch_specific_insn { /* copy of the original instruction */ kprobe_opcode_t *insn; + /* + * boostable = -1: This instruction type is not boostable. + * boostable = 0: This instruction type is boostable. + * boostable = 1: This instruction has been boosted: we have + * added a relative jump after the instruction copy in insn, + * so no single-step and fixup are needed (unless there's + * a post_handler or break_handler). + */ + int boostable; }; struct prev_kprobe { -- cgit v1.2.3