From patchwork Fri Jan 25 09:36:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 156568 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp140453jaa; Fri, 25 Jan 2019 01:36:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN5n6qEqvzi/wes4Q6bmx9qfpBXcjYVDS35de0lsK6IPr3oU3A5MiLGgEF9FHtRRaC/jaYfY X-Received: by 2002:a63:4101:: with SMTP id o1mr9208725pga.447.1548408996487; Fri, 25 Jan 2019 01:36:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548408996; cv=none; d=google.com; s=arc-20160816; b=BR2goY9cz28jMVJM1gH4Vb5o4H35x7fdP+KUpwYCQzoa1bxSPNInCClISLUCkul86v qoiw7B4PfS3xT2VDD+YPMSYMjXP9ssOP5oDfy2JKgOtt6ZzdlHv3byLrQ3dmX4w4I4CR 10Omwoaun7QSw8KxiBG/VRvoZW98U7ZhmMx23E7EChvX0Aeb+p1Ag+xIoY7ISlEH3exY 14bc35ZG5MTaEDS/JtBPD+Jfls5Q/H/9KHP8JludnjohpuSJ2aGpPv1PS1XxOS47Uq2I 1CEWgX0QuAEkLLRRL5X/vNtohuDH5XNnsnsHRXHGbEyGDhQ2gz3E1/gr8Je1ILVftikU 36Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=K82b4u0JeOxmjCgmJBy7RDWk5mZMmmjLdOOMm2/dRP8=; b=dMBzcI2XukuMfmVXAgqKHhRBu1SC3Ndt6grOWjzxioMflpW5GoVVWrClIyuOcG6Mqo R2g+q7jjGlXWNI4kTq/Kti6NYFgYXhgwpL9GgCKpP1b+sJnn90/Qo2+2b3GYB0FC8W/Q 0W2bHN6vQI6HsMO+eGtTE9yIzg4R+m5j8c3m5vrbETV1qxxrKl5rzStl84SyLL7DGodM A2mjTcZEIMW9F0UNYAaBKvDbd9K5s+yMXg0Tr4XjH7c7Vhuxrq5a8uHJNW7jqGuDgoWk n37GFJgx2Y7TUDqZ5S3DROTNQrHzUj2XFUbHz4Bm09w+gNNPSPjrNLLVlCBzzYkvZlKN GYxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B2MKYAdG; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v141si26360336pfc.260.2019.01.25.01.36.36; Fri, 25 Jan 2019 01:36:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B2MKYAdG; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbfAYJgf (ORCPT + 3 others); Fri, 25 Jan 2019 04:36:35 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:39131 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726269AbfAYJgf (ORCPT ); Fri, 25 Jan 2019 04:36:35 -0500 Received: by mail-wr1-f65.google.com with SMTP id t27so9517871wra.6 for ; Fri, 25 Jan 2019 01:36:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=K82b4u0JeOxmjCgmJBy7RDWk5mZMmmjLdOOMm2/dRP8=; b=B2MKYAdGHJazbaVbP1PZkrkDcNSrjKTR9v9WP3oBqkyUr6SUSazVYMaosXXVikDsfR t4YjVHBbU8r5IYt/yd5oHVJCQgGr8sVR+m96D0lZEtfaExFlXcYaLhgFXYhbI3hckG4b Ee5yhVanr/Oj1fQZj1n9da4GuFiwD1cNSY7Ro= 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=K82b4u0JeOxmjCgmJBy7RDWk5mZMmmjLdOOMm2/dRP8=; b=rNE1esXsFNuiPitG3nWyA6Lwu+HqAlCZrV0xIACBvGXUOz8dAD169K/Wpp3w/WN8DT jHH2WV/gNxR22mInkqWFq7YnOEKSUuje6HjMkAKpXz8F0QwR0kYU76bpukI8Gm3i29z5 dPajd9qWYCD3KCnHwfoTXPrpr+TPvAaTxJe4OqOEc5uF6Bc26ni3yeLvJV8SvhBZClem pkphgZhF+DFbL1HJpypZj5cRPxJ84cFYDKGw2mTtCSKPQMH1Hw+ecpMwIWGD9KfMYLoo vM6Bso02i+kPFdqelFvUdHGVBUTr3zoUVt1i++WX2QsGcL/EbRiazo3TgbBy+MB+pCaq Ufpg== X-Gm-Message-State: AJcUukfN9024iFZGRPj3XvfGNpNowyT5dJugNzTdjABx2dqvwhXnFwOb fM6nJXFUOh6TwGIi7d9CyJvJ742y9JBiPA== X-Received: by 2002:adf:dbcb:: with SMTP id e11mr11066521wrj.58.1548408993535; Fri, 25 Jan 2019 01:36:33 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:bcd4:806e:230a:673e]) by smtp.gmail.com with ESMTPSA id w80sm92323955wme.38.2019.01.25.01.36.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jan 2019 01:36:32 -0800 (PST) From: Ard Biesheuvel To: linux-crypto@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, herbert@gondor.apana.org.au, ebiggers@kernel.org, Ard Biesheuvel Subject: [PATCH 0/2] crypto: arm64 - expose PMULL variants as separate algos Date: Fri, 25 Jan 2019 10:36:25 +0100 Message-Id: <20190125093627.14288-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Both the GHASH and the CRC-T10DIF SIMD routines are based on 64-bit polynomial multiplication, but fall back to the slower 8-bit polynomial instructions if the optional 64-bit PMULL instruction is not implemented. This means we can only ever test one of the two on a single system, which is unfortunate. So instead, register both versions on hardware that supports them, and let the crypto API decide which is the preferred one based on priorities. That way, both will be tested, but only the fastest available one will be used. Ard Biesheuvel (2): crypto: arm64/crct10dif - register PMULL variants as separate algos crypto: arm64/ghash - register PMULL variants as separate algos arch/arm64/crypto/crct10dif-ce-glue.c | 54 +++++++-- arch/arm64/crypto/ghash-ce-glue.c | 118 +++++++++++++++----- 2 files changed, 132 insertions(+), 40 deletions(-) -- 2.17.1