Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1828028imm; Mon, 3 Sep 2018 10:28:36 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbSIR0Ev3WeOEN9dRShYSScsML/b4U62H/p4p/Uoxcez3HN1/COLqowWbDeKFTZo/VxECHq X-Received: by 2002:a63:9712:: with SMTP id n18-v6mr26545698pge.92.1535995716623; Mon, 03 Sep 2018 10:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995716; cv=none; d=google.com; s=arc-20160816; b=VlOAYodoxt8SNpU245Gpru+pzaKjuEM3jF2IVZJwrscv4Pux4+P3oENzN/KbnxOCCg xhCvrKhlMnrckUdxm7Jhm0z9ZIltEq759BR0aVGCbHFDUH+hqaxBTxgEuHfHhynWxFcg DjnqYyGlFYMzC5xML6I9En5hMhJX6OBzhCwNsCCMvoLE/cEKHHBRdUXDD37Sp2Vct7sb nZEnr3fYSCD0xiEbrqlyxrYHKG9VcB/Un/OMlv5l36/qJ0n3DFl9SrhPmnY2OKUQ5f0o VikFaW5z9pKtobZcnh3efFMiUaTXtCPiJwDq8qOK2NMk0QueFSQ9Oyrk9N+lnr3SiZoS jerA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Kh54xsH+t63zzxsWnHrNSxZ+eHu7PGkME9A4yB+9ny8=; b=Ep7XecsrYcBxsb10zuSYXe3sOG6RyiaRBD4ndrY0JUWw3Q3ZZ3P7FwDO7FgT+91Zs6 ytiAAL/9F0JHdDuSyE2yy4RqLif0nm7LV24qBNQD5yWW0Xb7NOlifsETBrgY1vyLr6oZ iXUKT4Gnc8gigM133Eq+82EmEzKy8+K4ehHNkEMjJ7xvpNz2ULMxHX6lgAQKnNvnqGjD H7fZ1KGzQu/MF2b2aER+IN4iaQcV5G9O8sz3KG1/f8WFWGQU0dpK8cMOJpmP+3+wf8fg K9YVpL4tjR0Yvb7Pq7gsI/w5uvDVHlbb8ACoj54oOJ7z3VqfcGN8RD4G10trTuGZkKal BsPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u6-v6si18738837pfu.143.2018.09.03.10.28.21; Mon, 03 Sep 2018 10:28:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731008AbeICVs0 (ORCPT + 99 others); Mon, 3 Sep 2018 17:48:26 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46238 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730180AbeICVs0 (ORCPT ); Mon, 3 Sep 2018 17:48:26 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2402BD09; Mon, 3 Sep 2018 17:27:17 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Maciej W. Rozycki" , Paul Burton , Alexander Viro , James Hogan , Ralf Baechle , linux-fsdevel@vger.kernel.org, linux-mips@linux-mips.org Subject: [PATCH 4.14 149/165] MIPS: Correct the 64-bit DSP accumulator register size Date: Mon, 3 Sep 2018 18:57:15 +0200 Message-Id: <20180903165704.558076450@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Maciej W. Rozycki commit f5958b4cf4fc38ed4583ab83fb7c4cd1ab05f47b 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 Signed-off-by: Paul Burton Fixes: e50c0a8fa60d ("Support the MIPS32 / MIPS64 DSP ASE.") Patchwork: https://patchwork.linux-mips.org/patch/19329/ Cc: Alexander Viro Cc: James Hogan Cc: Ralf Baechle 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+ Signed-off-by: Greg Kroah-Hartman --- arch/mips/include/asm/processor.h | 2 +- arch/mips/kernel/ptrace.c | 2 +- arch/mips/kernel/ptrace32.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) --- a/arch/mips/include/asm/processor.h +++ b/arch/mips/include/asm/processor.h @@ -141,7 +141,7 @@ struct mips_fpu_struct { #define NUM_DSP_REGS 6 -typedef __u32 dspreg_t; +typedef unsigned long dspreg_t; struct mips_dsp_state { dspreg_t dspr[NUM_DSP_REGS]; --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -847,7 +847,7 @@ long arch_ptrace(struct task_struct *chi goto out; } dregs = __get_dsp_regs(child); - tmp = (unsigned long) (dregs[addr - DSP_BASE]); + tmp = dregs[addr - DSP_BASE]; break; } case DSP_CONTROL: --- a/arch/mips/kernel/ptrace32.c +++ b/arch/mips/kernel/ptrace32.c @@ -141,7 +141,7 @@ long compat_arch_ptrace(struct task_stru goto out; } dregs = __get_dsp_regs(child); - tmp = (unsigned long) (dregs[addr - DSP_BASE]); + tmp = dregs[addr - DSP_BASE]; break; } case DSP_CONTROL: