[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 08/20] ppc/xive: Introduce a XiveFabric interface
From: |
Cédric Le Goater |
Subject: |
[PATCH v6 08/20] ppc/xive: Introduce a XiveFabric interface |
Date: |
Mon, 25 Nov 2019 07:58:08 +0100 |
The XiveFabric QOM interface acts as the PowerBUS interface between
the interrupt controller and the system and should be implemented by
the QEMU machine. On HW, the XIVE sub-engine is responsible for the
communication with the other chip is the Common Queue (CQ) bridge
unit.
This interface offers a 'match_nvt' handler to perform the CAM line
matching when looking for a XIVE Presenter with a dispatched NVT.
Reviewed-by: Greg Kurz <address@hidden>
Signed-off-by: Cédric Le Goater <address@hidden>
---
include/hw/ppc/xive.h | 22 ++++++++++++++++++++++
hw/intc/xive.c | 10 ++++++++++
2 files changed, 32 insertions(+)
diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h
index f9aa0fa0dac3..b00af988779b 100644
--- a/include/hw/ppc/xive.h
+++ b/include/hw/ppc/xive.h
@@ -399,6 +399,28 @@ int xive_presenter_tctx_match(XivePresenter *xptr,
XiveTCTX *tctx,
uint8_t nvt_blk, uint32_t nvt_idx,
bool cam_ignore, uint32_t logic_serv);
+/*
+ * XIVE Fabric (Interface between Interrupt Controller and Machine)
+ */
+
+typedef struct XiveFabric XiveFabric;
+
+#define TYPE_XIVE_FABRIC "xive-fabric"
+#define XIVE_FABRIC(obj) \
+ INTERFACE_CHECK(XiveFabric, (obj), TYPE_XIVE_FABRIC)
+#define XIVE_FABRIC_CLASS(klass) \
+ OBJECT_CLASS_CHECK(XiveFabricClass, (klass), TYPE_XIVE_FABRIC)
+#define XIVE_FABRIC_GET_CLASS(obj) \
+ OBJECT_GET_CLASS(XiveFabricClass, (obj), TYPE_XIVE_FABRIC)
+
+typedef struct XiveFabricClass {
+ InterfaceClass parent;
+ int (*match_nvt)(XiveFabric *xfb, uint8_t format,
+ uint8_t nvt_blk, uint32_t nvt_idx,
+ bool cam_ignore, uint8_t priority,
+ uint32_t logic_serv, XiveTCTXMatch *match);
+} XiveFabricClass;
+
/*
* XIVE END ESBs
*/
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index da6196ca958f..1c9e58f8deac 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -1893,8 +1893,18 @@ static const TypeInfo xive_presenter_info = {
.class_size = sizeof(XivePresenterClass),
};
+/*
+ * XIVE Fabric
+ */
+static const TypeInfo xive_fabric_info = {
+ .name = TYPE_XIVE_FABRIC,
+ .parent = TYPE_INTERFACE,
+ .class_size = sizeof(XiveFabricClass),
+};
+
static void xive_register_types(void)
{
+ type_register_static(&xive_fabric_info);
type_register_static(&xive_source_info);
type_register_static(&xive_notifier_info);
type_register_static(&xive_presenter_info);
--
2.21.0
- [PATCH v6 02/20] ppc/xive: Implement the XivePresenter interface, (continued)
- [PATCH v6 02/20] ppc/xive: Implement the XivePresenter interface, Cédric Le Goater, 2019/11/25
- [PATCH v6 01/20] ppc/xive: Introduce a XivePresenter interface, Cédric Le Goater, 2019/11/25
- [PATCH v6 03/20] ppc/pnv: Instantiate cores separately, Cédric Le Goater, 2019/11/25
- [PATCH v6 04/20] ppc/pnv: Loop on the threads of the chip to find a matching NVT, Cédric Le Goater, 2019/11/25
- [PATCH v6 05/20] ppc: Introduce a ppc_cpu_pir() helper, Cédric Le Goater, 2019/11/25
- [PATCH v6 06/20] ppc/pnv: Introduce a pnv_xive_is_cpu_enabled() helper, Cédric Le Goater, 2019/11/25
- [PATCH v6 07/20] ppc/pnv: Fix TIMA indirect access, Cédric Le Goater, 2019/11/25
- [PATCH v6 08/20] ppc/xive: Introduce a XiveFabric interface,
Cédric Le Goater <=
- [PATCH v6 09/20] ppc/pnv: Implement the XiveFabric interface, Cédric Le Goater, 2019/11/25
- [PATCH v6 10/20] ppc/spapr: Implement the XiveFabric interface, Cédric Le Goater, 2019/11/25
- [PATCH v6 11/20] ppc/xive: Use the XiveFabric and XivePresenter interfaces, Cédric Le Goater, 2019/11/25
- [PATCH v6 12/20] ppc/xive: Extend the TIMA operation with a XivePresenter parameter, Cédric Le Goater, 2019/11/25
- [PATCH v6 13/20] ppc/pnv: Clarify how the TIMA is accessed on a multichip system, Cédric Le Goater, 2019/11/25