aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/intc/xics.c5
-rw-r--r--hw/intc/xics_kvm.c3
-rw-r--r--hw/ppc/spapr_irq.c7
3 files changed, 7 insertions, 8 deletions
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 {
diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c
index e7b8d4c29c..f34eacda03 100644
--- a/hw/intc/xics_kvm.c
+++ b/hw/intc/xics_kvm.c
@@ -259,9 +259,8 @@ int ics_set_kvm_state(ICSState *ics)
return 0;
}
-void ics_kvm_set_irq(void *opaque, int srcno, int val)
+void ics_kvm_set_irq(ICSState *ics, int srcno, int val)
{
- ICSState *ics = opaque;
struct kvm_irq_level args;
int rc;
diff --git a/hw/ppc/spapr_irq.c b/hw/ppc/spapr_irq.c
index e6893df61e..9f43b7b3bf 100644
--- a/hw/ppc/spapr_irq.c
+++ b/hw/ppc/spapr_irq.c
@@ -222,13 +222,8 @@ static int spapr_irq_post_load_xics(sPAPRMachineState *spapr, int version_id)
static void spapr_irq_set_irq_xics(void *opaque, int srcno, int val)
{
sPAPRMachineState *spapr = opaque;
- MachineState *machine = MACHINE(opaque);
- if (kvm_enabled() && machine_kernel_irqchip_allowed(machine)) {
- ics_kvm_set_irq(spapr->ics, srcno, val);
- } else {
- ics_simple_set_irq(spapr->ics, srcno, val);
- }
+ ics_simple_set_irq(spapr->ics, srcno, val);
}
static void spapr_irq_reset_xics(sPAPRMachineState *spapr, Error **errp)