[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [RFC PATCH 16/26] ppc/xive: notify CPU when interrupt priorit
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [RFC PATCH 16/26] ppc/xive: notify CPU when interrupt priority is more privileged |
Date: |
Wed, 5 Jul 2017 19:13:29 +0200 |
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/intc/xive.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index c3c1e9c9db2d..cda1fa18e44d 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -53,6 +53,21 @@ static uint64_t xive_icp_accept(XiveICPState *xicp)
return (nsr << 8) | xicp->tima_os[TM_CPPR];
}
+static uint8_t ipb_to_pipr(uint8_t ibp)
+{
+ return ibp ? clz32((uint32_t)ibp << 24) : 0xff;
+}
+
+static void xive_icp_notify(XiveICPState *xicp)
+{
+ xicp->tima_os[TM_PIPR] = ipb_to_pipr(xicp->tima_os[TM_IPB]);
+
+ if (xicp->tima_os[TM_PIPR] < xicp->tima_os[TM_CPPR]) {
+ xicp->tima_os[TM_NSR] |= TM_QW1_NSR_EO;
+ qemu_irq_raise(ICP(xicp)->output);
+ }
+}
+
static void xive_icp_set_cppr(XiveICPState *xicp, uint8_t cppr)
{
if (cppr > XIVE_PRIORITY_MAX) {
@@ -60,6 +75,10 @@ static void xive_icp_set_cppr(XiveICPState *xicp, uint8_t
cppr)
}
xicp->tima_os[TM_CPPR] = cppr;
+
+ /* CPPR has changed, inform the ICP which might raise an
+ * exception */
+ xive_icp_notify(xicp);
}
/*
@@ -339,6 +358,8 @@ static void xive_icp_irq(XiveICSState *xs, int lisn)
} else {
qemu_log_mask(LOG_UNIMP, "XIVE: w7 format1 not implemented\n");
}
+
+ xive_icp_notify(xicp);
}
/*
--
2.7.5
- Re: [Qemu-ppc] [RFC PATCH 13/26] ppc/xive: introduce a XIVE interrupt presenter model, (continued)
- [Qemu-ppc] [RFC PATCH 14/26] ppc/xive: add MMIO handlers to the XIVE interrupt presenter model, Cédric Le Goater, 2017/07/05
- Re: [Qemu-ppc] [RFC PATCH 14/26] ppc/xive: add MMIO handlers to the XIVE interrupt presenter model, David Gibson, 2017/07/24
- Re: [Qemu-ppc] [RFC PATCH 14/26] ppc/xive: add MMIO handlers to the XIVE interrupt presenter model, Cédric Le Goater, 2017/07/24
- Re: [Qemu-ppc] [RFC PATCH 14/26] ppc/xive: add MMIO handlers to the XIVE interrupt presenter model, David Gibson, 2017/07/25
- Re: [Qemu-ppc] [RFC PATCH 14/26] ppc/xive: add MMIO handlers to the XIVE interrupt presenter model, Cédric Le Goater, 2017/07/25
- Re: [Qemu-ppc] [RFC PATCH 14/26] ppc/xive: add MMIO handlers to the XIVE interrupt presenter model, David Gibson, 2017/07/25
- Re: [Qemu-ppc] [RFC PATCH 14/26] ppc/xive: add MMIO handlers to the XIVE interrupt presenter model, Cédric Le Goater, 2017/07/25
- Re: [Qemu-ppc] [RFC PATCH 14/26] ppc/xive: add MMIO handlers to the XIVE interrupt presenter model, David Gibson, 2017/07/25
[Qemu-ppc] [RFC PATCH 15/26] ppc/xive: push EQ data in OS event queues, Cédric Le Goater, 2017/07/05
[Qemu-ppc] [RFC PATCH 16/26] ppc/xive: notify CPU when interrupt priority is more privileged,
Cédric Le Goater <=
[Qemu-ppc] [RFC PATCH 17/26] ppc/xive: add hcalls support, Cédric Le Goater, 2017/07/05
[Qemu-ppc] [RFC PATCH 18/26] ppc/xive: add device tree support, Cédric Le Goater, 2017/07/05
[Qemu-ppc] [RFC PATCH 19/26] ppc/xive: introduce a helper to map the XIVE memory regions, Cédric Le Goater, 2017/07/05
[Qemu-ppc] [RFC PATCH 20/26] ppc/xive: introduce a helper to create XIVE interrupt source objects, Cédric Le Goater, 2017/07/05