Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1811889imm; Mon, 3 Sep 2018 10:04:02 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdapbo3LYhRgnJt1mzexOITpTLtQdmSa8JzO5aKkMmaxMlYs60H/HKMt/w1RWbVw3yK2x6G4 X-Received: by 2002:a17:902:b115:: with SMTP id q21-v6mr29772223plr.333.1535994242398; Mon, 03 Sep 2018 10:04:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535994242; cv=none; d=google.com; s=arc-20160816; b=S3xv6vJU45WZUQi5IlmeqwixQjuHH6PunLgAkxZegb52WmJhqKIF8lQ0EQfVBuOlsb w3vUhoVIcZusr8ISll4usv+ADqiVWDDWoi5g43NAtRrrgDVaSC+TvLTrKtXAskM/9OCM nnww/JH2sZPwLbOg+GVturVsWxmpCvHouiCFpET0GupIqCufXRLQrCKOLohZ7KIoQlbc 9u+azyYhWvmpOnJ4KkBn5rqU11bQzxzmzvwtbXTdV2TCqBBLx1nnPyZsLdvWAHAZtXIj cmx3PLZ+IOygbZ9W7I8hmMbabdpV14XjZlaJHBgHzlEykhVHOXFXIThjP/s6YXiYgwj3 E7qg== 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=rip+C6i9k/vsGdl56Ry3C8k55761CgQzqRQ+UCs2PRU=; b=AvAFmHPkFiYFE2Nom2/a5zyaVU2FBpBa7ftdZ+NRedv91LxOaI0tD5MMZfyJ5iUsJZ ALOVPxBZclJwrl45ArG+OcU79tkx+SP3dg1tp2zXEx4Y1/Ru0DXcEV4ZqeCabUGS7iWs PlmdkoA8Wa2OjVYbWtLI6Jp9FaNFxV6FxinfgczxQP5qWM1VC6dvj/CJFyRLlEnI+QY9 FsZkC7BsZ2sg271YBr6F6Yv7r+9nV/TxiW9I2e0h+G3UneRHq1C/qW8iu1sZqjbWXwEp 1cjjn6312BCof2aLWXR4oAIYPGpXNIg9HyWc7dAOQJIiCL285nqI7egXq9btFQ+ndGZ8 Cdow== 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 d68-v6si20702569pfj.311.2018.09.03.10.03.47; Mon, 03 Sep 2018 10:04:02 -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 S1728933AbeICVXV (ORCPT + 99 others); Mon, 3 Sep 2018 17:23:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:38910 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728133AbeICVXU (ORCPT ); Mon, 3 Sep 2018 17:23:20 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 60248CF5; Mon, 3 Sep 2018 17:02:20 +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.4 75/80] MIPS: Correct the 64-bit DSP accumulator register size Date: Mon, 3 Sep 2018 18:49:53 +0200 Message-Id: <20180903164937.137372311@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903164934.171677301@linuxfoundation.org> References: <20180903164934.171677301@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.4-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 @@ -131,7 +131,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 @@ -879,7 +879,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: