Received: by 10.223.176.5 with SMTP id f5csp1733633wra; Sun, 4 Feb 2018 10:46:27 -0800 (PST) X-Google-Smtp-Source: AH8x225FovNoDP/lfQrgpCfFuaguhfGokefQVSSfki8JhrE2XHbxwD+thmRBg96wmowylniEhNl9 X-Received: by 10.98.198.210 with SMTP id x79mr2289923pfk.127.1517769987262; Sun, 04 Feb 2018 10:46:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517769987; cv=none; d=google.com; s=arc-20160816; b=J3pJJrmva+40z7Gu2XMvZaknOAEJ3icZ/c8jKpnc8Ng4dEXbTQBYl/NwI075RA5aeD WdMLovFhMmeft6TTvMTYpWnApPUQhXMTvz9fzbIpCTvYEoJV04VXeAwpLQi/Y6y1cwQ8 ORJYOgC7C/1C24YX39ot8+CWVg+rUCRhc4S8NS3KytX3aPIuXfs11Odes8uBKUiKI/2r xZ/mE0qUav8ASBbdxEGaKWNR3m01G2tqUQh0PvV9yaFTz3GJtS/AgAxHIBS/cXxvjs9J a1BSxWTNtYzcyT+waB0UhCLdf2o4iMqPsIvjyoy8gQ3c+ED3b1Bs1M4uUrY6peS8EL00 Edkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ruG+A70LLloOqZ9q92C8l54X6xpRUfuKTLa2xjqPLgs=; b=UAl/bsva2eG+9LmKAalGnpmrMIj/BXubBXYSfRSLNyc79SpSmJ9jLLvgFxXYthdA1c 7dpe//s78bO5qar6AQZbVvr2dk+/ACgVavDv4AuybiVEMVo6Es56w3OkAHLPeDTeCA27 60OqhvbAnaPytH+CYnRS8VpXLQBb2BLbDNWSD5bqLS4eXeGPIPf0cm1gSJq47FOvsofR wglXLQIQepD5+VpyOkFMrAmT2eArTpGfcBwYN/xsQ8UyQEPFH2r47oeFUjWw75cLn6GF 8BBgAOlDAVMN2RI2F0YGS6k1TJLEj52XIncdMHizBxhSf4ol7xtmOCpuJQ89gKa99Al6 VYPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aYOYmzZW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11si4467155pgp.757.2018.02.04.10.46.13; Sun, 04 Feb 2018 10:46:27 -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=@linaro.org header.s=google header.b=aYOYmzZW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752180AbeBDSp1 (ORCPT + 99 others); Sun, 4 Feb 2018 13:45:27 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:55750 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751767AbeBDSpU (ORCPT ); Sun, 4 Feb 2018 13:45:20 -0500 Received: by mail-wm0-f67.google.com with SMTP id 143so22026688wma.5 for ; Sun, 04 Feb 2018 10:45:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ruG+A70LLloOqZ9q92C8l54X6xpRUfuKTLa2xjqPLgs=; b=aYOYmzZWpASgSAjRUwA6OQA+yNSMOuPpHZ9uAQSh/w4B3lFpW7R5rkuI9vKFZwuEaB +smarsLl8kVbWasfN/C2/ZuFduoaQKm+S3HzdxKP8fdiZs+Ka0uiivyJUz4l4DKxj+hd ij70nl63+fxl5EcPAlxpK+y7NGRAaNApuPmlo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ruG+A70LLloOqZ9q92C8l54X6xpRUfuKTLa2xjqPLgs=; b=i/3QtWit1fVmQl0nlsFFB/fvagPqTofc8twOVFXJNHe6wBo6syirxYRT3dJXNLMB7p DVEHf0/ZzAywFYYzTYwo/3AiF1TUSjSMjGARYc1k01tPdJ8Kidb8tLl9kRhu/XU4poUs Nu8n+hBqlcelxC4jo7sKBIwOGDfFDX2iusXToauFH5esPBbC61GK0KJ76PV5BJrNN1Jt dOARgtm4vyYKQ3a+fKFXfoZ6L6C38VOl5RDsqZwwAl3mlI+MeIFBCocglhzy17/uBgoZ QiGYREtKwUK2rJkX6RhBHOBjJn1Nd19EZE00xiKi59j/50zu6kGXv4btxOjPJ6ieJOy9 9ZpQ== X-Gm-Message-State: AKwxytdiP3G+Ex/ybmGRcaRUzutT2WT6oHiIGj9hpn13HLaNC2y4djM7 AKDWN4A+Ok2lAzxIQPuqUwFlcw== X-Received: by 10.80.174.6 with SMTP id c6mr74260533edd.263.1517769919141; Sun, 04 Feb 2018 10:45:19 -0800 (PST) Received: from localhost (x50d2404e.cust.hiper.dk. [80.210.64.78]) by smtp.gmail.com with ESMTPSA id f29sm6148743eda.43.2018.02.04.10.45.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Feb 2018 10:45:18 -0800 (PST) Date: Sun, 4 Feb 2018 19:45:17 +0100 From: Christoffer Dall To: Arnd Bergmann Cc: Marc Zyngier , Russell King , Nicolas Pitre , Andi Kleen , Richard Earnshaw , Tamar Christina , stable@vger.kernel.org, Julien Thierry , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] ARM: kvm: fix building with gcc-8 Message-ID: <20180204184517.GQ21802@cbox> References: <20180202150756.420422-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180202150756.420422-1-arnd@arndb.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Fri, Feb 02, 2018 at 04:07:34PM +0100, 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. Does "not understand" mean "ignores" or do we get an error? > > Backporting to stable kernels (4.6+) is needed to allow those to be built > with future compilers as well. This builds on the toolchains I have on my machine, so: Acked-by: Christoffer Dall Are you applying this via a tree with other fixes or would you like me to carry it in the kvmarm tree? Thanks, -Christoffer > > Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84129 > Fixes: 33280b4cd1dc ("ARM: KVM: Add banked registers save/restore") > Cc: stable@vger.kernel.org > Signed-off-by: Arnd Bergmann > --- > arch/arm/kvm/hyp/Makefile | 5 +++++ > arch/arm/kvm/hyp/banked-sr.c | 4 ++++ > 2 files changed, 9 insertions(+) > > diff --git a/arch/arm/kvm/hyp/Makefile b/arch/arm/kvm/hyp/Makefile > index 5638ce0c9524..63d6b404d88e 100644 > --- a/arch/arm/kvm/hyp/Makefile > +++ b/arch/arm/kvm/hyp/Makefile > @@ -7,6 +7,8 @@ ccflags-y += -fno-stack-protector -DDISABLE_BRANCH_PROFILING > > KVM=../../../../virt/kvm > > +CFLAGS_ARMV7VE :=$(call cc-option, -march=armv7ve) > + > obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/vgic-v2-sr.o > obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/vgic-v3-sr.o > obj-$(CONFIG_KVM_ARM_HOST) += $(KVM)/arm/hyp/timer-sr.o > @@ -15,7 +17,10 @@ obj-$(CONFIG_KVM_ARM_HOST) += tlb.o > obj-$(CONFIG_KVM_ARM_HOST) += cp15-sr.o > obj-$(CONFIG_KVM_ARM_HOST) += vfp.o > obj-$(CONFIG_KVM_ARM_HOST) += banked-sr.o > +CFLAGS_banked-sr.o += $(CFLAGS_ARMV7VE) > + > obj-$(CONFIG_KVM_ARM_HOST) += entry.o > obj-$(CONFIG_KVM_ARM_HOST) += hyp-entry.o > obj-$(CONFIG_KVM_ARM_HOST) += switch.o > +CFLAGS_switch.o += $(CFLAGS_ARMV7VE) > obj-$(CONFIG_KVM_ARM_HOST) += s2-setup.o > diff --git a/arch/arm/kvm/hyp/banked-sr.c b/arch/arm/kvm/hyp/banked-sr.c > index 111bda8cdebd..be4b8b0a40ad 100644 > --- a/arch/arm/kvm/hyp/banked-sr.c > +++ b/arch/arm/kvm/hyp/banked-sr.c > @@ -20,6 +20,10 @@ > > #include > > +/* > + * gcc before 4.9 doesn't understand -march=armv7ve, so we have to > + * trick the assembler. > + */ > __asm__(".arch_extension virt"); > > void __hyp_text __banked_save_state(struct kvm_cpu_context *ctxt) > -- > 2.9.0 >