From patchwork Sat Aug 4 18:46:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 10555853 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 8644F13AC for ; Sat, 4 Aug 2018 18:46:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7223B29A66 for ; Sat, 4 Aug 2018 18:46:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62C7829A6B; Sat, 4 Aug 2018 18:46:56 +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 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 0F2B529A66 for ; Sat, 4 Aug 2018 18:46:55 +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=Myfm2rcx7ur+rCnxGJbaA4eRQafeMHxFfMaOuo87Czk=; b=Kyh 2dh9ReEZL2lGqK9/FI8wMzJbhllNaQm4nwzFCYqg4G9ag6yLeY+lL1q1an3Qro71rzkJzDHto9Sf/ nalyu+U4ypBUbhHCQ9gM56avGEc9tsRP+doKhMrPfjL74c3IzHgb9E1ruI4nmncSUWmelFFqrTl8o Hp78/5T09Xu8AYs6eIFlXlzEiR1HHFytbPoeuRCjJKbxyIh/ySksr9bvUL6fbiMWQWf9P/DY/zecp NxfAz7AJ8tdxvDp662hLVd+Jlvw22MtJW4o+p76QPG03+XnH2r9vYoXUGW7/41MtWh3m7b48jjLIV lAlmkfHlUhbqabTmIX7baau5JfWOjyQ==; 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 1fm1Zf-0002RR-R2; Sat, 04 Aug 2018 18:46:47 +0000 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fm1Zb-0002QB-B4 for linux-arm-kernel@lists.infradead.org; Sat, 04 Aug 2018 18:46:45 +0000 Received: by mail-ed1-x541.google.com with SMTP id b10-v6so3305596eds.4 for ; Sat, 04 Aug 2018 11:46:31 -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=JVwOAUfH/4i/DSGaPmcmrQT/sB484xJo9wca6iRqdj8=; b=Efj1DXt83PE1dG8bimk2P/jHVUxJxe/a7DEe7MuXiJlx+1DTd6laR/5CuGAaC4//BU g7j/5Rr2XCxQBqCxEc/y3ZPeCqgHjPo4+mI9GUvQT1M0VOtcDZBQ1yMm5Oi+MBA5IxfW txUc7QxeNMhAg6CmYNl+wH1nSnXhqQaRjhJQI= 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=JVwOAUfH/4i/DSGaPmcmrQT/sB484xJo9wca6iRqdj8=; b=mLGBJMEeCcKVq+3v/8lgK8MbyAWFkYW8ykdtLjBcqay+YB/4bcefI/umCfWVL+mv8s s3/7T82oU2GjR1V2nSt4e/fkTR9RPpZ6bWdPqrCitzHlc/lEV8irwu9rXvyGvB1pCiNn JWAw2HB39t8x75rpGTMnUQ/P+P7v8XbbPKPDFKTBPYS49c32LcqiIhnEFCBnwXGoSxVP MGeE8a/mrYoEfDxF8wCmWAfm9DwfxDEhaVg2i2uok+ZD0STUqVBqMPndS2y+EXCG90xI 9P5ABKzIaTNDgs/UiCgX5u6UHIjaJFlrK0geTIPt5TC49gPVAqwcsNkbT5ARnPcNwMuM HgFw== X-Gm-Message-State: AOUpUlE+tQxuWoaxnzgCoY/Q0UDnGvsSp5hjujFFBegBxWp8Sltz6TZz Y2wFIIKdxzkatGxEp5gpN/+Q/A== X-Google-Smtp-Source: AAOMgpdeukezegAeXw41IgiVjzw4u2u/UNZDuSCzMZteD5LJ8Azbe636Ttt6nc7Rl0smtmjE4QBbtA== X-Received: by 2002:a50:ae62:: with SMTP id c89-v6mr11779838edd.257.1533408390508; Sat, 04 Aug 2018 11:46:30 -0700 (PDT) Received: from rev02.home (b80182.upc-b.chello.nl. [212.83.80.182]) by smtp.gmail.com with ESMTPSA id l30-v6sm4340504edc.70.2018.08.04.11.46.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Aug 2018 11:46:29 -0700 (PDT) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Subject: [PATCH 0/2] crypto: arm64/ghash-ce - performance improvements Date: Sat, 4 Aug 2018 20:46:23 +0200 Message-Id: <20180804184625.28523-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-20180804_114643_402451_41F05DF6 X-CRM114-Status: UNSURE ( 8.81 ) X-CRM114-Notice: Please train this message. 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 , jerome.forissier@linaro.org, herbert@gondor.apana.org.au, linux-arm-kernel@lists.infradead.org, jens.wiklander@linaro.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 Another bit of performance work on the GHASH driver: this time it is not the combined AES/GCM algorithm but the bare GHASH driver that gets updated. Even though ARM cores that implement the polynomical multiplication instructions that these routines depend on are guaranteed to also support the AES instructions, and can thus use the AES/GCM driver, there could be reasons to use the accelerated GHASH in isolation, e.g., with another symmetric blockcipher, with a faster h/w accelerator, or potentially with an accelerator that does not expose the AES key to the OS. The resulting code runs at 1.1 cycles per byte on Cortex-A53 (down from 2.4 cycles per byte) Ard Biesheuvel (2): crypto: arm64/ghash-ce - replace NEON yield check with block limit crypto: arm64/ghash-ce - implement 4-way aggregation arch/arm64/crypto/ghash-ce-core.S | 153 ++++++++++++++------ arch/arm64/crypto/ghash-ce-glue.c | 87 ++++++----- 2 files changed, 161 insertions(+), 79 deletions(-)