mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Chang S. Bae" <chang.seok.bae@intel.com>
To: Daniel Wade <danjwade95@gmail.com>,
	Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
	Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>, <x86@kernel.org>
Cc: "H . Peter Anvin" <hpa@zytor.com>,
	Andrei Vagin <avagin@google.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] x86/fpu: Put non-enabled dynamic features into init state on sigreturn
Date: Wed, 2 Dec 2026 10:12:01 -0800	[thread overview]
Message-ID: <9342b670-2e44-4e85-bb52-7551417120a5@intel.com> (raw)
In-Reply-To: <20261127090039.1557-1-danjwade95@gmail.com>

On 11/27/2026 1:00 AM, Daniel Wade wrote:
> A dynamic feature not enabled by a task is expected to be in init state
> while that task owns the FPU registers. The direct sigreturn path limits
> both restore and init masks to fpstate::user_xfeatures. If the task loses
> registers inside rt_sigreturn(), another task's tiles can remain there:
> 
>    A: rt_sigreturn() with AMX permitted, XTILE_DATA not enabled, faults or
>       is preempted; TIF_NEED_FPU_LOAD is set.
>    B: runs on the same CPU and leaves nonzero XTILE_DATA in the registers.
>    A: resumes with XFD set. XRSTOR leaves XTILE_DATA untouched, then
>       fpregs_mark_activate() marks the registers as A's.
>    A: first AMX instruction traps. fpstate_realloc() clears XFD without
>       reloading, so TILESTORED reads B's tile data.

Nit: Vagin's note [*] looks a bit more illustrative to me.

[*]: 
https://lore.kernel.org/CANaxB-zWf3BkCM8hsd0pXTULHi2ZmpRnLgpp2BFzT=_XwMdRrw@mail.gmail.com

> A supplies TILECFG in its signal frame, avoiding LDTILECFG, which would
> zero the tile data before TILESTORED.
> 
> If the task no longer owns the FPU registers, reset any state its signal
> frame did not restore, including XTILE_DATA. Otherwise keep the old mask.

Reviewed-by: Chang S. Bae <chang.seok.bae@intel.com>

Thanks,
Chang

      reply	other threads:[~2026-12-02 18:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  9:00 Daniel Wade
2026-12-02 18:12 ` Chang S. Bae [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=9342b670-2e44-4e85-bb52-7551417120a5@intel.com \
    --to=chang.seok.bae@intel.com \
    --cc=avagin@google.com \
    --cc=bp@alien8.de \
    --cc=danjwade95@gmail.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --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®