aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/hvcall.h1
-rw-r--r--arch/powerpc/kvm/book3s_hv.c2
-rw-r--r--arch/powerpc/kvm/book3s_pr_papr.c2
-rw-r--r--arch/powerpc/kvm/book3s_xics.c29
4 files changed, 34 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h
index cf4df8e2139a..0c7f2bfcf134 100644
--- a/arch/powerpc/include/asm/hvcall.h
+++ b/arch/powerpc/include/asm/hvcall.h
@@ -264,6 +264,7 @@
264#define H_GET_MPP 0x2D4 264#define H_GET_MPP 0x2D4
265#define H_HOME_NODE_ASSOCIATIVITY 0x2EC 265#define H_HOME_NODE_ASSOCIATIVITY 0x2EC
266#define H_BEST_ENERGY 0x2F4 266#define H_BEST_ENERGY 0x2F4
267#define H_XIRR_X 0x2FC
267#define H_RANDOM 0x300 268#define H_RANDOM 0x300
268#define H_COP 0x304 269#define H_COP 0x304
269#define H_GET_MPP_X 0x314 270#define H_GET_MPP_X 0x314
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 9de24f8e03c7..550f5928b394 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -562,6 +562,8 @@ int kvmppc_pseries_do_hcall(struct kvm_vcpu *vcpu)
562 case H_CPPR: 562 case H_CPPR:
563 case H_EOI: 563 case H_EOI:
564 case H_IPI: 564 case H_IPI:
565 case H_IPOLL:
566 case H_XIRR_X:
565 if (kvmppc_xics_enabled(vcpu)) { 567 if (kvmppc_xics_enabled(vcpu)) {
566 ret = kvmppc_xics_hcall(vcpu, req); 568 ret = kvmppc_xics_hcall(vcpu, req);
567 break; 569 break;
diff --git a/arch/powerpc/kvm/book3s_pr_papr.c b/arch/powerpc/kvm/book3s_pr_papr.c
index b24309c6c2d5..da0e0bc268bd 100644
--- a/arch/powerpc/kvm/book3s_pr_papr.c
+++ b/arch/powerpc/kvm/book3s_pr_papr.c
@@ -257,6 +257,8 @@ int kvmppc_h_pr(struct kvm_vcpu *vcpu, unsigned long cmd)
257 case H_CPPR: 257 case H_CPPR:
258 case H_EOI: 258 case H_EOI:
259 case H_IPI: 259 case H_IPI:
260 case H_IPOLL:
261 case H_XIRR_X:
260 if (kvmppc_xics_enabled(vcpu)) 262 if (kvmppc_xics_enabled(vcpu))
261 return kvmppc_h_pr_xics_hcall(vcpu, cmd); 263 return kvmppc_h_pr_xics_hcall(vcpu, cmd);
262 break; 264 break;
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
653static 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
653static noinline void kvmppc_h_cppr(struct kvm_vcpu *vcpu, unsigned long cppr) 670static 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);