[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 31/50] ppc/xics: use the QOM interface under the sPAPR
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 31/50] ppc/xics: use the QOM interface under the sPAPR machine |
Date: |
Wed, 1 Mar 2017 15:43:46 +1100 |
From: Cédric Le Goater <address@hidden>
Add 'ics_get' and 'ics_resend' handlers to the sPAPR machine. These
are relatively simple for a single ICS.
Signed-off-by: Cédric Le Goater <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/intc/xics.c | 2 +-
hw/ppc/spapr.c | 18 ++++++++++++++++++
include/hw/ppc/xics.h | 1 +
3 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index 433869a..c6bfb61 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -193,7 +193,7 @@ static void ics_reject(ICSState *ics, uint32_t nr)
}
}
-static void ics_resend(ICSState *ics)
+void ics_resend(ICSState *ics)
{
ICSStateClass *k = ICS_BASE_GET_CLASS(ics);
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 153aab4..c6cef04 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2969,6 +2969,20 @@ static void spapr_phb_placement(sPAPRMachineState
*spapr, uint32_t index,
*mmio64 = SPAPR_PCI_BASE + (index + 1) * SPAPR_PCI_MEM64_WIN_SIZE;
}
+static ICSState *spapr_ics_get(XICSFabric *dev, int irq)
+{
+ sPAPRMachineState *spapr = SPAPR_MACHINE(dev);
+
+ return ics_valid_irq(spapr->ics, irq) ? spapr->ics : NULL;
+}
+
+static void spapr_ics_resend(XICSFabric *dev)
+{
+ sPAPRMachineState *spapr = SPAPR_MACHINE(dev);
+
+ ics_resend(spapr->ics);
+}
+
static void spapr_machine_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
@@ -2977,6 +2991,7 @@ static void spapr_machine_class_init(ObjectClass *oc,
void *data)
NMIClass *nc = NMI_CLASS(oc);
HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc);
PPCVirtualHypervisorClass *vhc = PPC_VIRTUAL_HYPERVISOR_CLASS(oc);
+ XICSFabricClass *xic = XICS_FABRIC_CLASS(oc);
mc->desc = "pSeries Logical Partition (PAPR compliant)";
@@ -3014,6 +3029,8 @@ static void spapr_machine_class_init(ObjectClass *oc,
void *data)
vhc->map_hptes = spapr_map_hptes;
vhc->unmap_hptes = spapr_unmap_hptes;
vhc->store_hpte = spapr_store_hpte;
+ xic->ics_get = spapr_ics_get;
+ xic->ics_resend = spapr_ics_resend;
}
static const TypeInfo spapr_machine_info = {
@@ -3030,6 +3047,7 @@ static const TypeInfo spapr_machine_info = {
{ TYPE_NMI },
{ TYPE_HOTPLUG_HANDLER },
{ TYPE_PPC_VIRTUAL_HYPERVISOR },
+ { TYPE_XICS_FABRIC },
{ }
},
};
diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h
index 1c43305..1161d54 100644
--- a/include/hw/ppc/xics.h
+++ b/include/hw/ppc/xics.h
@@ -223,5 +223,6 @@ void ics_simple_write_xive(ICSState *ics, int nr, int
server,
void ics_set_irq_type(ICSState *ics, int srcno, bool lsi);
ICSState *xics_find_source(XICSState *icp, int irq);
+void ics_resend(ICSState *ics);
#endif /* XICS_H */
--
2.9.3
- [Qemu-ppc] [PULL 39/50] ppc/xics: simplify the cpu_setup() handler, (continued)
- [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, 2017/02/28
- [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 <=
- [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
- [Qemu-ppc] [PULL 36/50] ppc/xics: remove the XICS list of ICS, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 40/50] ppc/xics: move the cpu_setup() handler under the ICPState class, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 48/50] ppc/xics: move InterruptStatsProvider to the sPAPR machine, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 13/50] target/ppc: Manage external HPT via virtual hypervisor, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 45/50] ppc/xics: export the XICS init routines, David Gibson, 2017/02/28
- [Qemu-ppc] [PULL 26/50] ppc/xics: remove set_nr_irqs() handler from XICSStateClass, David Gibson, 2017/02/28