diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2012-12-12 13:52:05 -0500 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2013-06-12 11:40:32 -0400 |
commit | dcd2e40c1e1cce302498d16d095b0f8a30326f74 (patch) | |
tree | 4cfe34f1c08aa77a4ba14e0c4d38b3c8b044e79c /arch/arm64/kvm/handle_exit.c | |
parent | 003300de6c3e51934fb52eb2677f6f4fb4996cbd (diff) |
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/handle_exit.c')
-rw-r--r-- | arch/arm64/kvm/handle_exit.c | 16 |
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 @@ | |||
24 | #include <asm/kvm_emulate.h> | 24 | #include <asm/kvm_emulate.h> |
25 | #include <asm/kvm_coproc.h> | 25 | #include <asm/kvm_coproc.h> |
26 | #include <asm/kvm_mmu.h> | 26 | #include <asm/kvm_mmu.h> |
27 | #include <asm/kvm_psci.h> | ||
27 | 28 | ||
28 | typedef int (*exit_handle_fn)(struct kvm_vcpu *, struct kvm_run *); | 29 | typedef int (*exit_handle_fn)(struct kvm_vcpu *, struct kvm_run *); |
29 | 30 | ||
30 | static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run) | 31 | static int handle_hvc(struct kvm_vcpu *vcpu, struct kvm_run *run) |
31 | { | 32 | { |
32 | /* | 33 | if (kvm_psci_call(vcpu)) |
33 | * Guest called HVC instruction: | 34 | return 1; |
34 | * Let it know we don't want that by injecting an undefined exception. | 35 | |
35 | */ | ||
36 | kvm_debug("hvc: %x (at %08lx)", kvm_vcpu_get_hsr(vcpu) & ((1 << 16) - 1), | ||
37 | *vcpu_pc(vcpu)); | ||
38 | kvm_debug(" HSR: %8x", kvm_vcpu_get_hsr(vcpu)); | ||
39 | kvm_inject_undefined(vcpu); | 36 | kvm_inject_undefined(vcpu); |
40 | return 1; | 37 | return 1; |
41 | } | 38 | } |
42 | 39 | ||
43 | static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run) | 40 | static int handle_smc(struct kvm_vcpu *vcpu, struct kvm_run *run) |
44 | { | 41 | { |
45 | /* We don't support SMC; don't do that. */ | 42 | if (kvm_psci_call(vcpu)) |
46 | kvm_debug("smc: at %08lx", *vcpu_pc(vcpu)); | 43 | return 1; |
44 | |||
47 | kvm_inject_undefined(vcpu); | 45 | kvm_inject_undefined(vcpu); |
48 | return 1; | 46 | return 1; |
49 | } | 47 | } |