Since islsi[] array has been merged into the ICSState struct, we must not reset flags as they tell if the interrupt is in use.
Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> --- hw/intc/xics.c | 7 +++++++ hw/intc/xics_kvm.c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index 7065978..83a809e 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -521,11 +521,18 @@ static void ics_reset(DeviceState *dev) { ICSState *ics = ICS(dev); int i; + uint8_t flags[ics->nr_irqs]; + + for (i = 0; i < ics->nr_irqs; i++) { + flags[i] = ics->irqs[i].flags; + } memset(ics->irqs, 0, sizeof(ICSIRQState) * ics->nr_irqs); + for (i = 0; i < ics->nr_irqs; i++) { ics->irqs[i].priority = 0xff; ics->irqs[i].saved_priority = 0xff; + ics->irqs[i].flags = flags[i]; } } diff --git a/hw/intc/xics_kvm.c b/hw/intc/xics_kvm.c index 8719a88..6fa2412 100644 --- a/hw/intc/xics_kvm.c +++ b/hw/intc/xics_kvm.c @@ -271,11 +271,18 @@ static void ics_kvm_reset(DeviceState *dev) { ICSState *ics = ICS(dev); int i; + uint8_t flags[ics->nr_irqs]; + + for (i = 0; i < ics->nr_irqs; i++) { + flags[i] = ics->irqs[i].flags; + } memset(ics->irqs, 0, sizeof(ICSIRQState) * ics->nr_irqs); + for (i = 0; i < ics->nr_irqs; i++) { ics->irqs[i].priority = 0xff; ics->irqs[i].saved_priority = 0xff; + ics->irqs[i].flags = flags[i]; } ics_set_kvm_state(ics, 1); -- 1.9.rc0