Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1057765imm; Thu, 31 May 2018 14:30:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLB1NBTMa+ik+0clWt+yYDub/FMwCnuXYgZNRXN1IZK5mAZrUNtc7JTE0gzPx+bCJBSpCLj X-Received: by 2002:a17:902:5597:: with SMTP id g23-v6mr8305350pli.99.1527802243393; Thu, 31 May 2018 14:30:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527802243; cv=none; d=google.com; s=arc-20160816; b=WWHWdGqzvzT59m2hLgnku2bZIvRgm/bD+P2ZY6qc0ZI22W8EvTk6xjmv65e35fAiPi IK2uo50I2lkg1l/uBZMetJKuQSey9JTnqZlkjmIHXfzo2fIVs1j7QQ9gbrL+a7qhW3o3 gcSuAy4l1JMFvVJRudfGdrMI33vTrmNNnkfdw9zLxvGJa/ktR0mhlQxB1h9mMAIqvskB pjAzm1f2Py8FLI5NT1EmnnmoNBr3oY4gsFNbVvGByR5+5+PFUwuGViAIs655hxnQ884/ 1hqTJgV0GXoJ7ewT3hxx2OT8aNYhX3I5cY7zgCEsCsrO+E54/8gB0w7ze/MKM/8Oc4d4 CRRQ== 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:dkim-signature:arc-authentication-results; bh=dIRQcCC6Hyc/uF/Fdn3KnnVzJPiPs+TbINyIXTdoaYE=; b=f9htbw9YgVJUyx+wPZz000aWljgTAhMlVlahPjkkgZANuTzlVElNv4mtKdxWUqZrUu A6bpENNk/B14zxGltgSb/OY+dclh1lOh6gwN+742oC5DNxNuUFNmzjWQcV5vwBV0Gp9C vXYm7qHaxt0MYkxcW9mtTM+g7/WWMMgqlm1RmfhIYTmKNIBBU6qQLWQ/5sfiDXSpKZFK 9Rwckc3EvNNWOZlyqPjFXJUzxGwPfqKfXN1Cr0BdPLz4+MFpnYitI+q1RBvreMVlx+fa z0z0/QHMvHRoDZOveRBQqBo6nN9daOWypW0LQ2GdB/uyhauXhgAKe+Luc58or5rcYSH4 vSOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gcHBk3Ov; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l4-v6si38087913plb.213.2018.05.31.14.30.28; Thu, 31 May 2018 14:30:43 -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; dkim=pass header.i=@kernel.org header.s=default header.b=gcHBk3Ov; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751211AbeEaVaD (ORCPT + 99 others); Thu, 31 May 2018 17:30:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:39062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750934AbeEaVaC (ORCPT ); Thu, 31 May 2018 17:30:02 -0400 Received: from jamesdev (jahogan.plus.com [212.159.75.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A80B220890; Thu, 31 May 2018 21:30:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527802201; bh=Vy2nIzyMSNLPsCeLMsX7X225soO5TlUCIhqk16jg6yc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gcHBk3OvfuDbrB581sY2LS7gtyDb8fxa6F469Q41tqZxRVtP1v3diIuwZmxiexJwE kd3uBFvWd/+1qeCAp5dvSPtSO+aifNpHc2URE+ZX1FmPRj72eqisPrp0LKte/r5UIS Qfv3gFLVdjZtd1KAVrwHKbRf+rsBG5xQxIIYa6dU= Date: Thu, 31 May 2018 22:29:57 +0100 From: James Hogan To: "Maciej W. Rozycki" Cc: Ralf Baechle , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] MIPS: prctl: Disallow FRE without FR with PR_SET_FP_MODE requests Message-ID: <20180531212956.GA30406@jamesdev> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="u3/rZRmxL6MmkK24" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --u3/rZRmxL6MmkK24 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 15, 2018 at 11:04:44PM +0100, Maciej W. Rozycki wrote: > Having PR_FP_MODE_FRE (i.e. Config5.FRE) set without PR_FP_MODE_FR (i.e.= =20 > Status.FR) is not supported as the lone purpose of Config5.FRE is to=20 > emulate Status.FR=3D0 handling on FPU hardware that has Status.FR=3D1=20 > hardwired[1][2]. Also we do not handle this case elsewhere, and assume= =20 > throughout our code that TIF_HYBRID_FPREGS and TIF_32BIT_FPREGS cannot=20 > be set both at once for a task, leading to inconsistent behaviour if=20 > this does happen. >=20 > Return unsuccessfully then from prctl(2) PR_SET_FP_MODE calls requesting= =20 > PR_FP_MODE_FRE to be set with PR_FP_MODE_FR clear. This corresponds to= =20 > modes allowed by `mips_set_personality_fp'. >=20 > References: >=20 > [1] "MIPS Architecture For Programmers, Vol. III: MIPS32 / microMIPS32 > Privileged Resource Architecture", Imagination Technologies, > Document Number: MD00090, Revision 6.02, July 10, 2015, Table 9.69=20 > "Config5 Register Field Descriptions", p. 262 >=20 > [2] "MIPS Architecture For Programmers, Volume III: MIPS64 / microMIPS64= =20 > Privileged Resource Architecture", Imagination Technologies,=20 > Document Number: MD00091, Revision 6.03, December 22, 2015, Table=20 > 9.72 "Config5 Register Field Descriptions", p. 288 >=20 > Cc: stable@vger.kernel.org # 4.0+ > Fixes: 9791554b45a2 ("MIPS,prctl: add PR_[GS]ET_FP_MODE prctl options for= MIPS") > Signed-off-by: Maciej W. Rozycki Thanks, applied to mips-fixes, hopefully for 4.17 (but if it misses tomorrows linux-next it may have to wait 'til 4.18). Cheers James --u3/rZRmxL6MmkK24 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQS7lRNBWUYtqfDOVL41zuSGKxAj8gUCWxBpUwAKCRA1zuSGKxAj 8nD+AQDlX/YPX/WyufbGvOmzQO3ows5pmEBYDLTntCMjLwfQLAEA9ODc1Qt8srfM nrZ+PcIffTYPGEghVp1HHUcl1GHBqwU= =UY2D -----END PGP SIGNATURE----- --u3/rZRmxL6MmkK24--