[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 12/13] spapr/xics: ignore the lower 4K in the IRQ numb
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH 12/13] spapr/xics: ignore the lower 4K in the IRQ number space |
Date: |
Mon, 7 Jan 2019 19:39:45 +0100 |
The IRQ number space of the XIVE and XICS interrupt mode are aligned
when using the dual interrupt mode for the machine. This means that
the ICS offset is set to zero in QEMU and that the KVM XICS device
should be informed of this new value. Unfortunately, there is now way
to do so and KVM still maintains the XICS_IRQ_BASE (0x1000) offset.
Ignore the lower 4K which are not used under the XICS interrupt
mode. These IRQ numbers are only claimed by XIVE for the CPU IPIs.
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/intc/xics_kvm.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index 651bbfdf6966..1d21ff217b82 100644
--- a/hw/intc/xics_kvm.c
+++ b/hw/intc/xics_kvm.c
@@ -238,6 +238,15 @@ static void ics_get_kvm_state(ICSState *ics)
for (i = 0; i < ics->nr_irqs; i++) {
ICSIRQState *irq = &ics->irqs[i];
+ /*
+ * The KVM XICS device considers that the IRQ numbers should
+ * start at XICS_IRQ_BASE (0x1000). Ignore the lower 4K
+ * numbers (only claimed by XIVE for the CPU IPIs).
+ */
+ if (i + ics->offset < XICS_IRQ_BASE) {
+ continue;
+ }
+
kvm_device_access(kernel_xics_fd, KVM_DEV_XICS_GRP_SOURCES,
i + ics->offset, &state, false, &error_fatal);
@@ -303,6 +312,15 @@ static int ics_set_kvm_state(ICSState *ics, int version_id)
ICSIRQState *irq = &ics->irqs[i];
int ret;
+ /*
+ * The KVM XICS device considers that the IRQ numbers should
+ * start at XICS_IRQ_BASE (0x1000). Ignore the lower 4K
+ * numbers (only claimed by XIVE for the CPU IPIs).
+ */
+ if (i + ics->offset < XICS_IRQ_BASE) {
+ continue;
+ }
+
state = irq->server;
state |= (uint64_t)(irq->saved_priority & KVM_XICS_PRIORITY_MASK)
<< KVM_XICS_PRIORITY_SHIFT;
--
2.20.1
- [Qemu-ppc] [PATCH 02/13] spapr/xive: add KVM support, (continued)
- [Qemu-ppc] [PATCH 02/13] spapr/xive: add KVM support, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 06/13] spapr/xive: fix migration of the XiveTCTX under TCG, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 04/13] spapr/xive: introduce a VM state change handler, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 03/13] spapr/xive: add state synchronization with KVM, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 05/13] spapr/xive: add migration support for KVM, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 07/13] ppc/xics: introduce a icp_kvm_connect() routine, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 08/13] spapr/rtas: modify spapr_rtas_register() to remove RTAS handlers, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 09/13] sysbus: add a sysbus_mmio_unmap() helper, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 12/13] spapr/xics: ignore the lower 4K in the IRQ number space,
Cédric Le Goater <=
- [Qemu-ppc] [PATCH 11/13] spapr: check for the activation of the KVM IRQ device, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 10/13] spapr: introduce routines to delete the KVM IRQ device, Cédric Le Goater, 2019/01/07
- [Qemu-ppc] [PATCH 13/13] spapr: add KVM support to the 'dual' machine, Cédric Le Goater, 2019/01/07