diff options
author | Cédric Le Goater <clg@kaod.org> | 2019-11-25 07:58:08 +0100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2019-12-17 10:39:48 +1100 |
commit | d3eb47a2a18f850c2ebd20e50d164251ad321128 (patch) | |
tree | 3bc4a31386e26c04ffcb03abfdcea91ec0aa6f5f | |
parent | 119eaa9d11cb5245fae0a2cbe4f18dda55744dfb (diff) |
ppc/xive: Introduce a XiveFabric interface
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 <groug@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20191125065820.927-9-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r-- | hw/intc/xive.c | 10 | ||||
-rw-r--r-- | include/hw/ppc/xive.h | 22 |
2 files changed, 32 insertions, 0 deletions
diff --git a/hw/intc/xive.c b/hw/intc/xive.c index da6196ca95..1c9e58f8de 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); diff --git a/include/hw/ppc/xive.h b/include/hw/ppc/xive.h index f9aa0fa0da..b00af98877 100644 --- a/include/hw/ppc/xive.h +++ b/include/hw/ppc/xive.h @@ -400,6 +400,28 @@ int xive_presenter_tctx_match(XivePresenter *xptr, XiveTCTX *tctx, 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 */ |