From patchwork Fri Oct 17 15:55:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrylo Tkachov X-Patchwork-Id: 400561 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8311E14003E for ; Sat, 18 Oct 2014 02:55:41 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=gaIyG86lZhjcRrlAEL0EqF5RLblYT5okUTtQPSkdCOk +Fv7MPgKadlblpeVoFTfMao2jTrbKAM/Qc3EYga1AVUoRAfXPe5dkAm0IQE7qIiz KQHI/zLuG9UcENs6BksAj8PhPoYmIGD2yruKiP5BDsY2jmGuW+tbqohbHaf6YcOk = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=khC1LropCEj8TrmRWzT9SD7hLHY=; b=H63SCIARQZkvEWKaw OQXMEIafxGQaU3m2BxjQa/LlIPAnKBKbDpbrQp9W+UwaJABWTqX0/Lv2N+Fd57nd IpizhTerZ+DnYXmYAXlKKqdZdt0Mr79i1RH94v+6KTllpX3WngUrvHFwmcLTyLo7 OIujs2DMM3wQY7v9cp9X78Se2M= Received: (qmail 15566 invoked by alias); 17 Oct 2014 15:55:19 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 15541 invoked by uid 89); 17 Oct 2014 15:55:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.2 required=5.0 tests=AWL, BAYES_00, SPF_PASS, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Oct 2014 15:55:16 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Fri, 17 Oct 2014 16:55:13 +0100 Received: from [10.1.208.24] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 17 Oct 2014 16:55:13 +0100 Message-ID: <54413BE1.8010401@arm.com> Date: Fri, 17 Oct 2014 16:55:13 +0100 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 To: GCC Patches CC: Marcus Shawcroft , Richard Earnshaw Subject: [PATCH][AArch64][4.8] Add --enable-fix-cortex-a53-835769 configure option X-MC-Unique: 114101716551333401 X-IsSubscribed: yes Hi all, This is the 4.8 backport of the configure option --enable-fix-cortex-a53-835769 to enable the workaround for the Cortex-A53 erratum 835769 by default. The patch is very similar to the trunk version, just some differences in the placement of the relevant sections. Bootstrapped and tested on aarch64-none-linux-gnu. Ok for the 4.8 branch together with the -mfix-cortex-a53-835769 option backport? Thanks, Kyrill 2014-10-17 Kyrylo Tkachov * config.gcc (aarch64*-*-*): Define TARGET_FIX_ERR_A53_835769_DEFAULT if asked. * configure.ac: Add --enable-fix-cortex-a53-835769 option. * configure: Regenerate. * config/aarch64/aarch64.c (aarch64_override_options): Handle TARGET_FIX_ERR_A53_835769_DEFAULT. * config/aarch64/aarch64.opt (mfix-cortex-a53-835769): Set Init value to 2. * doc/install.texi: Document --enable-fix-cortex-a53-835769 option. commit 14eac44c8d83489908b9abf489f0ea5d7928d32b Author: Kyrill Tkachov Date: Mon Oct 13 11:22:55 2014 +0000 [AArch64] Add --enable-fix-cortex-a53-835769 configure option diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index c18697e..4323f5a 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -4848,6 +4848,15 @@ aarch64_override_options (void) aarch64_tune = selected_tune->core; aarch64_tune_params = selected_tune->tune; + if (aarch64_fix_a53_err835769 == 2) + { +#ifdef TARGET_FIX_ERR_A53_835769_DEFAULT + aarch64_fix_a53_err835769 = 1; +#else + aarch64_fix_a53_err835769 = 0; +#endif + } + aarch64_override_options_after_change (); } diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt index f414ad4..f7c70bf 100644 --- a/gcc/config/aarch64/aarch64.opt +++ b/gcc/config/aarch64/aarch64.opt @@ -68,7 +68,7 @@ Target Report RejectNegative Mask(GENERAL_REGS_ONLY) Generate code which uses only the general registers mfix-cortex-a53-835769 -Target Report Var(aarch64_fix_a53_err835769) Init(0) +Target Report Var(aarch64_fix_a53_err835769) Init(2) Workaround for ARM Cortex-A53 Erratum number 835769 mlittle-endian diff --git a/gcc/configure b/gcc/configure index 3793681..94cce4e 100755 --- a/gcc/configure +++ b/gcc/configure @@ -910,6 +910,7 @@ with_plugin_ld enable_gnu_indirect_function enable_initfini_array enable_comdat +enable_fix_cortex_a53_835769 enable_gnu_unique_object enable_linker_build_id with_long_double_128 @@ -1619,6 +1620,14 @@ Optional Features: glibc systems --enable-initfini-array use .init_array/.fini_array sections --enable-comdat enable COMDAT group support + + --enable-fix-cortex-a53-835769 + enable workaround for AArch64 Cortex-A53 erratum + 835769 by default + --disable-fix-cortex-a53-835769 + disable workaround for AArch64 Cortex-A53 erratum + 835769 by default + --enable-gnu-unique-object enable the use of the @gnu_unique_object ELF extension on glibc systems @@ -17838,7 +17847,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17841 "configure" +#line 17850 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17944,7 +17953,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17947 "configure" +#line 17956 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -23796,6 +23805,28 @@ _ACEOF $as_echo "$gcc_cv_lto_plugin" >&6; } case "$target" in + + aarch64*-*-*) + # Enable default workaround for AArch64 Cortex-A53 erratum 835769. + # Check whether --enable-fix-cortex-a53-835769 was given. +if test "${enable_fix_cortex_a53_835769+set}" = set; then : + enableval=$enable_fix_cortex_a53_835769; + case $enableval in + yes) + tm_defines="${tm_defines} TARGET_FIX_ERR_A53_835769_DEFAULT=1" + ;; + no) + ;; + *) + as_fn_error "'$enableval' is an invalid value for --enable-fix-cortex-a53-835769.\ + Valid choices are 'yes' and 'no'." "$LINENO" 5 + ;; + + esac + +fi + + ;; # All TARGET_ABI_OSF targets. alpha*-*-linux* | alpha*-*-*bsd*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for explicit relocation support" >&5 diff --git a/gcc/configure.ac b/gcc/configure.ac index 3ee1d67..701cbf8 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3443,6 +3443,32 @@ AC_DEFINE_UNQUOTED(HAVE_LTO_PLUGIN, $gcc_cv_lto_plugin, AC_MSG_RESULT($gcc_cv_lto_plugin) case "$target" in + + aarch64*-*-*) + # Enable default workaround for AArch64 Cortex-A53 erratum 835769. + AC_ARG_ENABLE(fix-cortex-a53-835769, + [ +AS_HELP_STRING([--enable-fix-cortex-a53-835769], + [enable workaround for AArch64 Cortex-A53 erratum 835769 by default]) +AS_HELP_STRING([--disable-fix-cortex-a53-835769], + [disable workaround for AArch64 Cortex-A53 erratum 835769 by default]) + ], + [ + case $enableval in + yes) + tm_defines="${tm_defines} TARGET_FIX_ERR_A53_835769_DEFAULT=1" + ;; + no) + ;; + *) + AC_MSG_ERROR(['$enableval' is an invalid value for --enable-fix-cortex-a53-835769.\ + Valid choices are 'yes' and 'no'.]) + ;; + + esac + ], + []) + ;; # All TARGET_ABI_OSF targets. alpha*-*-linux* | alpha*-*-*bsd*) gcc_GAS_CHECK_FEATURE([explicit relocation support], diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 672d783..27c98c4 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -2982,6 +2982,8 @@ information have to. @ifhtml @itemize @item +@uref{#aarch64x-x-x,,aarch64*-*-*} +@item @uref{#alpha-x-x,,alpha*-*-*} @item @uref{#alpha-dec-osf51,,alpha*-dec-osf5.1} @@ -3124,6 +3126,18 @@ information have to.
@end html + +@heading @anchor{aarch64x-x-x}aarch64*-*-* +To enable a workaround for the Cortex-A53 erratum number 835769 by default +(for all CPUs regardless of -mcpu option given) at configure time use the +@option{--enable-fix-cortex-a53-835769} option. This will enable the fix by +default and can be explicitly disabled during during compilation by passing the +@option{-mno-fix-cortex-a53-835769} option. Conversely, +@option{--disable-fix-cortex-a53-835769} will disable the workaround by +default. The workaround is disabled by default if neither of +@option{--enable-fix-cortex-a53-835769} or +@option{--disable-fix-cortex-a53-835769} is given at configure time. + @heading @anchor{alpha-x-x}alpha*-*-* This section contains general configuration information for all