From: Eric Biggers <ebiggers@kernel.org>
To: Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org, linux-um@lists.infradead.org,
linux-raid@vger.kernel.org, linux-crypto@vger.kernel.org,
linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2 1/8] x86/fpu: Check for missing AVX and AVX-512 xstate bits
Date: Wed, 12 Aug 2026 19:40:11 +0000 [thread overview]
Message-ID: <20260812194011.GA3734410@google.com> (raw)
In-Reply-To: <20260812174826.GAanyx6vUWv5GLX2AZ@fat_crate.local>
On Wed, Aug 12, 2026 at 10:48:26AM -0700, Borislav Petkov wrote:
> On Tue, Jul 28, 2026 at 04:47:26PM -0700, Borislav Petkov wrote:
> > On Tue, Jul 28, 2026 at 04:34:30PM -0700, Eric Biggers wrote:
> > > I don't know what your suggestion is. Are you still asking for the
> > > function to be renamed to clear_cpu_caps_xft()? Note that the
> > > abbreviation "xft" doesn't appear anywhere else in arch/x86/. Maybe you
> > > want the argument inverted? I don't know what you want, sorry.
> >
> > That's fine - I'll take a look at the final version after having gone through
> > the whole pile and then holler if I still see a need.
>
> Ok, here's something ontop of yours. It is tested only in a guest but it
> should show the intention.
>
> The first call in:
>
> if (!boot_cpu_has(X86_FEATURE_FPU)) {
>
> is not needed because that is caught earlier:
>
> [ 0.553199] x86/fpu: Giving up, no FPU found and no math emulation present
>
> and we stop there.
Interesting, so the !boot_cpu_has(X86_FEATURE_FPU) check is dead code
since ab05214025ee ("x86/fpu: Remove MATH_EMULATION and related glue
code"). Sure, there's no need to add anything to there then, though we
should do a separate patch that removes it.
> The second one can then simply do:
>
> /* Disable all dependent flags too */
> setup_clear_cpu_cap(X86_FEATURE_XSAVE);
>
> because that'll clear all dependent flags and we should be good there:
Sure, that works. I'm not sure it's actually easier to understand than
what I proposed; it's kind of contradictory to call
"setup_clear_cpu_cap(X86_FEATURE_XSAVE)" when we just verified it is
clear. But the comment mentioning that it's actually for clearing
dependent flags helps. If you prefer this way, let's do this.
> and then the rest is streamlined into fpu__init_system_xstate() where all
> sanity checking should be performed, as I mentioned intially.
It's functionally equivalent, but yes we can write it this way if you
prefer. Is it okay if I fold your diff (minus the pr_info()) into this
patch? (I'll also add FW_BUG to the error messages as Thomas
requested.)
- Eric
next prev parent reply other threads:[~2026-08-12 19:40 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 2:15 [PATCH v2 0/8] x86: Remove cpu_has_xfeatures() and add AVX-512 xor_gen() Eric Biggers
2026-07-28 2:15 ` [PATCH v2 1/8] x86/fpu: Check for missing AVX and AVX-512 xstate bits Eric Biggers
2026-07-28 5:27 ` Borislav Petkov
2026-07-28 5:45 ` Eric Biggers
2026-07-28 18:20 ` Borislav Petkov
2026-07-28 18:34 ` Eric Biggers
2026-07-28 22:59 ` Borislav Petkov
2026-07-28 23:34 ` Eric Biggers
2026-07-28 23:47 ` Borislav Petkov
2026-08-12 17:48 ` Borislav Petkov
2026-08-12 19:40 ` Eric Biggers [this message]
2026-08-12 20:04 ` Borislav Petkov
2026-07-28 9:23 ` David Laight
2026-07-28 22:35 ` Thomas Gleixner
2026-07-28 2:15 ` [PATCH v2 2/8] um: " Eric Biggers
2026-07-30 23:06 ` Borislav Petkov
2026-07-28 2:15 ` [PATCH v2 3/8] crypto: x86 - Stop using cpu_has_xfeatures() Eric Biggers
2026-07-28 9:30 ` David Laight
2026-07-28 23:40 ` Eric Biggers
2026-07-28 2:15 ` [PATCH v2 4/8] lib/crypto: x86: " Eric Biggers
2026-07-30 23:19 ` Borislav Petkov
2026-07-30 23:47 ` Eric Biggers
2026-07-31 4:26 ` Borislav Petkov
2026-07-28 2:16 ` [PATCH v2 5/8] lib/crc: " Eric Biggers
2026-07-28 2:16 ` [PATCH v2 6/8] x86/fpu: Remove cpu_has_xfeatures() Eric Biggers
2026-07-28 2:16 ` [PATCH v2 7/8] lib/raid/xor: x86: Remove redundant X86_FEATURE_OSXSAVE check Eric Biggers
2026-07-28 3:41 ` Christoph Hellwig
2026-07-28 2:16 ` [PATCH v2 8/8] lib/raid/xor: x86: Add AVX-512 optimized xor_gen() Eric Biggers
2026-07-28 3:44 ` Christoph Hellwig
2026-07-28 3:44 ` [PATCH v2 0/8] x86: Remove cpu_has_xfeatures() and add AVX-512 xor_gen() Christoph Hellwig
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=20260812194011.GA3734410@google.com \
--to=ebiggers@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=hch@lst.de \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=linux-um@lists.infradead.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