Received: by 10.223.164.202 with SMTP id h10csp1829753wrb; Thu, 16 Nov 2017 05:10:46 -0800 (PST) X-Google-Smtp-Source: AGs4zMbYojJdYYBDQzfCAS5UCIox1HLPhZjpA1XkRx9GPiwDCYh4waPLRCuo8pdD3K39JOBKuIsP X-Received: by 10.98.150.19 with SMTP id c19mr1760349pfe.239.1510837846137; Thu, 16 Nov 2017 05:10:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510837846; cv=none; d=google.com; s=arc-20160816; b=vXXd2IhjGFwZJHtuBZACXgaKdXsVNeV8496upcaJeQH6EqqjZ5Vp0dLF6Q2UiE8VC5 8zUKkTye8YW/d9kTRR/2DxX0mLfF2MRzE4DGNJF+PeUt1K4SblJRLEBOH1j2V/gPgdCS jJ8FJQJ8/rEtL8A9I2ThXA00Lw/AdnwLLmy4G/xOC+Awi0MAGpNsqr0HpGq+x1McAwtj FKb3/f/DzKNc5r8ktnae5L6z5rJDq6AXsRnMbfudRifj6GgowYpy9pbQNfL0WOGQuEel MQh8VJ8bgdnpXeTvq2sWV6oMNr6ix3wTmstJJoFLRHkcvDnhwWwt0vt84W8L6Oo1mxWD /o1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=JSr0cbRueMrosAXor9dtwc8lBaAo1omHEnXHg4rxtQ4=; b=zmDv4SDLQNuvwi8FINI0YtNKzHESGLUzUHi/eMhHlduNz1xNAkHwUxEYk940/YZJf5 Rvhz+WB8OigKSC0vtdCjO7ylVUo9UcVPREU8RM2fLV6JJEWg1t4hQhm1oi9UDEnqqFfT 9HqOv3ndhn0Lf3dho8TXeUML6riT2c/JI8lxet+O8D56P2pweXaN1Q6K6bYnh37sRkPL FZ5iRBhFPKSGaSE6DkJC5uaHi1wxeVJ+mmZyEN1MkFYJZ2Zry7pbOodLjMh5D44OhEyX ITbKnQR5inQW+PPKqza/FJRi1uXBjZ4pOJIZFWmYbOnr0dKMzUFqDNWxZpN7oqdEtMqW mVkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=cPC2ehuj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 k75si934003pfg.360.2017.11.16.05.10.33; Thu, 16 Nov 2017 05:10:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=cPC2ehuj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964892AbdKPNIN (ORCPT + 91 others); Thu, 16 Nov 2017 08:08:13 -0500 Received: from mail-bn3nam01on0051.outbound.protection.outlook.com ([104.47.33.51]:19253 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S964872AbdKPNH4 (ORCPT ); Thu, 16 Nov 2017 08:07:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=JSr0cbRueMrosAXor9dtwc8lBaAo1omHEnXHg4rxtQ4=; b=cPC2ehujSjZp12NSfbNU9SMkuh1Pis4H1+OcWZdzZHSF4q2mdE9nykANYUTv0tChNHmjVWTdQoDReMo1NuAeKsw2Zbdb7ItZ15svqWZcR/9BaQV9lXtqrIqO2ENr5bdhWbn30KUUTzCXF10qWUWr//2plg9hJnRW6Ks32iwlKMg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Received: from localhost (95.26.151.157) by SN4PR0701MB3838.namprd07.prod.outlook.com (2603:10b6:803:4f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Thu, 16 Nov 2017 13:07:52 +0000 Date: Thu, 16 Nov 2017 16:07:42 +0300 From: Yury Norov To: Will Deacon Cc: Sami Tolvanen , Alex Matveev , Andi Kleen , Ard Biesheuvel , Greg Hackmann , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland , Masahiro Yamada , Maxim Kuvyrkov , Michal Marek , Nick Desaulniers , Matthias Kaehlcke Subject: Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO Message-ID: <20171116130742.wijnukjetoupi4hc@yury-thinkpad> References: <20171115213428.22559-1-samitolvanen@google.com> <20171115213428.22559-12-samitolvanen@google.com> <20171116115433.GG9361@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171116115433.GG9361@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Originating-IP: [95.26.151.157] X-ClientProxiedBy: HE1PR0102CA0015.eurprd01.prod.exchangelabs.com (2603:10a6:7:14::28) To SN4PR0701MB3838.namprd07.prod.outlook.com (2603:10b6:803:4f::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a19d6ea4-c259-4f2c-2941-08d52cf30bfc X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603258);SRVR:SN4PR0701MB3838; X-Microsoft-Exchange-Diagnostics: 1;SN4PR0701MB3838;3:ktCb5AM1CnG7Do60iJnFlO4X0AY8E57PMAHQ4OwW2sbwuDvCwTOhIcxKd17xG1MsctxGGtF8verAPF0TiSKAXKsiBRCKfNK8HX/c3Rny07N7cDkFyOKoTw5lQPUykXwYd80Ek9gPhXUO4N+39stxdZZpW8rHSWDGv+tEFLwaxzfFMvV8qMdLKBisQM1o8HvuuaU6/R28vs3SPSYyn+jCxt+Y9wIeV3jo9OEnPgCPdGQPT4bAaobw5EXG5kDIts4V;25:z9DqvZHxONSUEzIdU+5J4mkRZwriGiUk7mjsxNr0SiPulnciqSBJETkrJJToxU2sdNIxP96gbGqKhT6OgFeISm/EUX0qt4AUufMGQEq2ghu+3730fzCknp7bxzkR8/0CAoPDM3KdcybmSHI4aWghssA8m645tu2OBuXPnTBMfzy+WQfuxVhsvQmuSbr8dg2x5LI2vWIFo2EJ2bj7t4wOC/z4ggDkwm9+V0cWNv8rEkPpL0ZoYOmRUSQa1qNLXbX8bQ5NQ6wreHFUdKqz607VL/1JxQSuTfZ8VlaQcmLIBNlymE+zhYE44ohOaaYO3WjhvqEhpcpiyBc9Nso/sP33xw==;31:pWsJ74RBiyIVqgVxuuM0rTMTALgMhX/vn0PjZ+pyD9UTGonoeCL9ZSEpdUYWSyQAj6Ga3aCU3H1OlMhdEHirKmnCszXfuwPEP4ZsBz9Wutz3ObPypw1cIM6wOhxXr+3bZTEVW3HplhV0UoY1TSi6QVnS2kAY0aYfrcV7QbsFzwPHZCbLMa8Pz9NZt68SKhkCdwqLJtADDFq9HSOrhu3au0dFMpRuf2HIsElhvmb4B4w= X-MS-TrafficTypeDiagnostic: SN4PR0701MB3838: X-Microsoft-Exchange-Diagnostics: 1;SN4PR0701MB3838;20:GEKqGxQSFFDolzPoDeCwv8AQkRqeFDtxs6I8QddZAjsb+shVDTciEoBsLtkesI96hXY0eAjthSEgM3aKQPPyOvaHadK2x2AzrFZqXQUHBkANrHBciduy/KaHvCaWbwShEzWfecFAtqkLhdvANQx/6EIAO7zyGjPs9dGMSyyzTZKWmtZBB2TIEHZVmZlckKvt9sL37qccC1u6F3RvvcTQJCzYe1mC2OaTwjlIrARmtXRq/19l4ITCt8ZldX3wNBwtWJAD1hlBQdPyQGnjufwkmWwg29eSl0O2LHP3Wcog3rIclGw9tpi/BBHDaOEa1o/701dfh4P1K5b/gZBDJjAuX1PZ2Ju0WPg4ihjwfzPK4I0zWqTkvnFO/hxe+dq/a2QW9MKsCNNQMLruQL2U0mUk6O1pWten9MFC1mdt95XJxlnB0P6ImIP4zzgBmN6fOZie0Lu6sOql7dmxuedD61FNGRO4hNFk8WZHpwDrJhOP7rNwMwVMe22zV2rwKI6TMqsxGmSrzKY/NpMC283Mw5hubcC1fstRvNiO3AV7svoc2NyRJtq1I+G9nhlwgi+ViEa5n4l9HQv5Tl/MxbDCxvIyz77HeVr0K8Uk/+gAxfsnjws= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(166708455590820)(262104967686372); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(3231022)(100000703101)(100105400095)(6041248)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN4PR0701MB3838;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN4PR0701MB3838; X-Microsoft-Exchange-Diagnostics: 1;SN4PR0701MB3838;4:2Rjx1G3EJ740AyVBITBKXw7FJL+Q1qWn1TuvV0+AQBVe9BDV/ayGVZT/YrA/LD4VRdtu/49O+BQTpvmxsyuVBbuYYqqtsz7UuCi5hHmyeNZ/B1bhwPMf2Qsu2BpOyPHjB+NcSX0P8BOLukWDkb39xm/AsRGiEKzf8Tf0/JMjur/BXe+JecW1G8dO33kTkN3Z8aO18pzzBiznnegEDtxPTTX2+Y/YSAJvwa5DB/juutzSdomgqJeqAtZY+kQN4wZuC6Zp41YTAv3qWvU9XvOcCGpKq/j7YEOD7pfmmDbNb4CvtOJ88pKg91D5StMW3G1jELU+cCQZrJnV/k90thrUCEFyOy0uonnl5Ac91q6ccbQ= X-Forefront-PRVS: 0493852DA9 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(6009001)(7916004)(376002)(346002)(189002)(199003)(24454002)(229853002)(305945005)(25786009)(7736002)(2906002)(16526018)(83506002)(189998001)(23726003)(81156014)(6116002)(97736004)(1076002)(3846002)(8936002)(16586007)(6486002)(54906003)(316002)(72206003)(33716001)(81166006)(58126008)(8676002)(54356999)(50986999)(106356001)(47776003)(966005)(105586002)(478600001)(68736007)(50466002)(5660300001)(7416002)(101416001)(2950100002)(9686003)(53936002)(39060400002)(6306002)(76176999)(6666003)(6496005)(42882006)(76506005)(4326008)(66066001)(33646002)(6916009)(6246003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN4PR0701MB3838;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN4PR0701MB3838;23:pZv0Z/hcv+AMgabe+lSVGrmvprZQ9laIDLF+Z3p?= =?us-ascii?Q?y7q7fjOUqYkp2Hc7KZ8ak4hItxXwhkA22MFx5kc8KQ/uRdy4dCcBHn05Jkwk?= =?us-ascii?Q?QHivLmg38Oo0hStzotsPvHqqKNfrc08G4QCKiYO/QqyjasXl7QjAR+HP6LKW?= =?us-ascii?Q?SEBSWlOHWB6L8zPEOQ/jclnnWfGovkVRhIHkxemIeqWiUS0BfiusbBuQrPxy?= =?us-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tLHCyuNLwH2vMJ+gHvDrwjTD6Np3qsOFVLXVHutgca8zSEH0XPSz5OZ3ktAUzMTl7Ks157BBg/qIGwtx/6O7IrmTDpr4ABz6zoZCjSJokpIzDWazcWCSVF+MrbP+Ik//zjlYE3g83IZVfcsYTYH/LERbW4fWDk4o7RiQFJUABih/i9TE0F7hJoK5rw4oejQzU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Nov 2017 13:07:52.8168 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a19d6ea4-c259-4f2c-2941-08d52cf30bfc X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0701MB3838 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 16, 2017 at 11:54:33AM +0000, Will Deacon wrote: > On Wed, Nov 15, 2017 at 01:34:21PM -0800, Sami Tolvanen wrote: > > From: Alex Matveev > > > > Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros > > in-place and workaround gcc and clang limitations on redefining macros > > across different assembler blocks. > > What limitations? Can you elaborate please? Is this a fix? Hi Will, Regarding GCC. When it joins preprocessed source files into single asm file, mrs_s/msr_s becomes either not declared or declared multiple times. ./ccuFb68h.s:33120: Error: Macro `mrs_s' was already defined ./ccuFb68h.s:33124: Error: Macro `msr_s' was already defined I'm not sure that GCC works correctly in this case, and I sent the email to Linaro toolchain group to clarify it. See below. Yury [...] Links: My unfinished branch: https://github.com/norov/linux/tree/lto Andi Kleen tree: https://github.com/andikleen/linux-misc/tree/lto-411-1 Sami Tolvanen's recent work for clang: https://lkml.org/lkml/2017/11/3/606 Question we have for now: There's mrs_s/msr_s macro that doesn't work with LTO - linker complains very loudly that macro is either not declared, or declared multiple times. (To reproduce - try to build my kernel branch w/o last patch). The same (?) problem is observed with clang, and people there considered it as feature, not a bug. https://bugs.llvm.org/show_bug.cgi?id=19749 We have the fix for both clang and gcc, but it looks hacky. Maybe it worth to fix mrs/msr issue on toolchain side? From 1584172678511586509@xxx Wed Nov 15 22:26:36 +0000 2017 X-GM-THRID: 1584172678511586509 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread