linux-brain/arch/arm/kvm/hyp
Arnd Bergmann aebf1b12ff 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-11 16:21:29 +01:00
..
Makefile ARM: kvm: fix building with gcc-8 2018-03-11 16:21:29 +01:00
banked-sr.c ARM: kvm: fix building with gcc-8 2018-03-11 16:21:29 +01:00
cp15-sr.c ARM: KVM: Move kvm/hyp/hyp.h to include/asm/kvm_hyp.h 2016-02-29 18:34:18 +00:00
entry.S arm: KVM: Handle async aborts delivered while at HYP 2016-09-08 12:53:00 +02:00
hyp-entry.S arm: KVM: Handle async aborts delivered while at HYP 2016-09-08 12:53:00 +02:00
s2-setup.c ARM: KVM: Move kvm/hyp/hyp.h to include/asm/kvm_hyp.h 2016-02-29 18:34:18 +00:00
switch.c KVM: arm: plug potential guest hardware debug leakage 2017-05-25 15:44:44 +02:00
tlb.c arm/arm64: KVM: Perform local TLB invalidation when multiplexing vcpus on a single CPU 2016-11-04 17:56:28 +00:00
vfp.S ARM: KVM: Add VFP save/restore 2016-02-29 18:34:13 +00:00