From: "Chang S. Bae" <chang.seok.bae@intel.com>
To: David Laight <david.laight.linux@gmail.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: Sat, 1 Aug 2026 17:00:36 -0700 [thread overview]
Message-ID: <2ea83400-a49e-4015-a0bd-926e5a0ef073@intel.com> (raw)
In-Reply-To: <20260801124429.45d03af7@pumpkin>
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
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.
Thanks,
Chang
next prev parent reply other threads:[~2026-08-02 0:00 UTC|newest]
Thread overview: 12+ 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 [this message]
2026-08-02 9:08 ` David Laight
2026-08-02 21:32 ` Chang S. Bae
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=2ea83400-a49e-4015-a0bd-926e5a0ef073@intel.com \
--to=chang.seok.bae@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=david.laight.linux@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox