From patchwork Mon Jan 15 15:55:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 124537 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp712682lje; Mon, 15 Jan 2018 07:56:31 -0800 (PST) X-Google-Smtp-Source: ACJfBotAaDio1/uSjDKd3+qV3VcXUXKWHAZi7hq7TR/tJ5FHrd1xhpxw3lBONbYAqpATn+ZCDg81 X-Received: by 10.84.247.145 with SMTP id o17mr14895049pll.269.1516031791285; Mon, 15 Jan 2018 07:56:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516031791; cv=none; d=google.com; s=arc-20160816; b=Ah/qp8OKm1laLj/rwAkAAYAXqsm0cxLsk5AuZdz0+VH3Qj2lrTLp/JS+tWrQ3ZcG0e fsJfYWBrT6ukm29cPbW7vHw69ZskK6SBphST/+pL6WP2PpSw+v4zr7MdH2LKILDEjmfV UNfuQZ5i0tQaFtKaU8jnW7HAU739r//lyVSp1MWufZnZoJECeDY0rkERTx6PmxYrApW8 /ZTDqSSowaXt80HBf3yIT3FhGbsx8Q+BX5JcwbGZK1olH1mrRrV4YRX0kvCaWnzq7www iAV1s2JHXGYCFqnG0rPTqPhHSiL5AJ664z5ZB95TM6wD3yNZtR1Q0qi7D0sKGdCrNg96 SzXA== 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 :arc-authentication-results; bh=jMLxbpNX+KblrvWYfINrv401Hc698sqw2pK/R5WqhQk=; b=AL1mP0Q0SHy/5iq1mUYnVxrQAbMjN7RCcqcBXz/m6JVGbQoTrWE4JNNTYo31G+a/A6 qxMZpCTm2PGrxp1xWTLkTdlem9UTVq8DpleH49EAL2A/ZYg8juWwTaVg4+L60gAh9v+T txbVdgowVE/fNqzEZq8GnLsURxFGXSQFYrRef457E0ijD2T3a+kZp34A58pmIiwBbcxp ny8n0gF+P2lLozje6qAT4iykbuK3o3pmjG2W3/WC6GbRES9AfiSViN/Kv+4DscjFobx5 CapAzFFzgYJ/AVhmBhcLV3v5CjP3lPbJ01UGsv09CT9IhjncYKGOxLV0NOIvN+MT4fUs G90Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g66si4461087pgc.264.2018.01.15.07.56.31; Mon, 15 Jan 2018 07:56:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934439AbeAOP43 (ORCPT + 1 other); Mon, 15 Jan 2018 10:56:29 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:51707 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933820AbeAOP43 (ORCPT ); Mon, 15 Jan 2018 10:56:29 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MEmVu-1edu8m2M82-00G2ii; Mon, 15 Jan 2018 16:56:02 +0100 From: Arnd Bergmann To: Herbert Xu , "David S. Miller" Cc: Ard Biesheuvel , Richard Biener , Jakub Jelinek , linux-crypto@vger.kernel.org, Segher Boessenkool , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH] crypto: aes-generic - fix aes-generic regression on powerpc Date: Mon, 15 Jan 2018 16:55:37 +0100 Message-Id: <20180115155550.210622-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:RBEnqiPnIGnVKkiR0PZXx1VvR2hmgtPffrSVtVc7zTfwL7Hep7z R1tt6g9Tvs12u+pwJrl87pOOfgSqJYNdJRZu+6YpGuC6yUlaib5EGNToij0gYSZ17Vnc6iL BoX+jgrjeyqdmcsa+frA1dLDJnMgzA78UyPX4NRRn/PDckDTn1d7RLEE20Jmrd6amnJrVQU tK+C7mbUGM2EE28/vgWSw== X-UI-Out-Filterresults: notjunk:1; V01:K0:AaRi+Gq0ANI=:zGWfZj6upd6jbxdWUHOsu2 R92vGTBoxRJ+Joi9o+IWmIclGiBqpqQa7icJOiz3f1kYqTIDS9ZjF+6DiFm3+Iy7VLUMy1yS7 peNJPPHoudTPoIfgG02fND3vyAm7E8d/d4cnnFeeSgwE4hSYDL4akkkljlmj9EFcL+RZnqh+a zhqPC62LO6iAo1t3KkjHZ7JXfyghJYUUS54W8h4qJ+xd+dGFxXdCsjL/l335gvOWkYxazP5uX ff/EhTcQaSUEqYqT9JQHl4VLiJJWQdbvroMqirD+yalKFEyL02Cv10H3TVij2mhIIZ9jW8tTB ZSw/2gJlS1Tu/uNm8oowCbinZvi1PDDLIzm+M3xO87c7wj1wgRzJ/N7865+WuAXzENLKa8LXL K6eAsG71lSiBzR7JshGb8tVmdL87cLuXexYoNZAk5aJHxJS31ttMyyG+YjOf/4f3ap/veliAV vfvfzxchzNeWJkduf+v2fsIiGydtCQ88iVuDpRwz6zOloInMe4jvwxAxwSMAQZaJReKNAs6wz HIftJ3GF/dADOSHlLDkHOPRH1QoFlBvQcC06Vf0/D3wV2XsQin2+Fhddd5NWskY9MclabhRVK Q+znCMPF1DPBVgAU8wfm7xqALi6J6xE0HPxhlovX4isR+dTDjaybJE7NkE+TQgAU39HJltwPG pTybjkoN+2GnuoiryZw7SNdHtJp8wdCFNDH/hLOUq+1ol4zd1ER6Av7PF6uJ2UmSeH/ME9rHe MB4puClnkQccFP514f4oLuguHLHNfCj01Z+D8g== Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org My last bugfix added -Os on the command line, which unfortunately caused a build regression on powerpc in some configurations. I've done some more analysis of the original problem and found slightly different workaround that avoids this regression and also results in better performance on gcc-7.0: -fcode-hoisting is an optimization step that got added in gcc-7 and that for all gcc-7 versions causes worse performance. This disables -fcode-hoisting on all compilers that understand the option. For gcc-7.1 and 7.2 I found the same performance as my previous patch (using -Os), in gcc-7.0 it was even better. On gcc-8 I could see no change in performance from this patch. In theory, code hoisting should not be able make things better for the AES cipher, so leaving it disabled for gcc-8 only serves to simplify the Makefile change. Reported-by: kbuild test robot Link: https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg30418.html Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356 Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83651 Fixes: 148b974deea9 ("crypto: aes-generic - build with -Os on gcc-7+") Signed-off-by: Arnd Bergmann --- crypto/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/crypto/Makefile b/crypto/Makefile index daa69360e054..4223f9965db1 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -99,7 +99,7 @@ obj-$(CONFIG_CRYPTO_TWOFISH_COMMON) += twofish_common.o obj-$(CONFIG_CRYPTO_SERPENT) += serpent_generic.o CFLAGS_serpent_generic.o := $(call cc-option,-fsched-pressure) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79149 obj-$(CONFIG_CRYPTO_AES) += aes_generic.o -CFLAGS_aes_generic.o := $(call cc-ifversion, -ge, 0701, -Os) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356 +CFLAGS_aes_generic.o := $(call cc-option,fno-code-hosting) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83356 obj-$(CONFIG_CRYPTO_AES_TI) += aes_ti.o obj-$(CONFIG_CRYPTO_CAMELLIA) += camellia_generic.o obj-$(CONFIG_CRYPTO_CAST_COMMON) += cast_common.o