From patchwork Mon Nov 16 12:12:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 7624661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 914CEBF90C for ; Mon, 16 Nov 2015 12:15:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A3F64205B1 for ; Mon, 16 Nov 2015 12:15:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9AF6520431 for ; Mon, 16 Nov 2015 12:15:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyIex-0007Xa-Gz; Mon, 16 Nov 2015 12:13:23 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyIes-0007HF-LE for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2015 12:13:19 +0000 Received: by wmdw130 with SMTP id w130so108132780wmd.0 for ; Mon, 16 Nov 2015 04:12:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=5AThYeDAgD47ltXic/xP6VVYqXgsRAp/mrGHmiEnJ7E=; b=JptWKdyW237edaMM0QoUoW5xPzcESjtU2IZGL+DyUgOE8ezGocErDlYlR6VX5FNuT7 1WCqzB6saTsa/cXyvHHmB78Ty27TTSSzP9m14yNR5XpO2y/7YirjDGlIGOtpeghq96QN VTDRznEIr3+Pv+GhjCQagfVRUEO7YpKUn9Gef0IJk2Q2mqjiIsRwwFn43+1OruDnIrXs 4ZlO51mMFABahvxxfPAp5Wro+HU0i+OOJp4qJksFVlyXX4/L5gKiEFAwSYgz3YO2lFBZ KhfCyyoa0guslf28YsdChfIOxpLesN+TCoKJG0wCrpYbIg4fOpuMwZagzN14UgVRAUr0 z8NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5AThYeDAgD47ltXic/xP6VVYqXgsRAp/mrGHmiEnJ7E=; b=LOOz/4C7+d9+p2WjZmvmSmVdyUDzV8SPje8nBu0eRcgwp/ehaVUvnH7Pck12Asr1jc E49mHvq0N3yhpM8MhREi1nFwW/bw2qVeGpFLCMUr56w3XfcQn+lIuwB8f70TDOFuGSQX YNmRPOirkiu+mbp49yYyvvWcjMsweaA34t1/K73GKDWUsvqKpAGr00rBdjhxebkNIqNo E9rmB6Qr4HSJPBoEQA7MofYaEO8cCXPPTkflSJR74jC6ba+GOu7MDgvLuQqWi95mMknz xMIyoW25NmSsfpHAZ3ir4m30Fmikl7JCMnfWciW1k+EXg+1tmcf4LSDiLNqCtwYYMO5g rCYw== X-Gm-Message-State: ALoCoQlzrprupoCjJ5NtQJrwYlm1ehxZuYyVwa5ALlZvXxCI76wf/PicVnic7hAZzD8ZuvLIhs5y X-Received: by 10.28.182.11 with SMTP id g11mr19406282wmf.42.1447675976997; Mon, 16 Nov 2015 04:12:56 -0800 (PST) Received: from localhost.localdomain ([47.53.155.123]) by smtp.gmail.com with ESMTPSA id ft4sm34187032wjb.37.2015.11.16.04.12.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Nov 2015 04:12:56 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com Subject: [PATCH] arm64: crypto: reduce priority of core AES cipher Date: Mon, 16 Nov 2015 13:12:48 +0100 Message-Id: <1447675968-21991-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151116_041318_861773_32B612FD X-CRM114-Status: GOOD ( 12.01 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The asynchronous, merged implementations of AES in CBC, CTR and XTS modes are preferred when available (i.e., when instantiating ablkciphers explicitly). However, the synchronous core AES cipher combined with the generic CBC mode implementation will produce a 'cbc(aes)' blkcipher that is callable asynchronously as well. To prevent this implementation from being used when the accelerated asynchronous implemenation is also available, lower its priority to 250 (i.e., below the asynchronous module's priority of 300). Signed-off-by: Ard Biesheuvel --- arch/arm64/crypto/aes-ce-cipher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/crypto/aes-ce-cipher.c b/arch/arm64/crypto/aes-ce-cipher.c index ce47792a983d..f7bd9bf0bbb3 100644 --- a/arch/arm64/crypto/aes-ce-cipher.c +++ b/arch/arm64/crypto/aes-ce-cipher.c @@ -237,7 +237,7 @@ EXPORT_SYMBOL(ce_aes_setkey); static struct crypto_alg aes_alg = { .cra_name = "aes", .cra_driver_name = "aes-ce", - .cra_priority = 300, + .cra_priority = 250, .cra_flags = CRYPTO_ALG_TYPE_CIPHER, .cra_blocksize = AES_BLOCK_SIZE, .cra_ctxsize = sizeof(struct crypto_aes_ctx),