Skip to contentSkip to conversation

MIPS: Fix syscall tracing interface

PATCH In review Lars Persson 2 participants 2 messages Mar 17, 2014 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 MIPS: Fix syscall tracing interface

Fix pointer computation for stack-based arguments.

---
 arch/mips/include/asm/syscall.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/include/asm/syscall.h +2 -2
index c71e40a..6c488c8 100644
@@ -51,14 +51,14 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
 
 #ifdef CONFIG_32BIT
 	case 4: case 5: case 6: case 7:
-		return get_user(*arg, (int *)usp + 4 * n);
+		return get_user(*arg, (int *)usp + n);
 #endif
 
 #ifdef CONFIG_64BIT
 	case 4: case 5: case 6: case 7:
 #ifdef CONFIG_MIPS32_O32
 		if (test_thread_flag(TIF_32BIT_REGS))
-			return get_user(*arg, (int *)usp + 4 * n);
+			return get_user(*arg, (int *)usp + n);
 		else
 #endif
 			*arg = regs->regs[4 + n];
Signature · 1 line
1.7.2.5
Reviewed-by on v2 1/1
#1 lore raw

Hi Lars,

Quoted 19 lines · Lars Persson

Fix pointer computation for stack-based arguments.

---
  arch/mips/include/asm/syscall.h |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/include/asm/syscall.h +1 -1
index c71e40a..6c488c8 100644
@@ -51,14 +51,14 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
 
  #ifdef CONFIG_32BIT
  	case 4: case 5: case 6: case 7:
-		return get_user(*arg, (int *)usp + 4 * n);
+		return get_user(*arg, (int *)usp + n);
  #endif

arch/mips/include/asm/syscall.h static inline unsigned long mips_get_syscall_arg(unsigned long *arg, · line 64

Quoted 10 lines
arch/mips/include/asm/syscall.h +1 -1
 
  #ifdef CONFIG_64BIT
  	case 4: case 5: case 6: case 7:
  #ifdef CONFIG_MIPS32_O32
  		if (test_thread_flag(TIF_32BIT_REGS))
-			return get_user(*arg, (int *)usp + 4 * n);
+			return get_user(*arg, (int *)usp + n);
  		else
  #endif
  			*arg = regs->regs[4 + n];

Thanks for the v2.

It looks good to me but I haven't tested it.

Signature · 1 line
markos