[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 08/25] ppc/xive: Use the XiveFabric and XivePrese
From: |
Cédric Le Goater |
Subject: |
[Qemu-devel] [PATCH v4 08/25] ppc/xive: Use the XiveFabric and XivePresenter interfaces |
Date: |
Wed, 18 Sep 2019 18:06:28 +0200 |
Now that the machines have handlers implementing the XiveFabric and
XivePresenter interfaces, remove xive_presenter_match() and make use
of the 'match_nvt' handler of the machine.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/intc/xive.c | 48 +++++++++++++++++-------------------------------
1 file changed, 17 insertions(+), 31 deletions(-)
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index 7a15a64ed7fe..f951ad8cb08d 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -1376,30 +1376,6 @@ int xive_presenter_tctx_match(XivePresenter *xptr,
XiveTCTX *tctx,
return -1;
}
-static bool xive_presenter_match(XiveRouter *xrtr, uint8_t format,
- uint8_t nvt_blk, uint32_t nvt_idx,
- bool cam_ignore, uint8_t priority,
- uint32_t logic_serv, XiveTCTXMatch *match)
-{
- XivePresenter *xptr = XIVE_PRESENTER(xrtr);
- XivePresenterClass *xpc = XIVE_PRESENTER_GET_CLASS(xptr);
- int count;
-
- count = xpc->match_nvt(xptr, format, nvt_blk, nvt_idx, cam_ignore,
- priority, logic_serv, match);
- if (count < 0) {
- return false;
- }
-
- if (!match->tctx) {
- qemu_log_mask(LOG_UNIMP, "XIVE: NVT %x/%x is not dispatched\n",
- nvt_blk, nvt_idx);
- return false;
- }
-
- return true;
-}
-
/*
* This is our simple Xive Presenter Engine model. It is merged in the
* Router as it does not require an extra object.
@@ -1415,22 +1391,32 @@ static bool xive_presenter_match(XiveRouter *xrtr,
uint8_t format,
*
* The parameters represent what is sent on the PowerBus
*/
-static bool xive_presenter_notify(XiveRouter *xrtr, uint8_t format,
+static bool xive_presenter_notify(uint8_t format,
uint8_t nvt_blk, uint32_t nvt_idx,
bool cam_ignore, uint8_t priority,
uint32_t logic_serv)
{
+ XiveFabric *xfb = XIVE_FABRIC(qdev_get_machine());
+ XiveFabricClass *xfc = XIVE_FABRIC_GET_CLASS(xfb);
XiveTCTXMatch match = { .tctx = NULL, .ring = 0 };
- bool found;
+ int count;
- found = xive_presenter_match(xrtr, format, nvt_blk, nvt_idx, cam_ignore,
- priority, logic_serv, &match);
- if (found) {
+ /*
+ * Ask the machine to scan the interrupt controllers for a match
+ */
+ count = xfc->match_nvt(xfb, format, nvt_blk, nvt_idx, cam_ignore,
+ priority, logic_serv, &match);
+ if (count < 0) {
+ return false;
+ }
+
+ /* handle CPU exception delivery */
+ if (count) {
ipb_update(&match.tctx->regs[match.ring], priority);
xive_tctx_notify(match.tctx, match.ring);
}
- return found;
+ return count;
}
/*
@@ -1543,7 +1529,7 @@ static void xive_router_end_notify(XiveRouter *xrtr,
uint8_t end_blk,
return;
}
- found = xive_presenter_notify(xrtr, format, nvt_blk, nvt_idx,
+ found = xive_presenter_notify(format, nvt_blk, nvt_idx,
xive_get_field32(END_W7_F0_IGNORE, end.w7),
priority,
xive_get_field32(END_W7_F1_LOG_SERVER_ID, end.w7));
--
2.21.0
- [Qemu-devel] [PATCH v4 00/25] ppc/pnv: add XIVE support for KVM guests, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 01/25] ppc/xive: Introduce a XivePresenter interface, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 02/25] ppc/xive: Implement the XivePresenter interface, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 03/25] ppc/pnv: Introduce a PNV_CHIP_CPU_FOREACH() helper, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 04/25] ppc/pnv: Introduce a pnv_xive_is_cpu_enabled() helper, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 05/25] ppc/xive: Introduce a XiveFabric interface, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 06/25] ppc/pnv: Implement the XiveFabric interface, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 07/25] ppc/spapr: Implement the XiveFabric interface, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 08/25] ppc/xive: Use the XiveFabric and XivePresenter interfaces,
Cédric Le Goater <=
- [Qemu-devel] [PATCH v4 09/25] ppc/xive: Extend the TIMA operation with a XivePresenter parameter, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 10/25] ppc/pnv: Clarify how the TIMA is accessed on a multichip system, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 11/25] ppc/xive: Move the TIMA operations to the controller model, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 12/25] ppc/xive: Remove the get_tctx() XiveRouter handler, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 13/25] ppc/xive: Introduce a xive_tctx_ipb_update() helper, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 14/25] ppc/xive: Introduce helpers for the NVT id, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 15/25] ppc/xive: Synthesize interrupt from the saved IPB in the NVT, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 16/25] ppc/pnv: Remove pnv_xive_vst_size() routine, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 17/25] ppc/pnv: Dump the XIVE NVT table, Cédric Le Goater, 2019/09/18
- [Qemu-devel] [PATCH v4 18/25] ppc/pnv: Skip empty slots of the XIVE NVT table, Cédric Le Goater, 2019/09/18