Received: by 10.223.176.5 with SMTP id f5csp940010wra; Fri, 2 Feb 2018 08:33:38 -0800 (PST) X-Google-Smtp-Source: AH8x225grIT93WN9KGPYZyBQ3y8AKSmFmiTZsWu7P5fRrcTiYBB3q7AgsGQkWQDKEjSAaqJcvPKd X-Received: by 2002:a17:902:bb0a:: with SMTP id l10-v6mr878599pls.62.1517589218454; Fri, 02 Feb 2018 08:33:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517589218; cv=none; d=google.com; s=arc-20160816; b=FnodNK3tI4xoKLpCE/NxghJXeAHy+nWmvxp6MW8RuykzN474DS+Int4mRSw878XPpu fLbE15zpl2fGDeiHhR7QhOgD43TAUA0P69R61x2NStnNkB5dDziHUZ3+ZJSKCMBlaalc w0+XNLcBv2nXIXqn9A1Oj70/zomT+vuec9VWfGPj2XuDg+tZtTkiQ9Ur4zftNRN8sw+8 D89Br/0RCZ/KP+GxCHFZ5yYJLJUBmVWwnahmXAC2wBgqVftgQ6GFLcfsMeIPdvfzm6Ma tFODg7ZtT23BPCEj08CGS6kVYttXBSmwLAbtuvkK0Wm/vk+GhUP9a6hk/BtzQpbQs086 2oog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=NpgpR8hzWE7sunEhon3dke1VILYP4q+ZH5WrGLpkjkU=; b=GFuY+fX6IOWWBxT7SSDkM56IyY9x+a14shQPopA2JBAMGzhralxA9E7cfQMSnn5CNW vYPKHoGP70nB+xvypQlrKCTTSP2uZApeMLBTiIU9YYpJeNe58CcRs9nzQNXfx98Xx6+3 cAFsmO6bV977XflmlJ8hhDDZVYO+V7/xRGriZ98GFnWdbttPuX7pAzuEWgZMwO4yUx1V I1IuMWzMo6wmhW4CTs1F8ovo76zt2mwW8O2EguxytixN/tzdX27hSQUIVcnv5a9SQGJ7 WmebDtavCeq6I+Ltmb+ZD5WA1AQL32UmVfDgRZO1tEJHtH3VXRvfSJsfobtAZBBgIuM3 700w== ARC-Authentication-Results: i=1; mx.google.com; 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 g1si2066659pfj.237.2018.02.02.08.33.23; Fri, 02 Feb 2018 08:33:38 -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; 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 S1752292AbeBBQa6 (ORCPT + 99 others); Fri, 2 Feb 2018 11:30:58 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:33230 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751651AbeBBQax (ORCPT ); Fri, 2 Feb 2018 11:30:53 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D54411596; Fri, 2 Feb 2018 08:30:52 -0800 (PST) Received: from [10.1.210.88] (e110467-lin.cambridge.arm.com [10.1.210.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AAEBF3F24D; Fri, 2 Feb 2018 08:30:50 -0800 (PST) Subject: Re: [PATCH 1/2] ARM: kvm: fix building with gcc-8 To: Arnd Bergmann Cc: Christoffer Dall , Marc Zyngier , Russell King , Andi Kleen , Julien Thierry , Nicolas Pitre , Linux Kernel Mailing List , "# 3.4.x" , Richard Earnshaw , Tamar Christina , kvmarm@lists.cs.columbia.edu, Linux ARM References: <20180202150756.420422-1-arnd@arndb.de> <2cff070a-357d-c5f5-9ec6-036d93112ce4@arm.com> From: Robin Murphy Message-ID: <276d0fe2-c742-7c95-f549-f2e49f13baac@arm.com> Date: Fri, 2 Feb 2018 16:30:49 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/02/18 16:29, Arnd Bergmann wrote: > On Fri, Feb 2, 2018 at 5:23 PM, Robin Murphy wrote: >> On 02/02/18 15:55, Robin Murphy wrote: >>> >>> On 02/02/18 15:07, Arnd Bergmann wrote: >>>> >>>> In banked-sr.c, we use a top-level '__asm__(".arch_extension virt")' >>>> statement to allow compilation of a multi-CPU kernel for ARMv6 >>>> and older ARMv7-A that don't normally support access to the banked >>>> registers. >>>> >>>> This is considered to be a programming error by the gcc developers >>>> and will no longer work in gcc-8, where we now get a build error: >>>> >>>> /tmp/cc4Qy7GR.s:34: Error: Banked registers are not available with this >>>> architecture. -- `mrs r3,SP_usr' >>>> /tmp/cc4Qy7GR.s:41: Error: Banked registers are not available with this >>>> architecture. -- `mrs r3,ELR_hyp' >>>> /tmp/cc4Qy7GR.s:55: Error: Banked registers are not available with this >>>> architecture. -- `mrs r3,SP_svc' >>>> /tmp/cc4Qy7GR.s:62: Error: Banked registers are not available with this >>>> architecture. -- `mrs r3,LR_svc' >>>> /tmp/cc4Qy7GR.s:69: Error: Banked registers are not available with this >>>> architecture. -- `mrs r3,SPSR_svc' >>>> /tmp/cc4Qy7GR.s:76: Error: Banked registers are not available with this >>>> architecture. -- `mrs r3,SP_abt' >>>> >>>> Passign the '-march-armv7ve' flag to gcc works, and is ok here, because >>>> we know the functions won't ever be called on pre-ARMv7VE machines. >>>> Unfortunately, older compiler versions (4.8 and earlier) do not >>>> understand >>>> that flag, so we still need to keep the asm around. >>>> >>>> Backporting to stable kernels (4.6+) is needed to allow those to be built >>>> with future compilers as well. >>> >>> >>> Is "-Wa,arch=armv7-a+virt" (as we appear to do for a couple of files >>> already) viable as a possibly cleaner alternative, or is GCC itself now >>> policing the contents of inline asms? >> >> >> In fact, looking at the binutils history, any version capable of assembling >> this file should understand that (modulo my typo), so hopefully it ought to >> be feasible to replace these global asms with assembler flags entirely. > > No, this only works for .S files, not .c, since gcc starts the output with > an explicit .arch setting that overrides the command line. I think this > was done intentionally to prevent such a hack from working, and have > more reliable checks on the validity of the assembler instruction in > inline asm statements (which we try to circumvent here). Ah, I see, that is unfortunate. Thanks for clarifying. Robin.