From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84014 invoked by alias); 7 Mar 2018 10:35:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 83998 invoked by uid 89); 7 Mar 2018 10:35:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_NUMSUBJECT,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com Received: from mail-ve1eur01on0060.outbound.protection.outlook.com (HELO EUR01-VE1-obe.outbound.protection.outlook.com) (104.47.1.60) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 07 Mar 2018 10:35:38 +0000 Received: from DB5PR08CA0031.eurprd08.prod.outlook.com (2a01:111:e400:52c3::41) by AM4PR0801MB1492.eurprd08.prod.outlook.com (2603:10a6:200:3d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Wed, 7 Mar 2018 10:35:35 +0000 Received: from VE1EUR03FT030.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::206) by DB5PR08CA0031.outlook.office365.com (2a01:111:e400:52c3::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.548.13 via Frontend Transport; Wed, 7 Mar 2018 10:35:35 +0000 Authentication-Results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=none (message not signed) header.d=none;gcc.gnu.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 217.140.96.140 as permitted sender) receiver=protection.outlook.com; client-ip=217.140.96.140; helo=nebula.arm.com; Received: from nebula.arm.com (217.140.96.140) by VE1EUR03FT030.mail.protection.outlook.com (10.152.18.66) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.527.18 via Frontend Transport; Wed, 7 Mar 2018 10:35:34 +0000 Received: from arm.com (10.1.2.79) by mail.arm.com (10.1.106.66) with Microsoft SMTP Server id 14.3.294.0; Wed, 7 Mar 2018 10:35:30 +0000 Date: Wed, 07 Mar 2018 10:35:00 -0000 From: James Greenhalgh To: Kugan Vivekanandarajah CC: "gcc-patches@gcc.gnu.org" , Richard Earnshaw , nd Subject: Re: [AARCH64] Disable pc relative literal load irrespective of TARGET_FIX_ERR_A53_84341 Message-ID: <20180307103530.GA26744@arm.com> References: <20170829113141.GA18078@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:217.140.96.140;IPV:CAL;SCL:-1;CTRY:GB;EFV:NLI;SFV:NSPM;SFS:(10009020)(979002)(39860400002)(39380400002)(376002)(396003)(346002)(2980300002)(438002)(189003)(51914003)(54534003)(199004)(377424004)(2950100002)(966005)(478600001)(8676002)(59450400001)(6916009)(6246003)(229853002)(356003)(106002)(26826003)(8936002)(72206003)(186003)(16586007)(336012)(77096007)(316002)(26005)(246002)(6306002)(55016002)(86362001)(305945005)(47776003)(93886005)(53546011)(6286002)(58126008)(2906002)(104016004)(33656002)(46406003)(76176011)(50466002)(97756001)(54906003)(15760500003)(7696005)(106466001)(4326008)(1076002)(36756003)(23726003)(5660300001)(18370500001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR0801MB1492;H:nebula.arm.com;FPR:;SPF:Pass;PTR:fw-tnat.cambridge.arm.com;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;VE1EUR03FT030;1:6CA75r0Mi0MRVAr1n5O/KUdR9rdXcZ3Mx+QTC67HPRQkZJMi9jHzxrdVqJhlAKwu6PJbXy2yfTSShQ+LmKzDNq8+C5dpJrc6JZldkrU9683T/PAUNrK5hzKJysllSTwc X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0c157186-b1e1-4d27-9d16-08d5841728e7 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(4608076)(2017052603328)(7153060);SRVR:AM4PR0801MB1492; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB1492;3:A+a9nXIdXb+uapFUbL46ehquiQ9/eTbj32zDtMFOyq/rD7UG/rj2D4Kl56Q+E/NQQluXkdNOXQfk9rOAkSqc+EXiQBWNCLqVJWeTYu0s65RhWgPYyELaPd1zAcRCOTSPrE877PNsjJF38AJ0pBzzcHpAVDSUSBEmf3WDwoy2PiJkiwFpwrFzcvelTy2ghWYJHQfDxPK+iqmJsUd1codIhXFYWq8vxd7rj3w40KnEYQuBdwm7c+w9uGzzHWRhBmsa37jdqegzSpsTkvWNqcLtkh7sI+A/zoLSAsQAsPZCH1IuxVE/MpB3+w7FsLtm5rlOVQTImc3tz4C3WgyHzwDRkSR7bmKEILquVYBnkZQN8QQ=;25:EHxIFaLY/fLhJlIC/5666xDFn5GVuIAna/wcITfqqVki64P5w07yT0bL/3JTKcy9b1wSLGGdB0MKRs36X6f8N4gbD+ZpTTRcVr4Y1McRsi1Kdvo8eI2Xrtk9n7AjV9cGeFYEr5PVj6dY7rD3ACCA0wHJ4rjZjvssMofAHJrW7FyAcMvgZslKCuF1OzpqPKzra+2vJA1RMcg/P7HJf511Zc2NrfxSWQVcdXK0L8mxlWLqbi5QnVTyfP9PqOFhRWk5dg5jPVum5Zqy4WTnvGPoqpzp8DQMLCtP7a3TWWl7wwNYSDlrBYQ5lpzE41HDoU97ouYz4hCwDtNODBqaSpzt9g== X-MS-TrafficTypeDiagnostic: AM4PR0801MB1492: X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB1492;31:bH/uU9p8+f6PGttOTcPBoSfzm5OE0O1qpV6J4Q6ouVy/e1CSa1PqLGbGLaiBy8SHGDQRWWL0lkcNMikFSlTn2Quf4fnfbpmLIjFdIEpiEI/UqYO9I9cyc9utr3QtoSwPmOeC7CYc8+b9uqvdBcPcCvTRUQTrU4eDxnaqBA6ciQxa4Pj9CbExrUlWl9KLI+hHP8Ch/+N0kkhC0ojeJUuyEP29nWOdPN9bjjkJnZ/efeE=;20:T4S3TpYkOl2xsM3dcyUFb5JOF6X1tqX0qDORFsgvx3FMLz4lkz0SxDzITVnJGvUF5tQ/L6UApJVV8pvMle/b41HgVQ2+Wtztj2uVOc4TuXTXkOVqc7Fl85PN+rPcNy1TvVBPnL4wqZvwq4VqJ86Ge3l5asBPMZnHKkALLiOXr6nFPU/gHlx+rGbRyfn8K67hu90HA5FqGqZGXpVxXRQlGjtAdFbOF+AJhc2p8vvkOOXghzh4ll2ZMOaDrmmcIPQS NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(278428928389397)(22074186197030)(166708455590820)(183786458502308); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040501)(2401047)(8121501046)(5005006)(3231220)(944501244)(52105095)(3002001)(10201501046)(93006095)(93004095)(6055026)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:AM4PR0801MB1492;BCL:0;PCL:0;RULEID:;SRVR:AM4PR0801MB1492; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB1492;4:nb8gAyUG4y05nu+qZ1ACVCpXybnDO6oa8TTeUjqmkoAMBUusRf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ikxW122nne+sTV06vAUyUk=;24:rvINrFGIiy+2g2m3OSLcxyXPGIHHi2vTKVwpMSZYfM5rtwp8yCILCDR4hrE5kDp7Kc+Ybaj8gcrl2IRt/l4POc8gEKFfpfuX2vJftonQhOk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM4PR0801MB1492;7:HZUT3RjrpnFQrIEhJic/ut92Dv3InGY7Y+NxmkOipMA3vxC844hqE8BeIpaggIusW7Nq3HiiKFAlYblY/kkhWuZJ5KUmKdUZ4q5F6Fl+NiHfk6RMpy5/SJJ2O498joYWwswzv32KRH8jIyuc6mP3wel+j+cjyvfhNfVd1UShQsCZHVw5vhu7WzIw14jyMaQWua0LS9PeMoXVVNa3NrstTCEBnM39WKasQsPVy+Fj3DHQpoQU4Qruh2BuuJKVlcAK X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2018 10:35:34.5206 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0c157186-b1e1-4d27-9d16-08d5841728e7 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[217.140.96.140];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0801MB1492 X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00311.txt.bz2 On Wed, Mar 07, 2018 at 01:58:40AM +0000, Kugan Vivekanandarajah wrote: > Hi James, > > This patch has to be backported to gcc-7 branch as the build error for > 521.wrf with LTO is there too (for the same reason). This patch has > been on trunk for some time now. So, is this OK to backport this > patch gcc-7 branch? OK. Thanks, James > On 30 August 2017 at 15:19, Kugan Vivekanandarajah > wrote: > > Hi James, > > > > On 29 August 2017 at 21:31, James Greenhalgh wrote: > >> On Tue, Jun 27, 2017 at 11:20:02AM +1000, Kugan Vivekanandarajah wrote: > >>> https://gcc.gnu.org/ml/gcc-patches/2016-03/msg00614.html added this > >>> workaround to get kernel building with when TARGET_FIX_ERR_A53_843419 > >>> is enabled. > >>> > >>> This was added to support building kernel loadable modules. In kernel, > >>> when CONFIG_ARM64_ERRATUM_843419 is selected, the relocation needed > >>> for ADRP/LDR (R_AARCH64_ADR_PREL_PG_HI21 and > >>> R_AARCH64_ADR_PREL_PG_HI21_NC are removed from the kernel to avoid > >>> loading objects with possibly offending sequence). Thus, it could only > >>> support pc relative literal loads. > >>> > >>> However, the following patch was posted to kernel to add > >>> -mpc-relative-literal-loads > >>> http://www.spinics.net/lists/arm-kernel/msg476149.html > >>> > >>> -mpc-relative-literal-loads is unconditionally added to the kernel > >>> build as can be seen from: > >>> https://github.com/torvalds/linux/blob/master/arch/arm64/Makefile > >>> > >>> Therefore this patch removes the hunk so that applications like > >>> SPECcpu2017's 521/621.wrf can be built (with LTO in this case) without > >>> -mno-pc-relative-literal-loads > >>> > >>> Bootstrapped and regression tested on aarch64-linux-gnu with no new regressions. > >>> > >>> Is this OK for trunk? > >> > >> Hi Kugan, > >> > >> I'm struggling a little to convince myself that this is correct. I think > >> the argument is that this was a workaround for one very particular issue > >> with the linux kernel module loader, which hard faults by refusing to > >> handle these relocations when in a workaround mode for Erratum 843419. > > > > Yes. > > > >> Most of these relocations won't occur because the kernel builds with > >> -mcmodel=large, but literals would always use a small model style > >> adrp/load, unless we were using -mpc-relative-literal-loads . So, this > >> workaround enabled -mpc-relative-literal-loads always when we were in > >> a workaround mode, thus allowing the kernel loader to continue. > >> > >> The argument for removing it then, is that with the kernel now always using > >> -mpc-relative-literal-loads there is no reason for this workaround to stay > >> in place. The linkers which we will use will apply the workaround if needed. > > > > Yes. > > > >> Testcases and a detailed problem report of the build failures you had seen in > >> 521.wrf would have helped me get closer to understanding this, and made > >> review substantially easier. > > > > Sorry for not being clear with this. Unfortunately 521.wrf was > > showing this error with LTO so I could not reproduce with a small > > enough test case. > > > >> Am I on the right track? > >> > >> If so, this is OK for trunk. If not, please can you expand on what is going > >> on in this patch. > > > > Thanks for the review. > > Kugan > > > >> > >> Thanks, > >> James > >> > >> > >>> > >>> Thanks, > >>> Kugan > >>> > >>> gcc/testsuite/ChangeLog: > >>> > >>> 2017-06-27 Kugan Vivekanandarajah > >>> > >>> * gcc.target/aarch64/pr63304_1.c: Remove-mno-fix-cortex-a53-843419. > >>> > >>> gcc/ChangeLog: > >>> > >>> 2017-06-27 Kugan Vivekanandarajah > >>> > >>> * config/aarch64/aarch64.c (aarch64_override_options_after_change_1): > >>> Disable pc relative literal load irrespective of TARGET_FIX_ERR_A53_84341 > >>> for default. > >> > >>