Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6462254rdb; Tue, 2 Jan 2024 02:48:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IFwKA7bzloBM9LfpsdZiY0B90HS0qmr9qipP2JjAzELZ902BSawK6XqscyTLYZ69PoH2C+r X-Received: by 2002:a05:620a:5604:b0:781:310a:7038 with SMTP id vu4-20020a05620a560400b00781310a7038mr22054992qkn.1.1704192533972; Tue, 02 Jan 2024 02:48:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704192533; cv=none; d=google.com; s=arc-20160816; b=emuEvanMP9WN67P7nz5zjIx9x3dhmfTZBMgvIRnvj9bqxIBf1qlturzs+7Swx11ZtT lPT1Xuxy8wTsA+kfZ3PzTU3VxF+2wYVA1FKW6d7ok2aP4pujsNIUsAnHL1sdfPT2VlSi mXPz8HplFOW0GuEkcPj59pnbaal7GJT7cDiWC0F/PJUgq9VGTpWCUy2kqT4Rkjp0Fzoq YvlYoPpbKhYUUsR3Q06qci8m2BKkU/T134agTbqDnSSAzLFokj8b9SaAUv2pw3tfMrtG AMkxa5guqBhbRKrlfXFXOubcuL+5v65P6RqRbsCix8FIQSnsnYT2dMlB47ak0WFDWuCO MdPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:autocrypt:references :in-reply-to:date:cc:to:from:subject:message-id:dkim-signature; bh=jWfzfehELThdRAGFyiCQ4jZ5y33meHmztApDMp34eWY=; fh=zraoK2dFyzON63foC2aJeaIK++CmGJLv8D2ML48vot8=; b=uAEEBUtq9R6/Jj74ghfvXqsDZqdh9BztZidN+2+wS2lySiBQY1d7PYtqHcagTAk/Gy iHD0STAwOk7X/OKoe9pbSSKkoF+AbHDlCT7aXK3Khl7Bc+mWWNtunv20HUzdU6bBSR4U 36HurcufzGESTcz8rpP33IuWh24FX3a0O97Dwyb5mZK8Kz+KPyXzniVlPtbggG0xWPJW c/1ro9yGmzZFTc9zR4k2AhHidpWBQK7cAG9BSYwNCrG4nwyA1OCrqeBlunJVDgfczHQO +JWSRH1kpRazsnvNCb8dWlU/WgoTVwLL/31ZMQOnLj2RpsYoRJC/iTTalppU05Vz6KYm G6ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=M7imy2eY; spf=pass (google.com: domain of linux-kernel+bounces-14264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 2-20020a05620a048200b00781575a8695si14845167qkr.667.2024.01.02.02.48.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 02:48:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=M7imy2eY; spf=pass (google.com: domain of linux-kernel+bounces-14264-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B4D5F1C21DD7 for ; Tue, 2 Jan 2024 10:48:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 11F68DDB5; Tue, 2 Jan 2024 10:48:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b="M7imy2eY" X-Original-To: linux-kernel@vger.kernel.org Received: from xry111.site (xry111.site [89.208.246.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25376D528; Tue, 2 Jan 2024 10:48:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1704192519; bh=f4OQ1ZNLcLTkfVKTa0KnB7uTCXzUZK0q6WupCf7F0ss=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=M7imy2eYubvLYstc4XOHXKYbzCNqXLJgUjS8XUXUbWgOvKfdWTgDVMs55JXev+E4U h490habAEDFwY/jQ2BDBytStmmUV3Ehbfz8RsdLQDJC3F7yMfp/+N2nU+2xMrqxBEE Ps7kPH0aSrl6I++ekZEHhcFxzIzNnMQyqwL7K8LM= Received: from [IPv6:240e:358:11a9:2200:dc73:854d:832e:3] (unknown [IPv6:240e:358:11a9:2200:dc73:854d:832e:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 07F2766F45; Tue, 2 Jan 2024 05:48:31 -0500 (EST) Message-ID: <7a6aa1bbdbbe2e63ae96ff163fab0349f58f1b9e.camel@xry111.site> Subject: MIPS: fcsr31 may be dirty after execve when kernel preempt is enabled (was: Re: [PATCH v2] LoongArch: Fix and simplify fcsr initialization on execve) From: Xi Ruoyao To: Huacai Chen , WANG Xuerui , Jiaxun Yang Cc: Eric Biederman , Kees Cook , Tiezhu Yang , Jinyang He , loongarch@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, linux-mips@vger.kernel.org Date: Tue, 02 Jan 2024 18:48:27 +0800 In-Reply-To: References: <20240102101711.10872-2-xry111@xry111.site> Autocrypt: addr=xry111@xry111.site; prefer-encrypt=mutual; keydata=mDMEYnkdPhYJKwYBBAHaRw8BAQdAsY+HvJs3EVKpwIu2gN89cQT/pnrbQtlvd6Yfq7egugi0HlhpIFJ1b3lhbyA8eHJ5MTExQHhyeTExMS5zaXRlPoiTBBMWCgA7FiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwMFCwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQrKrSDhnnEOPHFgD8D9vUToTd1MF5bng9uPJq5y3DfpcxDp+LD3joA3U2TmwA/jZtN9xLH7CGDHeClKZK/ZYELotWfJsqRcthOIGjsdAPuDgEYnkdPhIKKwYBBAGXVQEFAQEHQG+HnNiPZseiBkzYBHwq/nN638o0NPwgYwH70wlKMZhRAwEIB4h4BBgWCgAgFiEEkdD1djAfkk197dzorKrSDhnnEOMFAmJ5HT4CGwwACgkQrKrSDhnnEOPjXgD/euD64cxwqDIqckUaisT3VCst11RcnO5iRHm6meNIwj0BALLmWplyi7beKrOlqKfuZtCLbiAPywGfCNg8LOTt4iMD Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.50.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Tue, 2024-01-02 at 18:25 +0800, Xi Ruoyao wrote: > On Tue, 2024-01-02 at 18:17 +0800, Xi Ruoyao wrote: > > The only other architecture setting FCSR in SET_PERSONALITY2 is MIPS. > > They do this for supporting different FP flavors (NaN encodings etc). > > which do not exist on LoongArch.=C2=A0 I'm not sure how MIPS evades the= issue > > (or maybe it's just buggy too) but I'll investigate it later. >=20 > Phew.=C2=A0 I just managed to recommission my 3A4000 and I can reproduce = the > issue as well with Linux 5.18.1 (the latest kernel release when I > decommissioned it) and CONFIG_PREEMPT=3Dy. >=20 > % cat measure.c > #include > int main() { return fetestexcept(FE_INEXACT); } >=20 > % echo $((1./3)) > 0.33333333333333331 >=20 > % while ./a.out; do ; done > (stopped in seconds) >=20 > I'm building the mainline kernel on the 3A4000 now, will see if the > issue still exists... Still happening with 6.7.0-rc8. I'm not sure how to fix it for MIPS.=20 Maybe lose_fpu in SET_PERSONALITY2? But to me doing so will be really nasty. Anyway I'll leave this for MIPS maintainers. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University