diff options
author | Cédric Le Goater <clg@kaod.org> | 2022-03-02 06:51:39 +0100 |
---|---|---|
committer | Cédric Le Goater <clg@kaod.org> | 2022-03-02 06:51:39 +0100 |
commit | 0aa2612a01f233a4a25fb89e8362baf6cf896be6 (patch) | |
tree | 843c92a177ce54f209f8f069fa35aa3405d5f938 /hw/intc/xive2.c | |
parent | aadf13abaad43dd1f8b6113e516649578af63775 (diff) |
ppc/xive: Add support for PQ state bits offload
The trigger message coming from a HW source contains a special bit
informing the XIVE interrupt controller that the PQ bits have been
checked at the source or not. Depending on the value, the IC can
perform the check and the state transition locally using its own PQ
state bits.
The following changes add new accessors to the XiveRouter required to
query and update the PQ state bits. This only applies to the PowerNV
machine. sPAPR accessors are provided but the pSeries machine should
not be concerned by such complex configuration for the moment.
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Diffstat (limited to 'hw/intc/xive2.c')
-rw-r--r-- | hw/intc/xive2.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c index 2836bbdc83..3720e70422 100644 --- a/hw/intc/xive2.c +++ b/hw/intc/xive2.c @@ -171,6 +171,24 @@ int xive2_router_get_eas(Xive2Router *xrtr, uint8_t eas_blk, uint32_t eas_idx, return xrc->get_eas(xrtr, eas_blk, eas_idx, eas); } +static +int xive2_router_get_pq(Xive2Router *xrtr, uint8_t eas_blk, uint32_t eas_idx, + uint8_t *pq) +{ + Xive2RouterClass *xrc = XIVE2_ROUTER_GET_CLASS(xrtr); + + return xrc->get_pq(xrtr, eas_blk, eas_idx, pq); +} + +static +int xive2_router_set_pq(Xive2Router *xrtr, uint8_t eas_blk, uint32_t eas_idx, + uint8_t *pq) +{ + Xive2RouterClass *xrc = XIVE2_ROUTER_GET_CLASS(xrtr); + + return xrc->set_pq(xrtr, eas_blk, eas_idx, pq); +} + int xive2_router_get_end(Xive2Router *xrtr, uint8_t end_blk, uint32_t end_idx, Xive2End *end) { @@ -480,7 +498,7 @@ do_escalation: xive_get_field32(END2_W5_ESC_END_DATA, end.w5)); } -void xive2_router_notify(XiveNotifier *xn, uint32_t lisn) +void xive2_router_notify(XiveNotifier *xn, uint32_t lisn, bool pq_checked) { Xive2Router *xrtr = XIVE2_ROUTER(xn); uint8_t eas_blk = XIVE_EAS_BLOCK(lisn); @@ -493,6 +511,28 @@ void xive2_router_notify(XiveNotifier *xn, uint32_t lisn) return; } + if (!pq_checked) { + bool notify; + uint8_t pq; + + /* PQ cache lookup */ + if (xive2_router_get_pq(xrtr, eas_blk, eas_idx, &pq)) { + /* Set FIR */ + g_assert_not_reached(); + } + + notify = xive_esb_trigger(&pq); + + if (xive2_router_set_pq(xrtr, eas_blk, eas_idx, &pq)) { + /* Set FIR */ + g_assert_not_reached(); + } + + if (!notify) { + return; + } + } + if (!xive2_eas_is_valid(&eas)) { qemu_log_mask(LOG_GUEST_ERROR, "XIVE: Invalid LISN %x\n", lisn); return; |