Skip to content

Commit f5958b4

Browse files
Maciej W. Rozyckipaulburton
authored andcommitted
MIPS: Correct the 64-bit DSP accumulator register size
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 <macro@mips.com> Signed-off-by: Paul Burton <paul.burton@mips.com> Fixes: e50c0a8 ("Support the MIPS32 / MIPS64 DSP ASE.") Patchwork: https://patchwork.linux-mips.org/patch/19329/ Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: James Hogan <jhogan@kernel.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-fsdevel@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org # 2.6.15+
1 parent 2f819db commit f5958b4

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎arch/mips/include/asm/processor.h‎

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

142142
#define NUM_DSP_REGS 6
143143

144-
typedef __u32 dspreg_t;
144+
typedef unsigned long dspreg_t;
145145

146146
struct mips_dsp_state {
147147
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
@@ -856,7 +856,7 @@ long arch_ptrace(struct task_struct *child, long request,
856856
goto out;
857857
}
858858
dregs = __get_dsp_regs(child);
859-
tmp = (unsigned long) (dregs[addr - DSP_BASE]);
859+
tmp = dregs[addr - DSP_BASE];
860860
break;
861861
}
862862
case DSP_CONTROL:

‎arch/mips/kernel/ptrace32.c‎

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

0 commit comments

Comments
 (0)