arm: KVM: Fix SMCCC handling of unimplemented SMC/HVC calls
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 6 Feb 2018 17:56:06 +0000 (17:56 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Feb 2018 12:21:17 +0000 (13:21 +0100)
commit51e22c571fadce7d016979cf88d8411ee03032ea
treedf0dd54946aafd16246e1728bc23bc3b6f7f02f2
parent68f2013e1ff864dad8bd09f1d346bce5535764bd
arm: KVM: Fix SMCCC handling of unimplemented SMC/HVC calls

commit 20e8175d246e9f9deb377f2784b3e7dfb2ad3e86 upstream.

KVM doesn't follow the SMCCC when it comes to unimplemented calls,
and inject an UNDEF instead of returning an error. Since firmware
calls are now used for security mitigation, they are becoming more
common, and the undef is counter productive.

Instead, let's follow the SMCCC which states that -1 must be returned
to the caller when getting an unknown function number.

Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kvm/handle_exit.c