]> git.ipfire.org Git - thirdparty/linux.git/commit
x86: move ZMM exclusion list into CPU feature flag
authorEric Biggers <ebiggers@google.com>
Mon, 10 Feb 2025 17:26:44 +0000 (09:26 -0800)
committerEric Biggers <ebiggers@google.com>
Mon, 10 Feb 2025 17:48:43 +0000 (09:48 -0800)
commit968e9bc4cef87054741db81a0d94d5c1f67d518a
tree3eaa29bb90163459e61b913fad4aa6237cc7d67c
parent0645b245a2bd1abf1b36b570db47517e5519819c
x86: move ZMM exclusion list into CPU feature flag

Lift zmm_exclusion_list in aesni-intel_glue.c into the x86 CPU setup
code, and add a new x86 CPU feature flag X86_FEATURE_PREFER_YMM that is
set when the CPU is on this list.

This allows other code in arch/x86/, such as the CRC library code, to
apply the same exclusion list when deciding whether to execute 256-bit
or 512-bit optimized functions.

Note that full AVX512 support including ZMM registers is still exposed
to userspace and is still supported for in-kernel use.  This flag just
indicates whether in-kernel code should prefer to use YMM registers.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: "Martin K. Petersen" <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20250210174540.161705-2-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@google.com>
arch/x86/crypto/aesni-intel_glue.c
arch/x86/include/asm/cpufeatures.h
arch/x86/kernel/cpu/intel.c