Re: [PATCH 2/3] uprobes/x86: Kill the "autask" arg of riprel_pre_xol()

2014-04-30 Thread Jim Keniston
On Mon, 2014-04-28 at 12:05 +0530, Srikar Dronamraju wrote:
> * Oleg Nesterov  [2014-04-27 18:52:27]:
> 
> > default_pre_xol_op() passes >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 
> 
> Acked-by: Srikar Dronamraju 
> 
Reviewed-by: Jim Keniston 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] uprobes/x86: Kill the autask arg of riprel_pre_xol()

2014-04-30 Thread Jim Keniston
On Mon, 2014-04-28 at 12:05 +0530, Srikar Dronamraju wrote:
 * Oleg Nesterov o...@redhat.com [2014-04-27 18:52:27]:
 
  default_pre_xol_op() passes current-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 o...@redhat.com
 
 Acked-by: Srikar Dronamraju sri...@linux.vnet.ibm.com
 
Reviewed-by: Jim Keniston jkeni...@us.ibm.com

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] uprobes/x86: Kill the "autask" arg of riprel_pre_xol()

2014-04-28 Thread Srikar Dronamraju
* Oleg Nesterov  [2014-04-27 18:52:27]:

> default_pre_xol_op() passes >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 

Acked-by: Srikar Dronamraju 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] uprobes/x86: Kill the autask arg of riprel_pre_xol()

2014-04-28 Thread Srikar Dronamraju
* Oleg Nesterov o...@redhat.com [2014-04-27 18:52:27]:

 default_pre_xol_op() passes current-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 o...@redhat.com

Acked-by: Srikar Dronamraju sri...@linux.vnet.ibm.com

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] uprobes/x86: Kill the "autask" arg of riprel_pre_xol()

2014-04-27 Thread Oleg Nesterov
default_pre_xol_op() passes >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 
---
 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 a647808..9f6aba3 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)
  * If we're emulating a rip-relative instruction, save the contents
  * of the scratch register and store the target address in that register.
  */
-static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs,
-   struct arch_uprobe_task *autask)
+static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
 {
+   struct uprobe_task *utask = current->utask;
+
if (auprobe->def.fixups & UPROBE_FIX_RIP_AX) {
-   autask->saved_scratch_register = regs->ax;
-   regs->ax = current->utask->vaddr;
+   utask->autask.saved_scratch_register = regs->ax;
+   regs->ax = utask->vaddr;
regs->ax += auprobe->def.riprel_target;
} else if (auprobe->def.fixups & UPROBE_FIX_RIP_CX) {
-   autask->saved_scratch_register = regs->cx;
-   regs->cx = current->utask->vaddr;
+   utask->autask.saved_scratch_register = regs->cx;
+   regs->cx = utask->vaddr;
regs->cx += auprobe->def.riprel_target;
}
 }
@@ -377,8 +378,7 @@ static inline bool is_64bit_mm(struct mm_struct *mm)
 static void riprel_analyze(struct arch_uprobe *auprobe, struct insn *insn)
 {
 }
-static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs,
-   struct arch_uprobe_task *autask)
+static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
 {
 }
 static void riprel_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs,
@@ -401,7 +401,7 @@ static inline int sizeof_long(void)
 
 static int default_pre_xol_op(struct arch_uprobe *auprobe, struct pt_regs 
*regs)
 {
-   riprel_pre_xol(auprobe, regs, >utask->autask);
+   riprel_pre_xol(auprobe, regs);
return 0;
 }
 
-- 
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] uprobes/x86: Kill the autask arg of riprel_pre_xol()

2014-04-27 Thread Oleg Nesterov
default_pre_xol_op() passes current-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 o...@redhat.com
---
 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 a647808..9f6aba3 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)
  * If we're emulating a rip-relative instruction, save the contents
  * of the scratch register and store the target address in that register.
  */
-static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs,
-   struct arch_uprobe_task *autask)
+static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
 {
+   struct uprobe_task *utask = current-utask;
+
if (auprobe-def.fixups  UPROBE_FIX_RIP_AX) {
-   autask-saved_scratch_register = regs-ax;
-   regs-ax = current-utask-vaddr;
+   utask-autask.saved_scratch_register = regs-ax;
+   regs-ax = utask-vaddr;
regs-ax += auprobe-def.riprel_target;
} else if (auprobe-def.fixups  UPROBE_FIX_RIP_CX) {
-   autask-saved_scratch_register = regs-cx;
-   regs-cx = current-utask-vaddr;
+   utask-autask.saved_scratch_register = regs-cx;
+   regs-cx = utask-vaddr;
regs-cx += auprobe-def.riprel_target;
}
 }
@@ -377,8 +378,7 @@ static inline bool is_64bit_mm(struct mm_struct *mm)
 static void riprel_analyze(struct arch_uprobe *auprobe, struct insn *insn)
 {
 }
-static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs,
-   struct arch_uprobe_task *autask)
+static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs)
 {
 }
 static void riprel_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs,
@@ -401,7 +401,7 @@ static inline int sizeof_long(void)
 
 static int default_pre_xol_op(struct arch_uprobe *auprobe, struct pt_regs 
*regs)
 {
-   riprel_pre_xol(auprobe, regs, current-utask-autask);
+   riprel_pre_xol(auprobe, regs);
return 0;
 }
 
-- 
1.5.5.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/