]> git.itanic.dy.fi Git - linux-stable/commit
ARM: kvm: psci: fix handling of unimplemented functions
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Wed, 10 Jun 2015 14:19:24 +0000 (15:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jul 2015 16:45:40 +0000 (09:45 -0700)
commitef47083a32ef0eb4ce7d4fb6904dd0c967228c65
tree0fc7489bf4ccf2f295e4f5f51c72f17bedaf9ac2
parent13731ac9eaf1b6fd6c6329b3d35923fd2078befb
ARM: kvm: psci: fix handling of unimplemented functions

commit e2d997366dc5b6c9d14035867f73957f93e7578c upstream.

According to the PSCI specification and the SMC/HVC calling
convention, PSCI function_ids that are not implemented must
return NOT_SUPPORTED as return value.

Current KVM implementation takes an unhandled PSCI function_id
as an error and injects an undefined instruction into the guest
if PSCI implementation is called with a function_id that is not
handled by the resident PSCI version (ie it is not implemented),
which is not the behaviour expected by a guest when calling a
PSCI function_id that is not implemented.

This patch fixes this issue by returning NOT_SUPPORTED whenever
the kvm PSCI call is executed for a function_id that is not
implemented by the PSCI kvm layer.

Cc: Christoffer Dall <christoffer.dall@linaro.org>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/kvm/psci.c