[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 37/50] ppc/xics: extend the QOM interface to handle ICP
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 37/50] ppc/xics: extend the QOM interface to handle ICPs |
Date: |
Wed, 1 Mar 2017 15:43:52 +1100 |
From: Cédric Le Goater <address@hidden>
Let's add two new handlers for ICPs. One is to get an ICP object from
a server number and a second is to resend the irqs when needed.
The icp_resend() handler is a temporary workaround needed by the
ics-simple post_load() handler. It will be removed when the post_load
portion can be done at the machine level.
Signed-off-by: Cédric Le Goater <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/intc/xics.c | 2 +-
hw/ppc/spapr.c | 20 ++++++++++++++++++++
include/hw/ppc/xics.h | 3 +++
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index 76b50dc..f828bcb 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -216,7 +216,7 @@ static void icp_check_ipi(ICPState *ss)
qemu_irq_raise(ss->output);
}
-static void icp_resend(ICPState *ss)
+void icp_resend(ICPState *ss)
{
XICSFabric *xi = ss->xics;
XICSFabricClass *xic = XICS_FABRIC_GET_CLASS(xi);
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index bce975a..5400519 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2984,6 +2984,24 @@ static void spapr_ics_resend(XICSFabric *dev)
ics_resend(spapr->ics);
}
+static ICPState *spapr_icp_get(XICSFabric *xi, int server)
+{
+ sPAPRMachineState *spapr = SPAPR_MACHINE(xi);
+
+ return (server < spapr->xics->nr_servers) ? &spapr->xics->ss[server] :
+ NULL;
+}
+
+static void spapr_icp_resend(XICSFabric *xi)
+{
+ sPAPRMachineState *spapr = SPAPR_MACHINE(xi);
+ int i;
+
+ for (i = 0; i < spapr->xics->nr_servers; i++) {
+ icp_resend(&spapr->xics->ss[i]);
+ }
+}
+
static void spapr_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -3032,6 +3050,8 @@ static void spapr_machine_class_init(ObjectClass *oc,
void *data)
vhc->store_hpte = spapr_store_hpte;
xic->ics_get = spapr_ics_get;
xic->ics_resend = spapr_ics_resend;
+ xic->icp_get = spapr_icp_get;
+ xic->icp_resend = spapr_icp_resend;
}
static const TypeInfo spapr_machine_info = {
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 15c52f9..01ca5e2 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -193,6 +193,8 @@ typedef struct XICSFabricClass {
InterfaceClass parent;
ICSState *(*ics_get)(XICSFabric *xi, int irq);
void (*ics_resend)(XICSFabric *xi);
+ ICPState *(*icp_get)(XICSFabric *xi, int server);
+ void (*icp_resend)(XICSFabric *xi);
} XICSFabricClass;
#define XICS_IRQS_SPAPR 1024
@@ -223,5 +225,6 @@ void ics_simple_write_xive(ICSState *ics, int nr, int
server,
void ics_set_irq_type(ICSState *ics, int srcno, bool lsi);
void ics_resend(ICSState *ics);
+void icp_resend(ICPState *ss);
#endif /* XICS_H */
--
2.9.3
- [Qemu-ppc] [PULL 22/50] target/ppc: add ov32 flag in divide operations, (continued)
- [Qemu-ppc] [PULL 22/50] target/ppc: add ov32 flag in divide operations, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 42/50] ppc/xics: simplify spapr_dt_xics() interface, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 47/50] ppc/xics: move ics-simple post_load under the machine, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 27/50] ppc/xics: remove set_nr_servers() handler from XICSStateClass, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 49/50] ppc/xics: rename 'ICPState *' variables to 'icp', David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 21/50] target/ppc: add ov32 flag for multiply low insns, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 39/50] ppc/xics: simplify the cpu_setup() handler, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 08/50] pseries: Minor cleanups to HPT management hypercalls, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 12/50] target/ppc: Eliminate htab_base and htab_mask variables, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 43/50] ppc/xics: register the reset handler of ICP objects, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 37/50] ppc/xics: extend the QOM interface to handle ICPs,
David Gibson <=
- [Qemu-ppc] [PULL 30/50] ppc/xics: introduce a XICSFabric QOM interface to handle ICSs, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 23/50] target/ppc: add mcrxrx instruction, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 11/50] target/ppc: Cleanup HPTE accessors for 64-bit hash MMU, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 25/50] xics: XICS should not be a SysBusDevice, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 32/50] ppc/xics: use the QOM interface to get irqs, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 31/50] ppc/xics: use the QOM interface under the sPAPR machine, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 29/50] ppc/xics: add an InterruptStatsProvider interface to ICS and ICP objects, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 28/50] ppc/xics: store the ICS object under the sPAPR machine, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 44/50] ppc/xics: move the ICP array under the sPAPR machine, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 38/50] ppc/xics: move kernel_xics_fd out of KVMXICSState, David Gibson, 2017/02/28