ppc/xics: fix irq priority in ics_set_irq_type()
commit83629419a52f393d67317b14a861d3062e37c5c3
authorCédric Le Goater <clg@kaod.org>
Mon, 13 May 2019 08:42:44 +0000 (13 10:42 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 29 May 2019 01:39:46 +0000 (29 11:39 +1000)
tree9e6b18307aa52d648bacab2fc1b0f9d8cb231de7
parentcf435df697e50db5ed1ec60e5efe639123a03154
ppc/xics: fix irq priority in ics_set_irq_type()

Recent commits changed the behavior of ics_set_irq_type() to
initialize correctly LSIs at the KVM level. ics_set_irq_type() is also
called by the realize routine of the different devices of the machine
when initial interrupts are claimed, before the ICSState device is
reseted.

In the case, the ICSIRQState priority is 0x0 and the call to
ics_set_irq_type() results in configuring the target of the
interrupt. On P9, when using the KVM XICS-on-XIVE device, the target
is configured to be server 0, priority 0 and the event queue 0 is
created automatically by KVM.

With the dual interrupt mode creating the KVM device at reset, it
leads to unexpected effects on the guest, mostly blocking IPIs. This
is wrong, fix it by reseting the ICSIRQState structure when
ics_set_irq_type() is called.

Fixes: commit 6cead90c5c9c ("xics: Write source state to KVM at claim time")
Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20190513084245.25755-14-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/intc/xics.c