Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2977204imu; Sun, 9 Dec 2018 14:07:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/V4gwi4UU497qPJ4zJEgro1PJ9IMasTwfgrop+KBKz/GSvNu5hJYNQPWVQhORAvHgdnzDhf X-Received: by 2002:a17:902:b707:: with SMTP id d7mr9401303pls.29.1544393265814; Sun, 09 Dec 2018 14:07:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544393265; cv=none; d=google.com; s=arc-20160816; b=YP8DvuRF5VHPgLzqSj89EWNboxB1LY0c6xtPVestJ3rxDglOo5vWJHpOX+eShxnQGB P0hoegirnU5HGEaSW/GJCdDnPshrKE3L1decI+34BV14540zZLSi+WVaP3vDudwLvAqm ZYH7eLL8ew/HUge2jFkxA3WKSvaBKgth25q4dwUaE1plxdoXaFc30j5JHTA2PD5giKsu +vXEtS4OA5vny9sGX4x3ISIN9IYTbQyaboUSDus/IK2oqARfBLkNatTvUizAWnD3zR4y Nkqp5Xq0/rcEBUr642zupycGg4OaNFk4eoqdc3F7e4bKbZcOJ0qgSZzk3kk8lVe8t8L8 XP5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=39mpN/Se/iNuxrLvjWhKvRsELwQ/qTdRgMGf75QYxe8=; b=NxiMF0Frs1dfs2KH0nLYit3cIUiw2BF4Jfos42I+G9g4EXKu9UGduiLiOh3Wd4VpsC BNd4ku0ZgaLXsz4lwc1VfRwwoIRI2G7j+w53rHXPnpiaBt9ucsqlrWKQrBJ7dLvuEIAL c8tHWG/5fXxyYOEeNet8BPPV+1GkvI55FOlnLfHoW4Bnl+WI0sKC2yRb2PNrekE7knh4 rlbiwLRu6M4AMBROTyatWyXFgLf2MVy4tQdUbQ1ASivvr4c1j7hAWuVjDNnVVx9+vzWJ ngZchYnYFnURRjoypJDJpHdAMkYwvlW5WMXQE5CGxeQDOXOpj6qM3BfsHTZ1UbJIrc9M wmJg== 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 b6si8382446pgg.2.2018.12.09.14.07.30; Sun, 09 Dec 2018 14:07:45 -0800 (PST) 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 S1727715AbeLIWGF (ORCPT + 99 others); Sun, 9 Dec 2018 17:06:05 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:37036 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727705AbeLIWGC (ORCPT ); Sun, 9 Dec 2018 17:06:02 -0500 Received: from pub.yeoldevic.com ([81.174.156.145] helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gW73O-0002im-HI; Sun, 09 Dec 2018 21:55:58 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gW72Z-0003Fn-Lu; Sun, 09 Dec 2018 21:55:07 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Maciej W. Rozycki" , "Paul Burton" , linux-fsdevel@vger.kernel.org, "Ralf Baechle" , "Alexander Viro" , linux-mips@linux-mips.org, "James Hogan" Date: Sun, 09 Dec 2018 21:50:33 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) X-Patchwork-Hint: ignore Subject: [PATCH 3.16 046/328] MIPS: Correct the 64-bit DSP accumulator register size In-Reply-To: X-SA-Exim-Connect-IP: 81.174.156.145 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.62-rc1 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 Signed-off-by: Ben Hutchings --- 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 @@ -143,7 +143,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 @@ -790,7 +790,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 @@ -140,7 +140,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: