arm64: KVM: Fix SMCCC handling of unimplemented SMC/HVC calls
authorMarc Zyngier <marc.zyngier@arm.com>
Tue, 16 Jan 2018 10:23:47 +0000 (10:23 +0000)
committerChristoffer Dall <christoffer.dall@linaro.org>
Tue, 16 Jan 2018 16:58:51 +0000 (17:58 +0100)
commitacfb3b883f6d6a4b5d27ad7fdded11f6a09ae6dd
treebf480c94df6fdf86f424058b07fadf442b851ad1
parentf8f85dc00b7427de6222ea3955c52512315d13cd
arm64: KVM: Fix SMCCC handling of unimplemented SMC/HVC calls

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.

Cc: <stable@vger.kernel.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
arch/arm64/kvm/handle_exit.c