From: Dave Hansen <dave.hansen@intel.com>
To: Guixiong Wei <weiguixiong@bytedance.com>, x86@kernel.org
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H . Peter Anvin" <hpa@zytor.com>,
"Chang S . Bae" <chang.seok.bae@intel.com>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] x86/fpu: Free dynamic fpstate on exec()
Date: Tue, 29 Sep 2026 09:53:29 -0700 [thread overview]
Message-ID: <7e945daf-2e1e-468b-8701-db6bbd4ef085@intel.com> (raw)
In-Reply-To: <20260929151013.81562-2-weiguixiong@bytedance.com>
On 9/29/26 08:10, Guixiong Wei wrote:
> Preserve the old fpstate pointer across fpstate_reset() and free it only
> after fpu_reset_fpstate_regs() has invalidated FPU register ownership.
> This ordering prevents a context switch from saving FPU registers through
> a freed fpstate pointer.
Are there any fpstate_reset() paths where this matters?
I mean, the init task, obviously not. It doesn't have a dynamic fpstate.
During exec() this reset happens while:
bprm->mm = NULL;
among other things, so I really don't think it's even remotely in the
context of getting context-switched to.
For clone(), the destination task is also not in any condition to be
context-switched to.
So why defend against context switching? What am I missing?
prev parent reply other threads:[~2026-09-29 16:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 15:10 Guixiong Wei
2026-09-29 15:57 ` Dave Hansen
2026-09-29 16:53 ` Dave Hansen [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=7e945daf-2e1e-468b-8701-db6bbd4ef085@intel.com \
--to=dave.hansen@intel.com \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=stable@vger.kernel.org \
--cc=tglx@kernel.org \
--cc=weiguixiong@bytedance.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®