linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Huacai Chen <chenhuacai@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>,
	 Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Eric Biederman <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	 Tiezhu Yang <yangtiezhu@loongson.cn>,
	Jinyang He <hejinyang@loongson.cn>,
	loongarch@lists.linux.dev,  linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	 linux-mips@vger.kernel.org
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)
Date: Tue, 02 Jan 2024 18:48:27 +0800	[thread overview]
Message-ID: <7a6aa1bbdbbe2e63ae96ff163fab0349f58f1b9e.camel@xry111.site> (raw)
In-Reply-To: <f6e0b3a0e08a8100fa5dc9345af8582ff664321c.camel@xry111.site>

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 issue
> > (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=y.
> 
> % cat measure.c
> #include <fenv.h>
> 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.

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University


  reply	other threads:[~2024-01-02 10:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02 10:17 [PATCH v2] LoongArch: Fix and simplify fcsr initialization on execve Xi Ruoyao
2024-01-02 10:25 ` Xi Ruoyao
2024-01-02 10:48   ` Xi Ruoyao [this message]
2024-01-02 11:20     ` MIPS: fcsr31 may be dirty after execve when kernel preempt is enabled (was: Re: [PATCH v2] LoongArch: Fix and simplify fcsr initialization on execve) Huacai Chen
2024-01-02 11:16 ` [PATCH v2] LoongArch: Fix and simplify fcsr initialization on execve Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a6aa1bbdbbe2e63ae96ff163fab0349f58f1b9e.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=chenhuacai@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=hejinyang@loongson.cn \
    --cc=jiaxun.yang@flygoat.com \
    --cc=keescook@chromium.org \
    --cc=kernel@xen0n.name \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=loongarch@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    --cc=yangtiezhu@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox