Re: [PATCH] x86/build/64: Prevent native builds from generating APX instructions

From: Chang S. Bae

Date: Sun Aug 02 2026 - 17:32:56 EST


On 8/2/2026 2:08 AM, David Laight wrote:

Does that mean that this patch is completely unnecessary?
It is necessary. On APX systems running, e.g. Linux kernel v6.16+, with the OS enables XCR0.APX, the compiler may consider all 32 registers usable and the compiled kernel inadvertently emits APX instructions (unconditionally) clobbering those registers. So -mno apxf prevents such unintended in-kernel use.

Note that mainline currently supports only userspace APX, where user EGPR state is context-switched through the XSAVE mechanism. That alone is insufficient to support in-kernel uses. Like the legacy GPRs, EGPRs need to be handled on entry paths, and there are still many other things to consider before in-kernel usages.

Thanks,
Chang