Message ID | 20250617222726.365148-9-ebiggers@kernel.org |
---|---|
State | Superseded |
Headers | show |
Series | lib/crypto: move arch/$(ARCH)/lib/crypto/ to lib/crypto/$(ARCH)/ | expand |
On Tue, Jun 17, 2025 at 05:41:09PM -0700, Sohil Mehta wrote: > On 6/17/2025 3:27 PM, Eric Biggers wrote: > > From: Eric Biggers <ebiggers@google.com> > > > > 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. > > > > arch/x86/lib/crypto/.gitignore is intentionally kept for now. See > > https://lore.kernel.org/r/CAHk-=whu2fb22rEy6+oKx1-+NCHuWucZepvD0H2MD38DrJVKtg@mail.gmail.com/ > > I'll remove it later after some time has passed. > > > > After this change, arch/x86/lib/ has a lone empty directory crypto with > the .gitignore file. > > Instead, would it be cleaner to get rid of the crypto directory > altogether and update the .gitignore of the parent? > > As per the link above, commit 2df0c02dab82 ("x86 boot build: make git > ignore stale 'tools' directory") says this: > > "So when removing directories that had special .gitignore patterns, make > sure to add a new gitignore entry in the parent directory for the no > longer existing subdirectory." > > With that change, > > Reviewed-by: Sohil Mehta <sohil.mehta@intel.com> Yes, that makes sense. I'll do it that way. Thanks! - Eric
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 @@ -1,12 +1,10 @@ # SPDX-License-Identifier: GPL-2.0 # # Makefile for x86 specific library files. # -obj-y += crypto/ - # Produces uninteresting flaky coverage. KCOV_INSTRUMENT_delay.o := n # KCSAN uses udelay for introducing watchpoint delay; avoid recursion. KCSAN_SANITIZE_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 @@ -209,10 +209,10 @@ source "lib/crypto/s390/Kconfig" endif if SPARC source "lib/crypto/sparc/Kconfig" endif if X86 -source "arch/x86/lib/crypto/Kconfig" +source "lib/crypto/x86/Kconfig" endif endif endmenu diff --git a/lib/crypto/Makefile b/lib/crypto/Makefile index 748d1fc6b6be2..16f5d76d92710 100644 --- a/lib/crypto/Makefile +++ b/lib/crypto/Makefile @@ -108,5 +108,6 @@ obj-$(CONFIG_ARM64) += arm64/ obj-$(CONFIG_MIPS) += mips/ obj-$(CONFIG_PPC) += powerpc/ obj-$(CONFIG_RISCV) += riscv/ obj-$(CONFIG_S390) += s390/ obj-$(CONFIG_SPARC) += sparc/ +obj-$(CONFIG_X86) += x86/ diff --git a/lib/crypto/x86/.gitignore b/lib/crypto/x86/.gitignore new file mode 100644 index 0000000000000..580c839bb1776 --- /dev/null +++ b/lib/crypto/x86/.gitignore @@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +poly1305-x86_64-cryptogams.S 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