linux-stable/arch/arm/kvm
Arnd Bergmann e0c7b2b166 ARM: kvm: fix building with gcc-8
commit 67870eb120 upstream.

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.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84129
Fixes: 33280b4cd1 ("ARM: KVM: Add banked registers save/restore")
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-08 22:41:23 -08:00
..
hyp ARM: kvm: fix building with gcc-8 2018-03-08 22:41:23 -08:00
coproc.c KVM: arm: rename pm_fake handler to trap_raz_wi 2017-05-15 14:29:27 +02:00
coproc.h arm: KVM: Make unexpected register accesses inject an undef 2017-04-09 07:49:16 -07:00
coproc_a7.c arm/arm64: KVM: Use set/way op trapping to track the state of the caches 2015-01-29 23:24:56 +01:00
coproc_a15.c arm/arm64: KVM: Use set/way op trapping to track the state of the caches 2015-01-29 23:24:56 +01:00
emulate.c arm/arm64: KVM: set right LR register value for 32 bit guest when inject abort 2017-10-21 17:03:15 +02:00
guest.c KVM: arm/arm64: Allow setting the timer IRQ numbers from userspace 2017-06-08 16:59:57 +02:00
handle_exit.c arm: KVM: Fix SMCCC handling of unimplemented SMC/HVC calls 2018-02-16 20:23:03 +01:00
init.S arm: KVM: Allow unaligned accesses at HYP 2017-06-06 22:20:02 +02:00
interrupts.S ARM: hyp-stub/KVM: Kill __hyp_get_vectors 2017-04-09 07:49:34 -07:00
irq.h KVM: arm/arm64: Enable irqchip routing 2016-07-22 18:52:01 +01:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
reset.c KVM: arm/arm64: Move timer IRQ default init to arch_timer.c 2017-06-08 16:59:56 +02:00
trace.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vgic-v3-coproc.c KVM: arm/arm64: vgic: Implement VGICv3 CPU interface access 2017-01-30 13:47:25 +00:00