From: David Laight <david.laight.linux@gmail.com>
To: "Chang S. Bae" <chang.seok.bae@intel.com>
Cc: <linux-kernel@vger.kernel.org>, <x86@kernel.org>,
<tglx@kernel.org>, <mingo@redhat.com>, <bp@alien8.de>,
<dave.hansen@linux.intel.com>, <hpa@zytor.com>,
Omar Avelar <omar.avelar@intel.com>, <stable@vger.kernel.org>,
Miguel Ojeda <ojeda@kernel.org>,
Nathan Chancellor <nathan@kernel.org>
Subject: Re: [PATCH] x86/build/64: Prevent native builds from generating APX instructions
Date: Sun, 2 Aug 2026 10:08:08 +0100 [thread overview]
Message-ID: <20260802100808.754400af@pumpkin> (raw)
In-Reply-To: <2ea83400-a49e-4015-a0bd-926e5a0ef073@intel.com>
On Sat, 1 Aug 2026 17:00:36 -0700
"Chang S. Bae" <chang.seok.bae@intel.com> wrote:
> On 8/1/2026 4:44 AM, David Laight wrote:
> >
> > Much like when AVX support was added, -march-native needs to check that the
> > operating system is saving the registers not that the cpu supports them.
>
> This GCC bug looks relevant:
>
> "__builtin_cpu_supports avx does not verify OS supports it"
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85100
Yes, except I thought it was much older...
> The resulting commit 059cc8aca774 ("i386: Enable AVX/AVX512 features
> only if supported by OSXSAVE") switched the compiler to read XCR0 before
> set_feature().
>
> Similarly, the APX enablement commit e686416b6217 ("[APX_EGPR] Initial
> support for APX_F") extends the XCR0 check to determine whether APX is
> usable. So, the compiler seemingly won't emit APX instructions without
> OS setting XCR0.APX.
Does that mean that this patch is completely unnecessary?
David
>
> Thanks,
> Chang
prev parent reply other threads:[~2026-08-02 9:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 21:14 [PATCH] x86/build/64: Prevent native builds from generating APX instructions Chang S. Bae
2026-07-09 12:36 ` Miguel Ojeda
2026-07-14 22:15 ` Chang S. Bae
2026-07-15 10:30 ` Miguel Ojeda
2026-07-31 20:46 ` Chang S. Bae
2026-07-31 20:57 ` Miguel Ojeda
2026-07-31 21:15 ` Chang S. Bae
2026-07-12 20:25 ` Nathan Chancellor
2026-08-01 11:44 ` David Laight
2026-08-02 0:00 ` Chang S. Bae
2026-08-02 9:08 ` David Laight [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=20260802100808.754400af@pumpkin \
--to=david.laight.linux@gmail.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=nathan@kernel.org \
--cc=ojeda@kernel.org \
--cc=omar.avelar@intel.com \
--cc=stable@vger.kernel.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.