Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6475545rdb; Tue, 2 Jan 2024 03:21:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2Jn8hLaNp/4ktc5ORqC7+2B/LbSQ34mTg7wbR47ON2oXiR24LrEfO1E3goYwfNPJhe3Ji X-Received: by 2002:a17:906:ad7:b0:a27:df08:b457 with SMTP id z23-20020a1709060ad700b00a27df08b457mr1844161ejf.54.1704194479200; Tue, 02 Jan 2024 03:21:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704194479; cv=none; d=google.com; s=arc-20160816; b=olBzcXehhEoubehhPz5eyVhouB8gfjJfjIJafQr3zvDV/WGBwXN8CJ7+0hPCGlVP0L XfT1a3i6/n2pyi07w+uCfbDD+8VH+5SC5UNe7RnqdCX61jV6TXXA8g1lbOVq22gauE+4 +RbbZrwaM7gLK5OXfal3Gl8pkMeNEGxflTaUJpF8Gs06bDDBS/FVz98xxZd4mMa/K9Ut cKmmEytO8+lWanlZTkHpTLNgn7AFMgp/7Sw2PPFXyoSo7gcUaZMYirMNEzfzQpZ4deuH hXvO9cNfoosTv8tpnTvnlyYb6rNxJJX3XjPYdi+rmbCkgOguEONj1xdd4i/IHpdAer1s PVNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=zF8aYmP0JMP89Tv3L+qSOWQ7L3gB+hOl3zIY/xBCyd4=; fh=xmYcIU2jPXTOEwG3+xKW1KEKjc/ql1UMXZyn/rspezo=; b=RIDlgsH7O0Ite/rtVYCDu7tCCYIiKw6tNeJxJ9mqcxyEvGZDVQyZPphHw0g6u4RmDI 1i6+IPrFUQpCZvarG7ArA3+ywVhkDet0tQJh3WWRRdrknd9qmjcEzfpZDcV8nMfKZZYt hRZ/iRsaTba1EMZ9i6k0qaf00UpWmvdgag6gdo+Oy00Rvqk12idXJKpEy7JrGtFa6cab o9F3wzn+BKEPap4nUBtubfbtO4o6Y9bDPSMNsTlYO0XEuIYoJSwDixkdW5DgQYKVgGtg WrhIsb79sfWS8tDehjwEw/qTYOJI0euGohoJNRgTT6E28XkWg3W13baOrrEnyGjdNKix x6jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GeDzh8jA; spf=pass (google.com: domain of linux-kernel+bounces-14283-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14283-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id wj20-20020a170907051400b00a26e650f890si6752748ejb.944.2024.01.02.03.21.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 03:21:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14283-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GeDzh8jA; spf=pass (google.com: domain of linux-kernel+bounces-14283-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14283-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id A80921F224AE for ; Tue, 2 Jan 2024 11:21:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A32CDEAC2; Tue, 2 Jan 2024 11:21:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GeDzh8jA" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 D1A7CE544; Tue, 2 Jan 2024 11:21:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60B48C433C7; Tue, 2 Jan 2024 11:21:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704194465; bh=9BxRzEOBTvR+ppxG806EdQKoWFFjbUS/+GzPU/AwX9g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GeDzh8jA6WHp/CxKP0OUKid/aof8nCv7fI6c2Z6/esAnHXjkaYY5h9T5qBYA9bGhq F55tRn31n4Ja8nd0kjwpooY0qXEZqPg8h1XltOwsqwEkCHWla6jI1W+mpSOniWCRIO cTyHNZY3uVgxbGTuAFKDeJwSGtCFDksU0Z+GPvAzFL5FBR55w5FH6CZgbi9tFUZsPn k2ABDr0oG0AhvA7h+BD/cjpRdlJgEyEx15b8i2C4yiSrz5fsFFUjSIiLUzFggCeJGR YlQ9eFU/CVl4LE6PzYCHykNQPZyO+jrzwfwt0NvBg/RPWeZq4aZfX8orOhWYPBGycq yqEI3TKmy0F+w== Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a282cb36d37so75148066b.3; Tue, 02 Jan 2024 03:21:05 -0800 (PST) X-Gm-Message-State: AOJu0YyWpCIG103YPc8b5oIQIClbz88SxTAoa/UhK5vyt6aEtwCLFmbc z4rhouJ53e5A1cnU1v5mpHAvitB4Nn1b6StRhRQ= X-Received: by 2002:a17:906:7399:b0:a23:68ec:a863 with SMTP id f25-20020a170906739900b00a2368eca863mr7697697ejl.87.1704194463900; Tue, 02 Jan 2024 03:21:03 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240102101711.10872-2-xry111@xry111.site> <7a6aa1bbdbbe2e63ae96ff163fab0349f58f1b9e.camel@xry111.site> In-Reply-To: <7a6aa1bbdbbe2e63ae96ff163fab0349f58f1b9e.camel@xry111.site> From: Huacai Chen Date: Tue, 2 Jan 2024 19:20:57 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: MIPS: fcsr31 may be dirty after execve when kernel preempt is enabled (was: Re: [PATCH v2] LoongArch: Fix and simplify fcsr initialization on execve) To: Xi Ruoyao Cc: WANG Xuerui , Jiaxun Yang , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jan 2, 2024 at 6:48=E2=80=AFPM Xi Ruoyao wrote= : > > 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. I'm not sure how MIPS evades the is= sue > > > (or maybe it's just buggy too) but I'll investigate it later. > > > > Phew. 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. > > > > % cat measure.c > > #include > > int main() { return fetestexcept(FE_INEXACT); } > > > > % echo $((1./3)) > > 0.33333333333333331 > > > > % while ./a.out; do ; done > > (stopped in seconds) > > > > 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. > Maybe lose_fpu in SET_PERSONALITY2? But to me doing so will be really > nasty. Anyway I'll leave this for MIPS maintainers. Disable preemption in SET_PERSONALITY2 and enable in START_THREAD? Huacai > > -- > Xi Ruoyao > School of Aerospace Science and Technology, Xidian University