summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2012-12-12 19:52:05 +0100
committerMarc Zyngier <marc.zyngier@arm.com>2013-06-12 17:40:32 +0200
commitdcd2e40c1e1cce302498d16d095b0f8a30326f74 (patch)
tree4cfe34f1c08aa77a4ba14e0c4d38b3c8b044e79c /arch/arm64/kvm
parentarm64: KVM: Plug the arch timer (diff)
downloadlinux-dcd2e40c1e1cce302498d16d095b0f8a30326f74.tar.xz
linux-dcd2e40c1e1cce302498d16d095b0f8a30326f74.zip
arm64: KVM: PSCI implementation
Wire the PSCI backend into the exit handling code. Reviewed-by: Christopher Covington <cov@codeaurora.org> Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/kvm')
-rw-r--r--arch/arm64/kvm/handle_exit.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c
index c65d1154f969..4766b7f3515e 100644
--- a/arch/arm64/kvm/handle_exit.c
+++ b/arch/arm64/kvm/handle_exit.c
@@ -24,26 +24,24 @@
#include <asm/kvm_emulate.h>
#include <asm/kvm_coproc.h>
#include <asm/kvm_mmu.h>
+#include <asm/kvm_psci.h>
typedef int (*exit_handle_fn)(struct kvm_vcpu *, struct kvm_run *);
static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run)
{
- /*
- * Guest called HVC instruction:
- * Let it know we don't want that by injecting an undefined exception.
- */
- kvm_debug("hvc: %x (at %08lx)", kvm_vcpu_get_hsr(vcpu) & ((1 << 16) - 1),
- *vcpu_pc(vcpu));
- kvm_debug(" HSR: %8x", kvm_vcpu_get_hsr(vcpu));
+ if (kvm_psci_call(vcpu))
+ return 1;
+
kvm_inject_undefined(vcpu);
return 1;
}
static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run)
{
- /* We don't support SMC; don't do that. */
- kvm_debug("smc: at %08lx", *vcpu_pc(vcpu));
+ if (kvm_psci_call(vcpu))
+ return 1;
+
kvm_inject_undefined(vcpu);
return 1;
}