diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/include/asm/uprobes.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/uprobes.c | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/include/asm/uprobes.h b/arch/x86/include/asm/uprobes.h index 72caff7afbde..9ce25ce04fee 100644 --- a/arch/x86/include/asm/uprobes.h +++ b/arch/x86/include/asm/uprobes.h | |||
@@ -53,7 +53,7 @@ struct arch_uprobe { | |||
53 | #ifdef CONFIG_X86_64 | 53 | #ifdef CONFIG_X86_64 |
54 | long riprel_target; | 54 | long riprel_target; |
55 | #endif | 55 | #endif |
56 | u16 fixups; | 56 | u8 fixups; |
57 | } def; | 57 | } def; |
58 | }; | 58 | }; |
59 | }; | 59 | }; |
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index 7824ce248f8f..a8e1d7e47001 100644 --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c | |||
@@ -33,16 +33,16 @@ | |||
33 | /* Post-execution fixups. */ | 33 | /* Post-execution fixups. */ |
34 | 34 | ||
35 | /* Adjust IP back to vicinity of actual insn */ | 35 | /* Adjust IP back to vicinity of actual insn */ |
36 | #define UPROBE_FIX_IP 0x1 | 36 | #define UPROBE_FIX_IP 0x01 |
37 | 37 | ||
38 | /* Adjust the return address of a call insn */ | 38 | /* Adjust the return address of a call insn */ |
39 | #define UPROBE_FIX_CALL 0x2 | 39 | #define UPROBE_FIX_CALL 0x02 |
40 | 40 | ||
41 | /* Instruction will modify TF, don't change it */ | 41 | /* Instruction will modify TF, don't change it */ |
42 | #define UPROBE_FIX_SETF 0x4 | 42 | #define UPROBE_FIX_SETF 0x04 |
43 | 43 | ||
44 | #define UPROBE_FIX_RIP_AX 0x8000 | 44 | #define UPROBE_FIX_RIP_AX 0x08 |
45 | #define UPROBE_FIX_RIP_CX 0x4000 | 45 | #define UPROBE_FIX_RIP_CX 0x10 |
46 | 46 | ||
47 | #define UPROBE_TRAP_NR UINT_MAX | 47 | #define UPROBE_TRAP_NR UINT_MAX |
48 | 48 | ||
@@ -307,12 +307,12 @@ handle_riprel_insn(struct arch_uprobe *auprobe, struct insn *insn) | |||
307 | * is NOT the register operand, so we use %rcx (register | 307 | * is NOT the register operand, so we use %rcx (register |
308 | * #1) for the scratch register. | 308 | * #1) for the scratch register. |
309 | */ | 309 | */ |
310 | auprobe->def.fixups = UPROBE_FIX_RIP_CX; | 310 | auprobe->def.fixups |= UPROBE_FIX_RIP_CX; |
311 | /* Change modrm from 00 000 101 to 00 000 001. */ | 311 | /* Change modrm from 00 000 101 to 00 000 001. */ |
312 | *cursor = 0x1; | 312 | *cursor = 0x1; |
313 | } else { | 313 | } else { |
314 | /* Use %rax (register #0) for the scratch register. */ | 314 | /* Use %rax (register #0) for the scratch register. */ |
315 | auprobe->def.fixups = UPROBE_FIX_RIP_AX; | 315 | auprobe->def.fixups |= UPROBE_FIX_RIP_AX; |
316 | /* Change modrm from 00 xxx 101 to 00 xxx 000 */ | 316 | /* Change modrm from 00 xxx 101 to 00 xxx 000 */ |
317 | *cursor = (reg << 3); | 317 | *cursor = (reg << 3); |
318 | } | 318 | } |