Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758095AbcJ1HUV (ORCPT ); Fri, 28 Oct 2016 03:20:21 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:59670 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756035AbcJ1HUU (ORCPT ); Fri, 28 Oct 2016 03:20:20 -0400 Date: Fri, 28 Oct 2016 08:20:09 +0100 From: "Maciej W. Rozycki" To: Ralf Baechle CC: Paul Burton , James Hogan , , Subject: [PATCH 1/2] MIPS: ptrace: Also initialize the FP context on individual FCSR writes In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [10.20.78.229] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1202 Lines: 32 Complement commit ac9ad83bc318 ("MIPS: prevent FP context set via ptrace being discarded") and also initialize the FP context whenever FCSR alone is written with a PTRACE_POKEUSR request addressing FPC_CSR, rather than along with the full FPU register set in the case of the PTRACE_SETFPREGS request. Signed-off-by: Maciej W. Rozycki --- Hi, This is tricky to verify with modern user software as these days it all uses PTRACE_SETFPREGS. I suppose I could tweak and rebuild `gdbserver' to disable modern code and let it use fallback legacy support still present there, but frankly I think the change is obviously correct. Please apply. Maciej linux-mips-ptrace-fcsr-init-fp-ctx.diff Index: linux-sfr-test/arch/mips/kernel/ptrace.c =================================================================== --- linux-sfr-test.orig/arch/mips/kernel/ptrace.c 2016-10-22 01:29:44.000000000 +0100 +++ linux-sfr-test/arch/mips/kernel/ptrace.c 2016-10-22 01:44:38.740202000 +0100 @@ -817,6 +818,7 @@ long arch_ptrace(struct task_struct *chi break; #endif case FPC_CSR: + init_fp_ctx(child); ptrace_setfcr31(child, data); break; case DSP_BASE ... DSP_BASE + 5: {