From 557b4567298a6952de347a4fb7676ff44775f495 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Fri, 15 Feb 2019 12:40:30 +0100 Subject: xics: Handle KVM interrupt presentation from "simple" ICS code We want to use the "simple" ICS type in both KVM and non-KVM setups. Teach the "simple" ICS how to present interrupts to KVM and adapt sPAPR accordingly. Signed-off-by: Greg Kurz Message-Id: <155023082996.1011724.16237920586343905010.stgit@bahia.lan> Signed-off-by: David Gibson --- hw/intc/xics.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/intc/xics.c') diff --git a/hw/intc/xics.c b/hw/intc/xics.c index 49401745c4..3009fa7472 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -466,6 +466,11 @@ void ics_simple_set_irq(void *opaque, int srcno, int val) { ICSState *ics = (ICSState *)opaque; + if (kvm_irqchip_in_kernel()) { + ics_kvm_set_irq(ics, srcno, val); + return; + } + if (ics->irqs[srcno].flags & XICS_FLAGS_IRQ_LSI) { ics_simple_set_irq_lsi(ics, srcno, val); } else { -- cgit v1.2.3