Skip to content

Commit 5a08bf7

Browse files
Maciej W. RozyckiZhengShunQian
authored andcommitted
MIPS: Correct the 64-bit DSP accumulator register size
commit f5958b4 upstream. Use the `unsigned long' rather than `__u32' type for DSP accumulator registers, like with the regular MIPS multiply/divide accumulator and general-purpose registers, as all are 64-bit in 64-bit implementations and using a 32-bit data type leads to contents truncation on context saving. Update `arch_ptrace' and `compat_arch_ptrace' accordingly, removing casts that are similarly not used with multiply/divide accumulator or general-purpose register accesses. Signed-off-by: Maciej W. Rozycki <[email protected]> Signed-off-by: Paul Burton <[email protected]> Fixes: e50c0a8 ("Support the MIPS32 / MIPS64 DSP ASE.") Patchwork: https://patchwork.linux-mips.org/patch/19329/ Cc: Alexander Viro <[email protected]> Cc: James Hogan <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] # 2.6.15+ Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent de33dde commit 5a08bf7

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

arch/mips/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ struct mips_fpu_struct {
137137

138138
#define NUM_DSP_REGS 6
139139

140-
typedef __u32 dspreg_t;
140+
typedef unsigned long dspreg_t;
141141

142142
struct mips_dsp_state {
143143
dspreg_t dspr[NUM_DSP_REGS];

arch/mips/kernel/ptrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ long arch_ptrace(struct task_struct *child, long request,
878878
goto out;
879879
}
880880
dregs = __get_dsp_regs(child);
881-
tmp = (unsigned long) (dregs[addr - DSP_BASE]);
881+
tmp = dregs[addr - DSP_BASE];
882882
break;
883883
}
884884
case DSP_CONTROL:

arch/mips/kernel/ptrace32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
140140
goto out;
141141
}
142142
dregs = __get_dsp_regs(child);
143-
tmp = (unsigned long) (dregs[addr - DSP_BASE]);
143+
tmp = dregs[addr - DSP_BASE];
144144
break;
145145
}
146146
case DSP_CONTROL:

0 commit comments

Comments
 (0)