Skip to content

Commit c7e8146

Browse files
Maciej W. Rozyckiamalon
authored andcommitted
MIPS: ptrace: Fix PTRACE_PEEKUSR requests for 64-bit FGRs
Use 64-bit accesses for 64-bit floating-point general registers with PTRACE_PEEKUSR, removing the truncation of their upper halves in the FR=1 mode, caused by commit bbd426f ("MIPS: Simplify FP context access"), which inadvertently switched them to using 32-bit accesses. The PTRACE_POKEUSR side is fine as it's never been broken and continues using 64-bit accesses. Fixes: bbd426f ("MIPS: Simplify FP context access") Signed-off-by: Maciej W. Rozycki <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Cc: <[email protected]> # 3.15+ Patchwork: https://patchwork.linux-mips.org/patch/19334/ Signed-off-by: James Hogan <[email protected]>
1 parent 28e4213 commit c7e8146

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/mips/kernel/ptrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ long arch_ptrace(struct task_struct *child, long request,
818818
break;
819819
}
820820
#endif
821-
tmp = get_fpr32(&fregs[addr - FPR_BASE], 0);
821+
tmp = get_fpr64(&fregs[addr - FPR_BASE], 0);
822822
break;
823823
case PC:
824824
tmp = regs->cp0_epc;

arch/mips/kernel/ptrace32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
109109
addr & 1);
110110
break;
111111
}
112-
tmp = get_fpr32(&fregs[addr - FPR_BASE], 0);
112+
tmp = get_fpr64(&fregs[addr - FPR_BASE], 0);
113113
break;
114114
case PC:
115115
tmp = regs->cp0_epc;

0 commit comments

Comments
 (0)