diff options
author | Oleg Nesterov <oleg@redhat.com> | 2014-04-27 11:00:46 -0400 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2014-04-30 13:10:41 -0400 |
commit | 7f55e82bacaaa2c41b8e14d6bc78129b096b67b8 (patch) | |
tree | 7166cb95297d80d36637af6a6a6470baaadca6a0 /arch/x86 | |
parent | 1475ee7fadafc6d0c194f2f4cbdae10ed04b9580 (diff) |
uprobes/x86: Kill the "autask" arg of riprel_pre_xol()
default_pre_xol_op() passes ¤t->utask->autask to riprel_pre_xol()
and this is just ugly because it still needs to load current->utask to
read ->vaddr.
Remove this argument, change riprel_pre_xol() to use current->utask.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/uprobes.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index 187be0e15e1d..5df1bca7c2bc 100644 --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c | |||
@@ -330,16 +330,17 @@ static void riprel_analyze(struct arch_uprobe *auprobe, struct insn *insn) | |||
330 | * If we're emulating a rip-relative instruction, save the contents | 330 | * If we're emulating a rip-relative instruction, save the contents |
331 | * of the scratch register and store the target address in that register. | 331 | * of the scratch register and store the target address in that register. |
332 | */ | 332 | */ |
333 | static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs, | 333 | static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) |
334 | struct arch_uprobe_task *autask) | ||
335 | { | 334 | { |
335 | struct uprobe_task *utask = current->utask; | ||
336 | |||
336 | if (auprobe->def.fixups & UPROBE_FIX_RIP_AX) { | 337 | if (auprobe->def.fixups & UPROBE_FIX_RIP_AX) { |
337 | autask->saved_scratch_register = regs->ax; | 338 | utask->autask.saved_scratch_register = regs->ax; |
338 | regs->ax = current->utask->vaddr; | 339 | regs->ax = utask->vaddr; |
339 | regs->ax += auprobe->def.riprel_target; | 340 | regs->ax += auprobe->def.riprel_target; |
340 | } else if (auprobe->def.fixups & UPROBE_FIX_RIP_CX) { | 341 | } else if (auprobe->def.fixups & UPROBE_FIX_RIP_CX) { |
341 | autask->saved_scratch_register = regs->cx; | 342 | utask->autask.saved_scratch_register = regs->cx; |
342 | regs->cx = current->utask->vaddr; | 343 | regs->cx = utask->vaddr; |
343 | regs->cx += auprobe->def.riprel_target; | 344 | regs->cx += auprobe->def.riprel_target; |
344 | } | 345 | } |
345 | } | 346 | } |
@@ -377,8 +378,7 @@ static inline bool is_64bit_mm(struct mm_struct *mm) | |||
377 | static void riprel_analyze(struct arch_uprobe *auprobe, struct insn *insn) | 378 | static void riprel_analyze(struct arch_uprobe *auprobe, struct insn *insn) |
378 | { | 379 | { |
379 | } | 380 | } |
380 | static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs, | 381 | static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) |
381 | struct arch_uprobe_task *autask) | ||
382 | { | 382 | { |
383 | } | 383 | } |
384 | static void riprel_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs, | 384 | static void riprel_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs, |
@@ -401,7 +401,7 @@ static inline int sizeof_long(void) | |||
401 | 401 | ||
402 | static int default_pre_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs) | 402 | static int default_pre_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs) |
403 | { | 403 | { |
404 | riprel_pre_xol(auprobe, regs, ¤t->utask->autask); | 404 | riprel_pre_xol(auprobe, regs); |
405 | return 0; | 405 | return 0; |
406 | } | 406 | } |
407 | 407 | ||