diff options
Diffstat (limited to 'arch/powerpc/kvm/book3s_xics.c')
-rw-r--r-- | arch/powerpc/kvm/book3s_xics.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/book3s_xics.c b/arch/powerpc/kvm/book3s_xics.c index f7a103756618..94c1dd46b83d 100644 --- a/arch/powerpc/kvm/book3s_xics.c +++ b/arch/powerpc/kvm/book3s_xics.c | |||
@@ -650,6 +650,23 @@ static noinline int kvmppc_h_ipi(struct kvm_vcpu *vcpu, unsigned long server, | |||
650 | return H_SUCCESS; | 650 | return H_SUCCESS; |
651 | } | 651 | } |
652 | 652 | ||
653 | static int kvmppc_h_ipoll(struct kvm_vcpu *vcpu, unsigned long server) | ||
654 | { | ||
655 | union kvmppc_icp_state state; | ||
656 | struct kvmppc_icp *icp; | ||
657 | |||
658 | icp = vcpu->arch.icp; | ||
659 | if (icp->server_num != server) { | ||
660 | icp = kvmppc_xics_find_server(vcpu->kvm, server); | ||
661 | if (!icp) | ||
662 | return H_PARAMETER; | ||
663 | } | ||
664 | state = ACCESS_ONCE(icp->state); | ||
665 | kvmppc_set_gpr(vcpu, 4, ((u32)state.cppr << 24) | state.xisr); | ||
666 | kvmppc_set_gpr(vcpu, 5, state.mfrr); | ||
667 | return H_SUCCESS; | ||
668 | } | ||
669 | |||
653 | static noinline void kvmppc_h_cppr(struct kvm_vcpu *vcpu, unsigned long cppr) | 670 | static noinline void kvmppc_h_cppr(struct kvm_vcpu *vcpu, unsigned long cppr) |
654 | { | 671 | { |
655 | union kvmppc_icp_state old_state, new_state; | 672 | union kvmppc_icp_state old_state, new_state; |
@@ -787,6 +804,18 @@ int kvmppc_xics_hcall(struct kvm_vcpu *vcpu, u32 req) | |||
787 | if (!xics || !vcpu->arch.icp) | 804 | if (!xics || !vcpu->arch.icp) |
788 | return H_HARDWARE; | 805 | return H_HARDWARE; |
789 | 806 | ||
807 | /* These requests don't have real-mode implementations at present */ | ||
808 | switch (req) { | ||
809 | case H_XIRR_X: | ||
810 | res = kvmppc_h_xirr(vcpu); | ||
811 | kvmppc_set_gpr(vcpu, 4, res); | ||
812 | kvmppc_set_gpr(vcpu, 5, get_tb()); | ||
813 | return rc; | ||
814 | case H_IPOLL: | ||
815 | rc = kvmppc_h_ipoll(vcpu, kvmppc_get_gpr(vcpu, 4)); | ||
816 | return rc; | ||
817 | } | ||
818 | |||
790 | /* Check for real mode returning too hard */ | 819 | /* Check for real mode returning too hard */ |
791 | if (xics->real_mode) | 820 | if (xics->real_mode) |
792 | return kvmppc_xics_rm_complete(vcpu, req); | 821 | return kvmppc_xics_rm_complete(vcpu, req); |