Received: by 10.223.176.5 with SMTP id f5csp936883wra; Fri, 2 Feb 2018 08:30:46 -0800 (PST) X-Google-Smtp-Source: AH8x226VH2L22NVaHWYcp420KXHamq3K/r1FkBxaYbF1zHSiQAN21OKdkZzE5Ac/rHaQCrYdG6tp X-Received: by 2002:a17:902:8c89:: with SMTP id t9-v6mr34363732plo.2.1517589046285; Fri, 02 Feb 2018 08:30:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517589046; cv=none; d=google.com; s=arc-20160816; b=KrrrrYZgSn3SXJLRWo03zuiA7EqIY85a7BYgH8FtX7XL1StW8HfsKe77dIFlBgSg2/ OFZitwHKJJhIiEAo4+jaUMQNEJjVeoxxyJRZ096yLaPx55oNM/AhnKmHdI503WlWCInL ot9EL2Lx1XO1Y88xPkLL8I0BqEHDs+ajLuY4wk3cEjZ6lFG3wlTPF6NwVtc34LLFPFKD lsOlQzgqupvdPC0wKRlTA6x2iWe6RkTLijpT1a+QMcR//hVTQZZgOLFz7kvJclcdaDY7 GE3fXCsEyXbk1r2b93F1YsZUbNQmj+Re/Gpb+Jx9D9p8zpHTumHLcwZdg5wwZk973pPt UU6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=D2zSMZni64kJHBctjjc3E97UfIpNBn1XQwBuLp8QXbA=; b=XQ5TIw9LaUcmxLRnA2sDpdD6pWaz5TqRaXpYmE6RkLBCLhOOnIYRo5LTGTTZ4EuKUr yWnC55E5+05Ly7s7VD/YAhZ895dnAp29U2z7iU1h3O8ACeOIWNFXbNiqtpvkM/YG5iIZ 0C2aB824eN/z2k/Ddhp28pFyCvB9aGZ7zNkToKnym+XuEq8b3THXoRY9dInWGtQpUAgY Cn9zauUJKe147+5yMbym6hJYpw+x3RNubhyX5g43NZX+JQURg1dwUu+S0vRHYOTUgfTp rdqoM9N4AkDHYbyofVMUroLdzBdPeCGdg+xSBQ7p8HzvJWQjKtqaG3CZw79htPAAY1If i2MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=N8foRH4S; 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 q20-v6si2071476pll.300.2018.02.02.08.30.30; Fri, 02 Feb 2018 08:30: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=fail header.i=@gmail.com header.s=20161025 header.b=N8foRH4S; 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 S1752169AbeBBQ3I (ORCPT + 99 others); Fri, 2 Feb 2018 11:29:08 -0500 Received: from mail-oi0-f66.google.com ([209.85.218.66]:33235 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751708AbeBBQ3C (ORCPT ); Fri, 2 Feb 2018 11:29:02 -0500 Received: by mail-oi0-f66.google.com with SMTP id l8so16444800oig.0; Fri, 02 Feb 2018 08:29:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=D2zSMZni64kJHBctjjc3E97UfIpNBn1XQwBuLp8QXbA=; b=N8foRH4S8CNWGwHVcUAAcRkXTc5NxEYChBgE352anVqao5j9GgJ/gsp3+hSbCIR1EG yT2kURcsPiOV8INj8mzrcANgOzmV2mewg97dYE3YGldBafEIw6ssWHBW+WuaLOjVynZV 27F46EBqBHprBC3ZEK4VsH8oM5KrshiY5ItdP9qMAd+umd6KEAQ6xev9SoCgtnq6ZLPA WFCTJt5N9x1gTLa/Drf0/Zy5XXD4QB/ShHL0XdQXg+m2X3gkrDQKg114BF7IKcWg2lzI LDrFCck7VKKdLazZh8jG4Gt0XthEIvbUyyb4UWllmh/+fT7KZYviIoS5vtr7OKrYpD55 NHzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=D2zSMZni64kJHBctjjc3E97UfIpNBn1XQwBuLp8QXbA=; b=d01ZHnClJm6FLukPiPlp4Ixqrc3myJpKS6tPlXpPnyme1Zat8CTI4id9mUxq6QGev7 NvwCbRmK5s2ixLyrQIXcjd+4XH0GggxPfSf9p+nPNkCV9WQknUpQAfwjbyMbuiJVIfvm y2uBzVm5P88dIHy5MnwC1hKaVpax0cZE9NEc8/TNBHa7qefpp4QWR/d0ohie6H3e7zim kxLFlAz5sZpj4+QR8GizGEJ150DWS9hVG/thOqbKiC44f+8c2GpymaOkwUqamxWwq32A OjiNRq1q3Z3+c3ykZFHxwKMhoTfxGHcqvaZM2P11NwXWKsWJbEk3z5rRZqvEO9bVx02V xQtw== X-Gm-Message-State: AKwxytefe6WSvt/h+n2HWi5MQGzmcapoIxiZXe/IR+HwkkXclNwoBp3y QB0Br5QVZfO5VBL36J3B1tAW6Wcv33XuVC0rnUeGgg== X-Received: by 10.202.86.12 with SMTP id k12mr16209497oib.283.1517588941952; Fri, 02 Feb 2018 08:29:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.68.33 with HTTP; Fri, 2 Feb 2018 08:29:01 -0800 (PST) In-Reply-To: References: <20180202150756.420422-1-arnd@arndb.de> <2cff070a-357d-c5f5-9ec6-036d93112ce4@arm.com> From: Arnd Bergmann Date: Fri, 2 Feb 2018 17:29:01 +0100 X-Google-Sender-Auth: dpO-_TGyUozMGtkgF0PP9xOV7vs Message-ID: Subject: Re: [PATCH 1/2] ARM: kvm: fix building with gcc-8 To: Robin Murphy 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). Arnd