summary refs log tree commit diff stats
path: root/hw/intc/xics_spapr.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2019-03-14 07:38:55 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2019-03-19 15:20:14 +1100
commitebc184be647259ad1f684da8205afb405834b421 (patch)
tree8c94bc43562787c712dee74b2cb203aeffcf1090 /hw/intc/xics_spapr.c
parentf3e971ac9b64067ec94aab11653f92f74ca084aa (diff)
downloadfocaccia-qemu-ebc184be647259ad1f684da8205afb405834b421.tar.gz
focaccia-qemu-ebc184be647259ad1f684da8205afb405834b421.zip
ppc/xics/spapr: Fix H_IPOLL implementation
H_IPOLL takes the CPU# of the processor to poll as an argument,
it doesn't operate on self.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20190314063855.27890-1-clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/intc/xics_spapr.c')
-rw-r--r--hw/intc/xics_spapr.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/intc/xics_spapr.c b/hw/intc/xics_spapr.c
index 607e1c167b..9d2b8adef7 100644
--- a/hw/intc/xics_spapr.c
+++ b/hw/intc/xics_spapr.c
@@ -95,8 +95,15 @@ static target_ulong h_eoi(PowerPCCPU *cpu, SpaprMachineState *spapr,
 static target_ulong h_ipoll(PowerPCCPU *cpu, SpaprMachineState *spapr,
                             target_ulong opcode, target_ulong *args)
 {
+    ICPState *icp = xics_icp_get(XICS_FABRIC(spapr), args[0]);
     uint32_t mfrr;
-    uint32_t xirr = icp_ipoll(spapr_cpu_state(cpu)->icp, &mfrr);
+    uint32_t xirr;
+
+    if (!icp) {
+        return H_PARAMETER;
+    }
+
+    xirr = icp_ipoll(icp, &mfrr);
 
     args[0] = xirr;
     args[1] = mfrr;