Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2940984imm; Thu, 24 May 2018 19:31:45 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrcHVHVTAQWcAd+JvwAR1yxWXsShrwDbF3CyUfliBVFXzuYVHihelkv+yd5lunsN69BWmhJ X-Received: by 2002:a62:9056:: with SMTP id a83-v6mr570465pfe.186.1527215505329; Thu, 24 May 2018 19:31:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527215505; cv=none; d=google.com; s=arc-20160816; b=01Bht9B8CH5XvgI/czITV8Mkm0zFDjDUt0NIbIkJF3DaBrzRgSyFvnS0zRe/06yMBh RgO3pJzAbPVynnmVr0ffzbv8cUeGLus6ASVm50/UDTjYuN7dYo2g3+AWudMcPCoemxeL P3puAgHEEVksdVRngqXHXQWYk17Vro5JhxFfoUORPBR4RupXA2HTCHlBNFt0UF4MSP2w 1Hj2iT4VUVDfzKKPYPpMjz4adTE1YIWcjvolh6OkUpIbY6pFp9bpe86hFli5cu4HmsBn Cx1tQ0S7rKG+RWMsF4WJzxZ/HnRwHlJKK/LhLiBqtKxE6finlqVygMymvraBYLZM9+/C RGwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=uiLNLv5OVF4cA6F6Da4DhoDJr8GgMZ5UyA8EV1CKgyk=; b=uC/TQ+XzJuHafCoqTJo8wtYAQHp3146jj6PPFhEuWkz/4CY4maGPNspumPLDXlm6xf zngQr7VY7GFfVgYAbR2ck0AUqAKf9CLz3o3ukh/OACOl/9F2YHRjKzONL1Q86t31DcQh tQ8WOO4zPC5JQER3e5XdCHVc8vccJhdXqgu0WNPjUKsRRqINvpsS4NvuKYnpu+6sAFtO Hrcfx4wBSDwgOyDqI9YNokXo6N/pEmjxXNyI/QqhcR/yaXKz6zf2m+zwWKMkkIMfGbp+ 4Ml0EP3vEDP2EJ0AzTicSARk1AikXnje91RXStbRNlf8/AmjoCyM6qaDsEhikvgthtMR WrwQ== 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 b7-v6si22872774pfl.223.2018.05.24.19.31.30; Thu, 24 May 2018 19:31:45 -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 S1031185AbeEXRCU (ORCPT + 99 others); Thu, 24 May 2018 13:02:20 -0400 Received: from 9pmail.ess.barracuda.com ([64.235.154.211]:43200 "EHLO 9pmail.ess.barracuda.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030542AbeEXRCR (ORCPT ); Thu, 24 May 2018 13:02:17 -0400 Received: from mipsdag02.mipstec.com (mail2.mips.com [12.201.5.32]) by mx1403.ess.rzc.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Thu, 24 May 2018 17:02:09 +0000 Received: from mipsdag02.mipstec.com (10.20.40.47) by mipsdag02.mipstec.com (10.20.40.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Thu, 24 May 2018 10:02:12 -0700 Received: from localhost (10.20.2.29) by mipsdag02.mipstec.com (10.20.40.47) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 24 May 2018 10:02:12 -0700 Date: Thu, 24 May 2018 10:02:08 -0700 From: Paul Burton To: "Maciej W. Rozycki" , James Hogan , Ralf Baechle CC: , , Subject: Re: [PATCH] MIPS: ptrace: Fix PTRACE_PEEKUSR requests for 64-bit FGRs Message-ID: <20180524170208.735ptogcn2uo4izl@pburton-laptop> References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180512 X-BESS-ID: 1527181329-321459-8161-12345-1 X-BESS-VER: 2018.6-r1805181819 X-BESS-Apparent-Source-IP: 12.201.5.32 X-BESS-Outbound-Spam-Score: 0.01 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.193318 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.01 BSF_SC0_SA_TO_FROM_DOMAIN_MATCH META: Sender Domain Matches Recipient Domain 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.01 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_SC0_SA_TO_FROM_DOMAIN_MATCH, BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maciej, On Wed, May 16, 2018 at 04:39:58PM +0100, Maciej W. Rozycki wrote: > Use 64-bit accesses for 64-bit floating-point general registers with > PTRACE_PEEKUSR, removing the truncation of their upper halves in the > FR=1 mode, caused by commit bbd426f542cb ("MIPS: Simplify FP context > access"), which inadvertently switched them to using 32-bit accesses. Good catch: Reviewed-by: Paul Burton Thanks, Paul > The PTRACE_POKEUSR side is fine as it's never been broken and continues > using 64-bit accesses. > > Cc: # 3.19+ > Fixes: bbd426f542cb ("MIPS: Simplify FP context access") > Signed-off-by: Maciej W. Rozycki > --- > Hi, > > Here's another one, spotted in the course of GDB PR gdb/22286 regression > testing with the n64 ABI. Please apply. > > Maciej > --- > arch/mips/kernel/ptrace.c | 2 +- > arch/mips/kernel/ptrace32.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > linux-mips-ptrace-peekusr-fp64.diff > Index: linux/arch/mips/kernel/ptrace.c > =================================================================== > --- linux.orig/arch/mips/kernel/ptrace.c 2018-05-15 17:44:25.000000000 +0100 > +++ linux/arch/mips/kernel/ptrace.c 2018-05-16 11:22:00.714605000 +0100 > @@ -1070,7 +1070,7 @@ long arch_ptrace(struct task_struct *chi > break; > } > #endif > - tmp = get_fpr32(&fregs[addr - FPR_BASE], 0); > + tmp = get_fpr64(&fregs[addr - FPR_BASE], 0); > break; > case PC: > tmp = regs->cp0_epc; > Index: linux/arch/mips/kernel/ptrace32.c > =================================================================== > --- linux.orig/arch/mips/kernel/ptrace32.c 2018-05-15 17:45:16.000000000 +0100 > +++ linux/arch/mips/kernel/ptrace32.c 2018-05-16 11:22:16.313698000 +0100 > @@ -109,7 +109,7 @@ long compat_arch_ptrace(struct task_stru > addr & 1); > break; > } > - tmp = get_fpr32(&fregs[addr - FPR_BASE], 0); > + tmp = get_fpr64(&fregs[addr - FPR_BASE], 0); > break; > case PC: > tmp = regs->cp0_epc; >