[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 09/19] spapr: add support for the SET_OS_PENDING
From: |
Cédric Le Goater |
Subject: |
[Qemu-devel] [PATCH v2 09/19] spapr: add support for the SET_OS_PENDING command (XIVE) |
Date: |
Sat, 9 Dec 2017 09:43:28 +0100 |
This command offers the possibility for the O/S to adjust the IPB to
allow a CPU to process event queues of other priorities during one
physical interrupt cycle. This is not currently used by the XIVE
support for sPAPR in Linux but it is by the hypervisor.
More from Ben :
It's a way to avoid the SW replay on EOI.
IE, assume you have 2 interrupts in the queue. You take the exception,
ack the first one, process it etc... Then you EOI, the HW won't send
a second notification. You need to look at the queue and continue
consuming until it's empty.
Today Linux checks the queue on EOI and use a SW mechanism to
synthesize a new pseudo-external interrupt.
This MMIO command would allow the OS to instead set back the
corresponding priority bit to 1 in the IPB and cause the HW to
re-emit the interrupt instead of SW.
Linux doesn't use this today because DD1 didn't support it for the
HV level, but other OSes might and we also might use it when we do
groups, thus allowing redistribution.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/intc/spapr_xive.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/hw/intc/spapr_xive.c b/hw/intc/spapr_xive.c
index a8acfee740d9..38e1f569ea82 100644
--- a/hw/intc/spapr_xive.c
+++ b/hw/intc/spapr_xive.c
@@ -166,9 +166,23 @@ static bool spapr_xive_tm_is_readonly(uint8_t offset)
static void spapr_xive_tm_write_special(sPAPRXiveNVT *nvt, hwaddr offset,
uint64_t value, unsigned size)
{
- /* TODO: support TM_SPC_SET_OS_PENDING */
+ switch (offset) {
+ case TM_SPC_SET_OS_PENDING:
+ if (size == 1) {
+ nvt->ring_os[TM_IPB] |= priority_to_ipb(value & 0xff);
+ nvt->ring_os[TM_PIPR] = ipb_to_pipr(nvt->ring_os[TM_IPB]);
+ spapr_xive_nvt_notify(nvt);
+ }
+ break;
+ case TM_SPC_ACK_OS_EL: /* TODO */
+ qemu_log_mask(LOG_UNIMP, "XIVE: no command to acknowledge O/S "
+ "Interrupt to even O/S reporting line\n");
+ break;
+ default:
+ qemu_log_mask(LOG_GUEST_ERROR, "XIVE: invalid TIMA write @%"
+ HWADDR_PRIx" size %d\n", offset, size);
+ }
- /* TODO: support TM_SPC_ACK_OS_EL */
}
static void spapr_xive_tm_os_write(void *opaque, hwaddr offset,
--
2.13.6
- [Qemu-devel] [PATCH v2 00/19] spapr: Guest exploitation of the XIVE interrupt controller (POWER9), Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 01/19] dma-helpers: add a return value to store helpers, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 02/19] spapr: introduce a skeleton for the XIVE interrupt controller, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 03/19] spapr: introduce the XIVE interrupt sources, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 04/19] spapr: add support for the LSI interrupt sources, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 05/19] spapr: introduce a XIVE interrupt presenter model, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 06/19] spapr: introduce the XIVE Event Queues, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 07/19] spapr: push the XIVE EQ data in OS event queue, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 08/19] spapr: notify the CPU when the XIVE interrupt priority is more privileged, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 09/19] spapr: add support for the SET_OS_PENDING command (XIVE),
Cédric Le Goater <=
- [Qemu-devel] [PATCH v2 10/19] spapr: introduce a 'xive_exploitation' boolean to enable XIVE, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 11/19] spapr: add a sPAPRXive object to the machine, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 12/19] spapr: add hcalls support for the XIVE exploitation interrupt mode, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 13/19] spapr: add device tree support for the XIVE interrupt mode, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 14/19] spapr: introduce a helper to map the XIVE memory regions, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 15/19] spapr: add XIVE support to spapr_qirq(), Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 16/19] spapr: introduce a spapr_icp_create() helper, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 17/19] spapr: toggle the ICP depending on the selected interrupt mode, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 18/19] spapr: add support to dump XIVE information, Cédric Le Goater, 2017/12/09
- [Qemu-devel] [PATCH v2 19/19] spapr: advertise XIVE exploitation mode in CAS, Cédric Le Goater, 2017/12/09