From patchwork Mon Jan 15 16:07:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 124540 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp716620lje; Mon, 15 Jan 2018 08:08:10 -0800 (PST) X-Google-Smtp-Source: ACJfBosyuIMHPvLQBhdLyAINrGx0wrle1FbOeLO91Kq0bVX+u4SgyHNniIRiKJDrfnS7RkLObP/v X-Received: by 10.159.247.138 with SMTP id e10mr30537608pls.279.1516032489923; Mon, 15 Jan 2018 08:08:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516032489; cv=none; d=google.com; s=arc-20160816; b=A2vDdGyjmJBOHv5W3VxERLLbFaNMfAnxKij/Sm9DCXD61raYwf8HHqFleEmKfwY/j6 ox6ODUBzxpKapt6A7OGPqE6Jv1SjI8xlcA74hJnZrcmdVnjlZeLoyQkzO0RcwRf5TWTB d8wsBCRb2RwWNo4YB0jZCOOS902Qn6zdHJPP7esXV9rXRhg+P0Nz6irsb9m27oD4M92o RXyB2xanI6GQ2MakyrGSwYjxk9dsOgJ7VufRkKN/dI1R4lpzhk7PWQzMn1+rnImnIF5Q EB34kQuJn4f+aT4UOqQdGio7AVFcRkmb8KebeoZC9Z2E7Hv6YQheBHjhIc7X8QQfi7It x2Fg== 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=WXFCIhDF59F2Z7fmbwVzyZm9D1t9DFGHFBQPeWZofJw=; b=iAn9VsE/tBAtWGCrTXTJ+lJ9YKrT5uVIB6fAoyYZ0kbQqonYQfrQSe2WFh78gSl1vt mnSg3P8615kHBOMqCnCcUVu6qqZUWpFHL42gMR8vaJZqsLL9i69OqMutcvrxHcKatIeS J2wKhseHZHH2HyBr93+lCxq6wLb3tLq3/fwkHpwmXXfJWXgaTzCBX0gvJhW1EOI2rF0z 97ua7lz25JIVYlEk5wPRlC03vQA2Uua66eTttz835ZnSrbwz3zzMDDvReLPQ9Ojt+kXR xUmcQpqhTAJlup2maFztUEP9Fhiz6VexS876vDY+D5XeXbtF960Iu1eNurSqoBHP3RzX CPRg== 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 68si5993606pfx.384.2018.01.15.08.08.09; Mon, 15 Jan 2018 08:08:09 -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 S1755906AbeAOQII (ORCPT + 1 other); Mon, 15 Jan 2018 11:08:08 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:50427 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755656AbeAOQIH (ORCPT ); Mon, 15 Jan 2018 11:08:07 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.129]) with ESMTPA (Nemesis) id 0MWcQg-1eME7S38Qc-00Xeg5; Mon, 15 Jan 2018 17:07:40 +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 v2] [v2] crypto: aes-generic - fix aes-generic regression on powerpc Date: Mon, 15 Jan 2018 17:07:22 +0100 Message-Id: <20180115160735.593519-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:TwUuDYAhBzGuzOBGw2ly3eCAc6MhoTbLV1jHVUCdwccfiJzJDdM qZTamOIYkBS0eJVqDtChCEQHucqK00QcnMvWtKz0LRzDKOiSQVyzt7A+iv5aZ2+ZsN4hl32 sebsXEz5bkEFPQCyTan6ThVZ82CIL0+wIJI/1xneHzE4XtbbNnH0A6lbjDYa856KrbHZQqe 8+43K9Zldd5C0/8Uod7mg== X-UI-Out-Filterresults: notjunk:1; V01:K0:GAw/iKDXaz8=:NSOC8/7uz1DMhSekY6goPD BFlSfNUexOZNSu8dSpOZ2GVsz3VmcWZY1Iwt2IzpKYO3paMS+ezFTqmByIX0Zy7+iVa9XMjF5 1aXkDoMA2/sj9xZY0WcY4K9KGWM3Zr6SpsJRZr01JbikjN33WBRBhLbN5QbTcbHD7QtkGmw3Z sGqi0AIpV6xlEHh7iHP/1Vk002uLduC9C9TG7ff88RupUAjAYhNS3p91ad5VSmJoiMhmYOjY2 qfG+4lBfM+WmUIWYIMu3jtJmL/ujguJEYnu/hlT/B/TInz0ElyLK8SmPTL1nrvNmTnOfwtxWq ruC2K1h8+YDY5mZapPdcR8BYrIVVOcOzwt3BuHObJ7pwKfC5IQFOPbe2u3ILaVXPnNimngZK3 WF9U5LnBfpfPWndd+UhBkEJVsa8abiK5jEDHFq9dfC5MxbLWZPxEuLVafv3JPyOoBZDCm3YGk 6t+1Wr3e76iv8xqB3axXj+8ALm/7R9wT1Lwrps7jZKvAJJsHtw1XC1/N+v2xZoTzfI+NBrEFu 1vKlEe41Sdl13TspLZ0T7kEFG01+4QuWRgMOpXOPYzwL3ZlUrVvulZ0OHDZl5LzDfGiRy00BP NgIfarX5xCkEf+q2uBJU0nYQvfqLUx8h67vmnySGsLO9b27n+d6kE84SuBtZl6Yecd/tSG+l0 iHhph6iMQSIqKctW2jVSd+cDqlziyJA5Syvgq0X8vzobXxKLWEugfHdyFuRKb+TbrDeuuNk8K XPjHm7r2utiqhAcBrJ8apnc26YXD/zSlcFIIig== 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 --- v2: fix a typo in the Makefile --- crypto/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 diff --git a/crypto/Makefile b/crypto/Makefile index daa69360e054..cdbc03b35510 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-hoisting) # 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