From: Eric Biggers Date: Thu, 19 Jun 2025 19:19:07 +0000 (-0700) Subject: lib/crypto: x86: Move arch/x86/lib/crypto/ into lib/crypto/ X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74750aa78de33794aa9ab55de15da04bd41d1ac8;p=thirdparty%2Flinux.git lib/crypto: x86: Move arch/x86/lib/crypto/ into lib/crypto/ Move the contents of arch/x86/lib/crypto/ into lib/crypto/x86/. The new code organization makes a lot more sense for how this code actually works and is developed. In particular, it makes it possible to build each algorithm as a single module, with better inlining and dead code elimination. For a more detailed explanation, see the patchset which did this for the CRC library code: https://lore.kernel.org/r/20250607200454.73587-1-ebiggers@kernel.org/. Also see the patchset which did this for SHA-512: https://lore.kernel.org/linux-crypto/20250616014019.415791-1-ebiggers@kernel.org/ This is just a preparatory commit, which does the move to get the files into their new location but keeps them building the same way as before. Later commits will make the actual improvements to the way the arch-optimized code is integrated for each algorithm. Add a gitignore entry for the removed directory arch/x86/lib/crypto/ so that people don't accidentally commit leftover generated files. Acked-by: Ard Biesheuvel Reviewed-by: Martin K. Petersen Reviewed-by: Sohil Mehta Link: https://lore.kernel.org/r/20250619191908.134235-9-ebiggers@kernel.org Signed-off-by: Eric Biggers --- diff --git a/arch/x86/lib/.gitignore b/arch/x86/lib/.gitignore index 8ae0f93ecbfdd..ec2131c9fd206 100644 --- a/arch/x86/lib/.gitignore +++ b/arch/x86/lib/.gitignore @@ -1,2 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only + +# This now-removed directory used to contain generated files. +/crypto/ + inat-tables.c diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile index 4fa5c4e1ba8a0..7cf8681cba0f2 100644 --- a/arch/x86/lib/Makefile +++ b/arch/x86/lib/Makefile @@ -3,8 +3,6 @@ # Makefile for x86 specific library files. # -obj-y += crypto/ - # Produces uninteresting flaky coverage. KCOV_INSTRUMENT_delay.o := n diff --git a/lib/crypto/Kconfig b/lib/crypto/Kconfig index b98543c7ef231..2460ddff967fc 100644 --- a/lib/crypto/Kconfig +++ b/lib/crypto/Kconfig @@ -211,7 +211,7 @@ if SPARC source "lib/crypto/sparc/Kconfig" endif if X86 -source "arch/x86/lib/crypto/Kconfig" +source "lib/crypto/x86/Kconfig" endif endif diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile index 7c1e7d06cac9d..5823137fa5a8c 100644 --- a/lib/crypto/Makefile +++ b/lib/crypto/Makefile @@ -114,3 +114,4 @@ obj-$(CONFIG_PPC) += powerpc/ obj-$(CONFIG_RISCV) += riscv/ obj-$(CONFIG_S390) += s390/ obj-$(CONFIG_SPARC) += sparc/ +obj-$(CONFIG_X86) += x86/ diff --git a/arch/x86/lib/crypto/.gitignore b/lib/crypto/x86/.gitignore similarity index 100% rename from arch/x86/lib/crypto/.gitignore rename to lib/crypto/x86/.gitignore diff --git a/arch/x86/lib/crypto/Kconfig b/lib/crypto/x86/Kconfig similarity index 100% rename from arch/x86/lib/crypto/Kconfig rename to lib/crypto/x86/Kconfig diff --git a/arch/x86/lib/crypto/Makefile b/lib/crypto/x86/Makefile similarity index 100% rename from arch/x86/lib/crypto/Makefile rename to lib/crypto/x86/Makefile diff --git a/arch/x86/lib/crypto/blake2s-core.S b/lib/crypto/x86/blake2s-core.S similarity index 100% rename from arch/x86/lib/crypto/blake2s-core.S rename to lib/crypto/x86/blake2s-core.S diff --git a/arch/x86/lib/crypto/blake2s-glue.c b/lib/crypto/x86/blake2s-glue.c similarity index 100% rename from arch/x86/lib/crypto/blake2s-glue.c rename to lib/crypto/x86/blake2s-glue.c diff --git a/arch/x86/lib/crypto/chacha-avx2-x86_64.S b/lib/crypto/x86/chacha-avx2-x86_64.S similarity index 100% rename from arch/x86/lib/crypto/chacha-avx2-x86_64.S rename to lib/crypto/x86/chacha-avx2-x86_64.S diff --git a/arch/x86/lib/crypto/chacha-avx512vl-x86_64.S b/lib/crypto/x86/chacha-avx512vl-x86_64.S similarity index 100% rename from arch/x86/lib/crypto/chacha-avx512vl-x86_64.S rename to lib/crypto/x86/chacha-avx512vl-x86_64.S diff --git a/arch/x86/lib/crypto/chacha-ssse3-x86_64.S b/lib/crypto/x86/chacha-ssse3-x86_64.S similarity index 100% rename from arch/x86/lib/crypto/chacha-ssse3-x86_64.S rename to lib/crypto/x86/chacha-ssse3-x86_64.S diff --git a/arch/x86/lib/crypto/chacha_glue.c b/lib/crypto/x86/chacha_glue.c similarity index 100% rename from arch/x86/lib/crypto/chacha_glue.c rename to lib/crypto/x86/chacha_glue.c diff --git a/arch/x86/lib/crypto/poly1305-x86_64-cryptogams.pl b/lib/crypto/x86/poly1305-x86_64-cryptogams.pl similarity index 100% rename from arch/x86/lib/crypto/poly1305-x86_64-cryptogams.pl rename to lib/crypto/x86/poly1305-x86_64-cryptogams.pl diff --git a/arch/x86/lib/crypto/poly1305_glue.c b/lib/crypto/x86/poly1305_glue.c similarity index 100% rename from arch/x86/lib/crypto/poly1305_glue.c rename to lib/crypto/x86/poly1305_glue.c diff --git a/arch/x86/lib/crypto/sha256-avx-asm.S b/lib/crypto/x86/sha256-avx-asm.S similarity index 100% rename from arch/x86/lib/crypto/sha256-avx-asm.S rename to lib/crypto/x86/sha256-avx-asm.S diff --git a/arch/x86/lib/crypto/sha256-avx2-asm.S b/lib/crypto/x86/sha256-avx2-asm.S similarity index 100% rename from arch/x86/lib/crypto/sha256-avx2-asm.S rename to lib/crypto/x86/sha256-avx2-asm.S diff --git a/arch/x86/lib/crypto/sha256-ni-asm.S b/lib/crypto/x86/sha256-ni-asm.S similarity index 100% rename from arch/x86/lib/crypto/sha256-ni-asm.S rename to lib/crypto/x86/sha256-ni-asm.S diff --git a/arch/x86/lib/crypto/sha256-ssse3-asm.S b/lib/crypto/x86/sha256-ssse3-asm.S similarity index 100% rename from arch/x86/lib/crypto/sha256-ssse3-asm.S rename to lib/crypto/x86/sha256-ssse3-asm.S diff --git a/arch/x86/lib/crypto/sha256.c b/lib/crypto/x86/sha256.c similarity index 100% rename from arch/x86/lib/crypto/sha256.c rename to lib/crypto/x86/sha256.c