Message ID | oro7pssrdz.fsf@lxoliva.fsfla.org |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp740925wrn; Thu, 16 Feb 2023 23:07:08 -0800 (PST) X-Google-Smtp-Source: AK7set/KKf9EW8uGErhg8Insam2SwHEAFCAYYp6G19V/9M/7s11fQ76l4cAlR2QvKbHhZEXMIA1u X-Received: by 2002:aa7:d585:0:b0:4ad:66b:84a5 with SMTP id r5-20020aa7d585000000b004ad066b84a5mr518122edq.22.1676617628372; Thu, 16 Feb 2023 23:07:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676617628; cv=none; d=google.com; s=arc-20160816; b=s+abWkVcnN6YorvqhGNadtlHQJ7TVPAqhOkb3rUz+TIYaIl/1ih5YgTwA8BiB6pzN9 U2uCabS4kgA7ex4Rjl5zou9B7AcslRD43rcZtCMLtbRCe8E3bzOq2gOXXSNmpQba2P7X lnN54IIsd1HQNDQWKylUVrBmGg8xKRRc0vcxYG7wNYjxUahGrnF46vtBjKvo4hCQElQu 2Tw9fupbY3zFeAQ5V5fF8GuXCclib7KCo+Qp/VuNytFERoZEx7lxPmIyXeInSDUAV2bR VHoKkuWdA3cGJXmyxU4Qd11k2d72T01T2SHb7NZd9jICXdA4qaa9ElPdnea/zGXM/sDH AWWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:date:organization:subject:cc:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=zJJ36ZvQtrPyIVAB6IBvckm2t4CtAp2ysDvd/iznrVc=; b=lCLX1INioK8pn4G4TPLK3AnvZ1l79Uth72Fbt5idxyG79cNL6kpVpyuMjdkEAZt5EP cLCspHNFh31zFQoYSlPXdAoYfcRZcpdVuNAYXRAdlOpkwWX5eDW4FdsACppVEO5AZbuF ATjMWmksGp1QEFhdfAyacy/peEkQWmMrlpoQK/VCuz5ezLWvXP1xhag5vciY3IR8ZtHN Z111Pvfui5QDO7sfENmAzhlIf7k/hrLf/+2VNAAgTxj2dORMP2hTa2AAqmM55uS6Kqs2 Ol1yiGcBLOxKBuw3aNRpLwfW2+9WXcHayfUfLUHcbT6S0Agt0PmuuUWfisCdOVe51ieJ s9Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=r2Xx4RmJ; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id m11-20020a50ef0b000000b004ad797532easi2300779eds.34.2023.02.16.23.07.08 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Feb 2023 23:07:08 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=r2Xx4RmJ; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6D47E3858D33 for <ouuuleilei@gmail.com>; Fri, 17 Feb 2023 07:07:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D47E3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676617627; bh=zJJ36ZvQtrPyIVAB6IBvckm2t4CtAp2ysDvd/iznrVc=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=r2Xx4RmJeNMYhdqu6K+N2DAxXr9vjV0gxSX4Jh3vEXZSBqBZi/sfglempj0/9HtXX MnWwtXP0YZgOBILi9CVn1hXroWmlnJ0Cqi90ZfB6ZU5Pj5is8iuhxzkM3r4+16sUV7 Xwzp2MfyltU5pPeeAaulYciITkezw1HF7nzexpEs= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTPS id BE7E83858D33 for <gcc-patches@gcc.gnu.org>; Fri, 17 Feb 2023 07:06:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE7E83858D33 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 92568116B69; Fri, 17 Feb 2023 02:06:23 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bPi91U4OpV-W; Fri, 17 Feb 2023 02:06:23 -0500 (EST) Received: from free.home (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id 51E1B116B60; Fri, 17 Feb 2023 02:06:23 -0500 (EST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 31H7603w090844 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 17 Feb 2023 04:06:00 -0300 To: gcc-patches@gcc.gnu.org Cc: nickc@redhat.com, richard.earnshaw@arm.com, ramana.gcc@gmail.com, kyrylo.tkachov@arm.com Subject: [PATCH] [arm] disable aes-1742098 mitigation for a72 combine tests Organization: Free thinker, does not speak for AdaCore Date: Fri, 17 Feb 2023 04:06:00 -0300 Message-ID: <oro7pssrdz.fsf@lxoliva.fsfla.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Alexandre Oliva via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Alexandre Oliva <oliva@adacore.com> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758061006083603579?= X-GMAIL-MSGID: =?utf-8?q?1758061006083603579?= |
Series |
[arm] disable aes-1742098 mitigation for a72 combine tests
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Alexandre Oliva
Feb. 17, 2023, 7:06 a.m. UTC
The expected asm output for aes-fuse-[12].c does not correspond to that which is generated when -mfix-cortex-a57-aes-1742098 is enabled. It was introduced after the test, and enabled by default for the selected processor. Disabling the option restores the circumstance that was tested for. Regstrapped on x86_64-linux-gnu. Tested on arm-vxworks7 (gcc-12) and arm-eabi (trunk). Ok to install? for gcc/testsuite/ChangeLog * gcc.target/arm/aes-fuse-1.c: Add -mno-fix-cortex-a57-aes-1742098. * gcc.target/arm/aes-fuse-2.c: Likewise. --- gcc/testsuite/gcc.target/arm/aes-fuse-1.c | 4 ++++ gcc/testsuite/gcc.target/arm/aes-fuse-2.c | 4 ++++ 2 files changed, 8 insertions(+)
Comments
Hi Alexandre, > -----Original Message----- > From: Alexandre Oliva <oliva@adacore.com> > Sent: Friday, February 17, 2023 7:06 AM > To: gcc-patches@gcc.gnu.org > Cc: nickc@redhat.com; Richard Earnshaw <Richard.Earnshaw@arm.com>; > ramana.gcc@gmail.com; Kyrylo Tkachov <Kyrylo.Tkachov@arm.com> > Subject: [PATCH] [arm] disable aes-1742098 mitigation for a72 combine tests > > > The expected asm output for aes-fuse-[12].c does not correspond to > that which is generated when -mfix-cortex-a57-aes-1742098 is enabled. > It was introduced after the test, and enabled by default for the > selected processor. Disabling the option restores the circumstance > that was tested for. > > Regstrapped on x86_64-linux-gnu. > Tested on arm-vxworks7 (gcc-12) and arm-eabi (trunk). Ok to install? > > for gcc/testsuite/ChangeLog > > * gcc.target/arm/aes-fuse-1.c: Add > -mno-fix-cortex-a57-aes-1742098. > * gcc.target/arm/aes-fuse-2.c: Likewise. > --- > gcc/testsuite/gcc.target/arm/aes-fuse-1.c | 4 ++++ > gcc/testsuite/gcc.target/arm/aes-fuse-2.c | 4 ++++ > 2 files changed, 8 insertions(+) > > diff --git a/gcc/testsuite/gcc.target/arm/aes-fuse-1.c > b/gcc/testsuite/gcc.target/arm/aes-fuse-1.c > index 27b08aeef7ba7..6ffb4991cca69 100644 > --- a/gcc/testsuite/gcc.target/arm/aes-fuse-1.c > +++ b/gcc/testsuite/gcc.target/arm/aes-fuse-1.c > @@ -2,6 +2,10 @@ > /* { dg-require-effective-target arm_crypto_ok } */ > /* { dg-add-options arm_crypto } */ > /* { dg-additional-options "-mcpu=cortex-a72 -O3 -dp" } */ > +/* The mitigation applies to a72 by default, and protects the CRYPTO_AES > + inputs, such as the explicit xor ops, from being combined like test used to > + expect. */ > +/* { dg-additional-options "-mno-fix-cortex-a57-aes-1742098" } */ Actually the -mcpu=cortex-a72 here is significant only in that it's one of the CPUs that enables AES/AESMC fusion. So rather than overriding this awkward part with -mno-fix-cortex-a57-aes-1742098 I'd rather just select a different CPU that enables that fusion and isn't afflicted by this workaround, such as -mcpu=cortex-a53. More broadly, I think we should be enabling tune_params::FUSE_AES_AESMC for the generic target in A profile, but that would be a non-testsuite change. Ok with changing the -mcpu option instead. Thanks, Kyrill > > #include <arm_neon.h> > > diff --git a/gcc/testsuite/gcc.target/arm/aes-fuse-2.c > b/gcc/testsuite/gcc.target/arm/aes-fuse-2.c > index 1266a28753169..b72479c0e5726 100644 > --- a/gcc/testsuite/gcc.target/arm/aes-fuse-2.c > +++ b/gcc/testsuite/gcc.target/arm/aes-fuse-2.c > @@ -2,6 +2,10 @@ > /* { dg-require-effective-target arm_crypto_ok } */ > /* { dg-add-options arm_crypto } */ > /* { dg-additional-options "-mcpu=cortex-a72 -O3 -dp" } */ > +/* The mitigation applies to a72 by default, and protects the CRYPTO_AES > + inputs, such as the explicit xor ops, from being combined like test used to > + expect. */ > +/* { dg-additional-options "-mno-fix-cortex-a57-aes-1742098" } */ > > #include <arm_neon.h> > > > -- > Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > Disinformation flourishes because many people care deeply about injustice > but very few check the facts. Ask me about <https://stallmansupport.org>
Hello, Kyrylo, On Feb 20, 2023, Kyrylo Tkachov <Kyrylo.Tkachov@arm.com> wrote: > So rather than overriding this awkward part with > -mno-fix-cortex-a57-aes-1742098 I'd rather just select a different > CPU that enables that fusion and isn't afflicted by this workaround, > such as -mcpu=cortex-a53. Sounds good to me. > Ok with changing the -mcpu option instead. Thanks, here's what I've just retested and am now checking in. [arm] avoid aes-1742098 mitigation in combine tests The expected asm output for aes-fuse-[12].c does not correspond to that which is generated when -mfix-cortex-a57-aes-1742098 is enabled. The mitigation was introduced after the test, and enabled by default for the selected processor, a72. Select a53 instead, where the migitation is not enabled by default, and all the expected fusions can take place. for gcc/testsuite/ChangeLog * gcc.target/arm/aes-fuse-1.c: Switch to -mcpu=cortex-a53. * gcc.target/arm/aes-fuse-2.c: Likewise. --- gcc/testsuite/gcc.target/arm/aes-fuse-1.c | 2 +- gcc/testsuite/gcc.target/arm/aes-fuse-2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.target/arm/aes-fuse-1.c b/gcc/testsuite/gcc.target/arm/aes-fuse-1.c index 27b08aeef7ba7..a1bbe054e0a01 100644 --- a/gcc/testsuite/gcc.target/arm/aes-fuse-1.c +++ b/gcc/testsuite/gcc.target/arm/aes-fuse-1.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_crypto_ok } */ /* { dg-add-options arm_crypto } */ -/* { dg-additional-options "-mcpu=cortex-a72 -O3 -dp" } */ +/* { dg-additional-options "-mcpu=cortex-a53 -O3 -dp" } */ #include <arm_neon.h> diff --git a/gcc/testsuite/gcc.target/arm/aes-fuse-2.c b/gcc/testsuite/gcc.target/arm/aes-fuse-2.c index 1266a28753169..ede3237ce2692 100644 --- a/gcc/testsuite/gcc.target/arm/aes-fuse-2.c +++ b/gcc/testsuite/gcc.target/arm/aes-fuse-2.c @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target arm_crypto_ok } */ /* { dg-add-options arm_crypto } */ -/* { dg-additional-options "-mcpu=cortex-a72 -O3 -dp" } */ +/* { dg-additional-options "-mcpu=cortex-a53 -O3 -dp" } */ #include <arm_neon.h>
diff --git a/gcc/testsuite/gcc.target/arm/aes-fuse-1.c b/gcc/testsuite/gcc.target/arm/aes-fuse-1.c index 27b08aeef7ba7..6ffb4991cca69 100644 --- a/gcc/testsuite/gcc.target/arm/aes-fuse-1.c +++ b/gcc/testsuite/gcc.target/arm/aes-fuse-1.c @@ -2,6 +2,10 @@ /* { dg-require-effective-target arm_crypto_ok } */ /* { dg-add-options arm_crypto } */ /* { dg-additional-options "-mcpu=cortex-a72 -O3 -dp" } */ +/* The mitigation applies to a72 by default, and protects the CRYPTO_AES + inputs, such as the explicit xor ops, from being combined like test used to + expect. */ +/* { dg-additional-options "-mno-fix-cortex-a57-aes-1742098" } */ #include <arm_neon.h> diff --git a/gcc/testsuite/gcc.target/arm/aes-fuse-2.c b/gcc/testsuite/gcc.target/arm/aes-fuse-2.c index 1266a28753169..b72479c0e5726 100644 --- a/gcc/testsuite/gcc.target/arm/aes-fuse-2.c +++ b/gcc/testsuite/gcc.target/arm/aes-fuse-2.c @@ -2,6 +2,10 @@ /* { dg-require-effective-target arm_crypto_ok } */ /* { dg-add-options arm_crypto } */ /* { dg-additional-options "-mcpu=cortex-a72 -O3 -dp" } */ +/* The mitigation applies to a72 by default, and protects the CRYPTO_AES + inputs, such as the explicit xor ops, from being combined like test used to + expect. */ +/* { dg-additional-options "-mno-fix-cortex-a57-aes-1742098" } */ #include <arm_neon.h>