From patchwork Mon Aug 27 11:02:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 10576965 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 919FB17DE for ; Mon, 27 Aug 2018 11:06:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 825EB29668 for ; Mon, 27 Aug 2018 11:06:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 767DF29741; Mon, 27 Aug 2018 11:06:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0C70829668 for ; Mon, 27 Aug 2018 11:06:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=ro3RpylqQge1FmOninBLM6oegcOOfRlTmbHdjto2Ze0=; b=Ucl adwpu07fZ2OQMKXL4LfQinK9OiJLlt/hGJ3Dl9N828lYkJmi2VKELMfv1N9/laGAsdEkaFxbC9GFm +tOupu9sQ3rZ/y4gutuJ1UeAuwtEz1jEcQDAC0AWJH7rAcDitURZxbuA57ygmajcZHDuWM0qjRMUh vluQ9c92oHqBdF0GSEwwoAEKEplc6VUuX1pald2BHkFTPXelW0BPbH89VKcOmk82aL4tBDHVFPA49 lvoWzG3rV1zEhs2BhB//vZOU7RuHWBGHMzIUS6M2AMxVxDZeu1hojwRffjMr76dXUqkjUVp/zsWyS YT0iHxYo2jS0GiUXRAb4eN7yyUMgXyg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFLp-0005SA-9J; Mon, 27 Aug 2018 11:06:29 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFIf-0002cI-89 for linux-arm-kernel@lists.infradead.org; Mon, 27 Aug 2018 11:03:19 +0000 Received: by mail-ed1-x544.google.com with SMTP id b10-v6so10147633eds.4 for ; Mon, 27 Aug 2018 04:03:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=KZpXutJD8TJDNiGk/rbW/vWe21LI0Ft8rx8Dmxx88Jw=; b=B9H/00l/A38AZ0GnJJ6RMEqfOIDUf6edSpUR80T1y7vw45Pd8sA18wSG5Pu+5f4z9n V7OQKazV/yxfFJREddZrMDdWu6NoMIFHGn/fnbBSbEBO5V+Q3TcNS8p6uJQcRl8HXrkc 8kkZ+CKQe4s/x4sQptQhsxxNAAZDg6CWNB2No= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KZpXutJD8TJDNiGk/rbW/vWe21LI0Ft8rx8Dmxx88Jw=; b=ityGkynfjgN+1jENYm0OUugUTVZKYUpzXwnLgFcK5zbXRSuUoFf/62KNCo9DqWMvT2 RinRreK4/Gl7+CoUGn/DNrqm/aLPtcXdpiy/pfYbLx925rsYdrehlaF+D3HfnwLr3V9B JLD8lb9GsUAlWkc+g/WyP87hHXrB9zDeGR6jMZ0dXDosFNRJ+5msmnw1tnDqxPb0vhKm D+Fkty6ltY2EzCx4iAlMwpjcCPBIRft81Zk/iW1ZzopueRCxknYD+lUjqMtx2b4BVeh1 FHaehqsnaFGPiTNum0PAvu4u3+izaR3mYi8L6rkVZR/FSTEEncalHJWi2+Evo+SjXl2e 0aHg== X-Gm-Message-State: APzg51CIlfbHeqYTFe2xGZf0eURczZPvTZ9rs/k5VlQejW9PsdRBXs4h QX9DA0nXiQ6tADBio0EbXrJfYyYm9kxfi7c5 X-Google-Smtp-Source: ANB0VdZ15BArf225FMwUl6lV/s5gWxygzNw8Vk/gEodEtfkTLgjcWuHbP9Silo4/bUKSYv9Fz42phA== X-Received: by 2002:a50:b003:: with SMTP id i3-v6mr16010146edd.120.1535367779989; Mon, 27 Aug 2018 04:02:59 -0700 (PDT) Received: from rev02.home ([2a02:a212:9283:9800:24b9:e2d6:9acc:50dd]) by smtp.gmail.com with ESMTPSA id r2-v6sm3114344eda.89.2018.08.27.04.02.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 04:02:59 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org Subject: [PATCH 0/4] arm64: wire CRC32 instructions into core crc32 routines Date: Mon, 27 Aug 2018 13:02:41 +0200 Message-Id: <20180827110245.14812-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.18.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180827_040313_346733_02E9B4B0 X-CRM114-Status: GOOD ( 13.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel , herbert@gondor.apana.org.au, suzuki.poulose@arm.com, catalin.marinas@arm.com, ebiggers@google.com, will.deacon@arm.com, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP There are many crc32 users in the kernel that call the library routine rather than the crypto API wrapper, and so none of these callers use the accelerated arm64 instructions when available. While this is not known to cause performance issues, calling a table based time variant implementation with a non-negligible D-cache footprint (8 KB) is wasteful in any case, and now that the crc32 instructions have been made mandatory in the architecture, let's wire them up into the core crc routines. This also means that they will be exposed to the crypto API via the generic CRC32 driver, and so we can remove the scalar routines from the crypto API driver. This leaves the PMULL code, which will only be useful on systems that implement 64x64 PMULL but not the CRC32 instructions. Given that no such systems are known to exist, this driver is removed entirely in patch #4. Ard Biesheuvel (4): lib/crc32: make core crc32() routines weak so they can be overridden arm64: cpufeature: add feature for CRC32 instructions arm64/lib: add accelerated crc32 routines crypto: arm64/crc32 - remove PMULL based CRC32 driver arch/arm64/Kconfig | 1 + arch/arm64/configs/defconfig | 1 - arch/arm64/crypto/Kconfig | 5 - arch/arm64/crypto/Makefile | 3 - arch/arm64/crypto/crc32-ce-core.S | 287 -------------------- arch/arm64/crypto/crc32-ce-glue.c | 244 ----------------- arch/arm64/include/asm/cpucaps.h | 3 +- arch/arm64/kernel/cpufeature.c | 9 + arch/arm64/lib/Makefile | 2 + arch/arm64/lib/crc32.S | 60 ++++ lib/crc32.c | 11 +- 11 files changed, 81 insertions(+), 545 deletions(-) delete mode 100644 arch/arm64/crypto/crc32-ce-core.S delete mode 100644 arch/arm64/crypto/crc32-ce-glue.c create mode 100644 arch/arm64/lib/crc32.S