linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>,
	Eric Biederman <ebiederm@xmission.com>,
	Kees Cook <keescook@chromium.org>,
	Tiezhu Yang <yangtiezhu@loongson.cn>,
	Jinyang He <hejinyang@loongson.cn>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	 loongarch@lists.linux.dev, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org,  stable@vger.kernel.org
Subject: Re: [PATCH] LoongArch: Fix and simplify fcsr initialization on execve
Date: Tue, 02 Jan 2024 16:09:00 +0800	[thread overview]
Message-ID: <22af410fe1f60e7fc04cafbe03cfc50b36b53ae3.camel@xry111.site> (raw)
In-Reply-To: <CAAhV-H6dJtc3ZpEBnJzKdh691KQck771KOR0Lj41VLZ-Rc1ZwQ@mail.gmail.com>

On Tue, 2024-01-02 at 10:35 +0800, Huacai Chen wrote:

/* snip */

> > 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) as I don't have a running MIPS hardware
> > now.
> I think you can use QEMU. :)

I'll investigate it later.

> > So for LoongArch, just remove the current->thread.fpu.fcsr setting from
> > SET_PERSONALITY2 and do it in start_thread, after lose_fpu(0).  And we
> > just set it to 0, instead of boot_cpu_data.fpu_csr0 (because we should
> > provide the userspace a consistent configuration, no matter how hardware
> > and firmware behave).
> I still prefer to set fcsr to boot_cpu_data.fpu_csr0, because we will
> add LoongArch32 later, not sure whether something will change.

I just seen fpu_csr0 is initialized to FPU_CSR_RN which is just 0 for
LA64, so my concern about firmware & hardware leaving non-zero FCSR is
not valid.  I'll send v2 to keep using boot_cpu_data.fpu_csr0 then.

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


      reply	other threads:[~2024-01-02  8:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-01 17:21 Xi Ruoyao
2024-01-02  2:35 ` Huacai Chen
2024-01-02  8:09   ` Xi Ruoyao [this message]

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=22af410fe1f60e7fc04cafbe03cfc50b36b53ae3.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-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