From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5389BD68BFA for ; Sun, 17 Nov 2024 00:24:24 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4XrWhf0Y1Bz2yD4; Sun, 17 Nov 2024 11:24:02 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=147.75.193.91 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1731803042; cv=none; b=h385bBatM7Blgy4vvpDQbn9TpxyktvV9wG3yiuD8VqZYI+9KIFlU0fwiuZRC4/EykzdqgtqJvA0ECD7+RjMTJdVX17GYrn4HEB6p+fyQnmLqS7bUZLBzSxdNl3r3A5vSTsQCBsgViZus5dLXwzviGO42gDw7jKw4R57+yBc2zkfhAvzs5tAbwLeb85yQdhkQ/5WpTYNN0XKd7yhlzd8nT0DGZE7pJmziwo1k0ndVoDUr3NsuYBPWvBELQbFYZEwGLJeRgMn2A4poqGBgjv5Pk0thRMeH9ib2MIavNieF5bQg29UmSfeqf9bp4gw7IX67NwVMXPW8JP9ks7hHE5CUxw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1731803042; c=relaxed/relaxed; bh=cTUM1q9Q3qAzGiXzAGwWc0e6cu08dWj+FhjfF8+HPCE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gbsklVXke0czCzjMF31sjHdC99ifflSua8jMAd6ynAustSvKFSKekGNHzZKNqm43kHXGtJACO7EdLqCRolALzhffeJeNJwf6hMAfi3lmIbBerbVC/hIHoUX0dVkhna+vzKRp/fkmJB38SLT69UlFONSq/DRRuZBHFCbfsgkTwUh6UR1FEupbsRfYaqC8yKWi0Oot7XpXV5Fxinu1MY2md5uD6N+MkAkwkczB1cjsQGJ0jQtbvwYTeVHD2ymtfdWs9JeNgUfvzIIqhSPMSDy55PgSGefjYI9SVeyvEzW1Jzzwx8njMKscZy9DgL7Bvx9F8+no+HXMMSpUnBz9Q4zxxA== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=QdBB+C8w; dkim-atps=neutral; spf=pass (client-ip=147.75.193.91; helo=nyc.source.kernel.org; envelope-from=ebiggers@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=QdBB+C8w; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=147.75.193.91; helo=nyc.source.kernel.org; envelope-from=ebiggers@kernel.org; receiver=lists.ozlabs.org) Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4XrWhb2YrKz30LS for ; Sun, 17 Nov 2024 11:23:59 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 85B0FA406D1; Sun, 17 Nov 2024 00:22:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51AC4C4CEC3; Sun, 17 Nov 2024 00:23:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1731803033; bh=CnepUwceJ5j9G5NUVs6UktH+oiMT+FJpiIqYKC1mGcA=; h=From:To:Cc:Subject:Date:From; b=QdBB+C8wOvDetydffbpqtgfNNLWzIrqbXMWelcLY8DuPmy5RGF5zfG+A0FsY+HaNG O5PCgWFRW5GIMrGbfXgQ6Hbr4YtcyZFG8IX5XfaCSbHMkjiym1yO4Kr1vWmJjTz2fZ sm8sHc6x2aDG3jtzdyegeDIKNBOQi7ERfR9RL9g136J9NuF533+AkCvwC9xhixjbJK u1l2xA91Oc3DJfkMqNMcmT3wcn905syEAe0IL49XL3ZtPbOEUqsh2M59r6C7RbJfDQ QdCEl8TCXEqTxxKPYmzGsTFdNGINwDhOyLJK07Ss4YFDkwMup0R7ZLkN14z7Cabzgs 4a3bW9/6PvKqQ== From: Eric Biggers To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, Zhihang Shao , Ard Biesheuvel Subject: [PATCH 00/11] Wire up CRC-T10DIF library functions to arch-optimized code Date: Sat, 16 Nov 2024 16:22:33 -0800 Message-ID: <20241117002244.105200-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.47.0 X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patchset is also available in git via: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git crc-t10dif-lib-v1 This patchset updates the kernel's CRC-T10DIF library functions to be directly optimized for x86, arm, arm64, and powerpc without taking an unnecessary and inefficient detour through the crypto API. It follows the same approach that I'm taking for CRC32 in the patchset https://lore.kernel.org/linux-crypto/20241103223154.136127-1-ebiggers@kernel.org This patchset also adds a CRC KUnit test suite that covers multiple CRC variants, and deletes some older ad-hoc tests that are obsoleted by it. This patchset has several dependencies including my CRC32 patchset and patches queued in several trees for 6.13. It can be retrieved from git using the command given above. This is targeting 6.14. Eric Biggers (11): lib/crc-t10dif: stop wrapping the crypto API lib/crc-t10dif: add support for arch overrides crypto: crct10dif - expose arch-optimized lib function x86/crc-t10dif: expose CRC-T10DIF function through lib arm/crc-t10dif: expose CRC-T10DIF function through lib arm64/crc-t10dif: expose CRC-T10DIF function through lib powerpc/crc-t10dif: expose CRC-T10DIF function through lib lib/crc_kunit.c: add KUnit test suite for CRC library functions lib/crc32test: delete obsolete crc32test.c powerpc/crc: delete obsolete crc-vpmsum_test.c MAINTAINERS: add entry for CRC library MAINTAINERS | 11 + arch/arm/Kconfig | 1 + arch/arm/crypto/Kconfig | 11 - arch/arm/crypto/Makefile | 2 - arch/arm/crypto/crct10dif-ce-glue.c | 124 --- arch/arm/lib/Makefile | 3 + .../crc-t10dif-core.S} | 0 arch/arm/lib/crc-t10dif-glue.c | 77 ++ arch/arm64/Kconfig | 1 + arch/arm64/configs/defconfig | 1 - arch/arm64/crypto/Kconfig | 10 - arch/arm64/crypto/Makefile | 3 - arch/arm64/crypto/crct10dif-ce-glue.c | 132 --- arch/arm64/lib/Makefile | 3 + .../crc-t10dif-core.S} | 0 arch/arm64/lib/crc-t10dif-glue.c | 78 ++ arch/m68k/configs/amiga_defconfig | 1 - arch/m68k/configs/apollo_defconfig | 1 - arch/m68k/configs/atari_defconfig | 1 - arch/m68k/configs/bvme6000_defconfig | 1 - arch/m68k/configs/hp300_defconfig | 1 - arch/m68k/configs/mac_defconfig | 1 - arch/m68k/configs/multi_defconfig | 1 - arch/m68k/configs/mvme147_defconfig | 1 - arch/m68k/configs/mvme16x_defconfig | 1 - arch/m68k/configs/q40_defconfig | 1 - arch/m68k/configs/sun3_defconfig | 1 - arch/m68k/configs/sun3x_defconfig | 1 - arch/powerpc/Kconfig | 1 + arch/powerpc/configs/powernv_defconfig | 1 - arch/powerpc/configs/ppc64_defconfig | 2 - arch/powerpc/crypto/Kconfig | 20 - arch/powerpc/crypto/Makefile | 3 - arch/powerpc/crypto/crc-vpmsum_test.c | 133 --- arch/powerpc/lib/Makefile | 3 + .../crc-t10dif-glue.c} | 69 +- .../{crypto => lib}/crct10dif-vpmsum_asm.S | 2 +- arch/s390/configs/debug_defconfig | 1 - arch/x86/Kconfig | 1 + arch/x86/crypto/Kconfig | 10 - arch/x86/crypto/Makefile | 3 - arch/x86/crypto/crct10dif-pclmul_glue.c | 143 --- arch/x86/lib/Makefile | 3 + arch/x86/lib/crc-t10dif-glue.c | 51 ++ .../{crypto => lib}/crct10dif-pcl-asm_64.S | 0 crypto/Kconfig | 1 + crypto/Makefile | 3 +- crypto/crct10dif_common.c | 82 -- crypto/crct10dif_generic.c | 82 +- include/linux/crc-t10dif.h | 28 +- lib/Kconfig | 43 +- lib/Kconfig.debug | 20 + lib/Makefile | 2 +- lib/crc-t10dif.c | 156 +--- lib/crc32test.c | 852 ------------------ lib/crc_kunit.c | 428 +++++++++ .../testing/selftests/arm64/fp/kernel-test.c | 3 +- 57 files changed, 867 insertions(+), 1748 deletions(-) delete mode 100644 arch/arm/crypto/crct10dif-ce-glue.c rename arch/arm/{crypto/crct10dif-ce-core.S => lib/crc-t10dif-core.S} (100%) create mode 100644 arch/arm/lib/crc-t10dif-glue.c delete mode 100644 arch/arm64/crypto/crct10dif-ce-glue.c rename arch/arm64/{crypto/crct10dif-ce-core.S => lib/crc-t10dif-core.S} (100%) create mode 100644 arch/arm64/lib/crc-t10dif-glue.c delete mode 100644 arch/powerpc/crypto/crc-vpmsum_test.c rename arch/powerpc/{crypto/crct10dif-vpmsum_glue.c => lib/crc-t10dif-glue.c} (50%) rename arch/powerpc/{crypto => lib}/crct10dif-vpmsum_asm.S (99%) delete mode 100644 arch/x86/crypto/crct10dif-pclmul_glue.c create mode 100644 arch/x86/lib/crc-t10dif-glue.c rename arch/x86/{crypto => lib}/crct10dif-pcl-asm_64.S (100%) delete mode 100644 crypto/crct10dif_common.c delete mode 100644 lib/crc32test.c create mode 100644 lib/crc_kunit.c -- 2.47.0