From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnMCP-0002hy-Bp for qemu-devel@nongnu.org; Thu, 22 May 2014 02:09:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnMCI-0003dP-1i for qemu-devel@nongnu.org; Thu, 22 May 2014 02:09:53 -0400 Received: from mail-pb0-f54.google.com ([209.85.160.54]:35997) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnMCH-0003dD-Sg for qemu-devel@nongnu.org; Thu, 22 May 2014 02:09:45 -0400 Received: by mail-pb0-f54.google.com with SMTP id jt11so2157315pbb.41 for ; Wed, 21 May 2014 23:09:45 -0700 (PDT) From: Paul Janzen References: <86a9aa1hs0.fsf@LAUTARET.i-did-not-set--mail-host-address--so-tickle-me> Date: Wed, 21 May 2014 23:09:45 -0700 In-Reply-To: <86a9aa1hs0.fsf@LAUTARET.i-did-not-set--mail-host-address--so-tickle-me> (Paul Janzen's message of "Wed, 21 May 2014 21:46:52 -0700") Message-ID: <86r43mz6mu.fsf@moog.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v2 2/2] openpic: Reset IRQ source private members List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc@nongnu.org Cc: Scott Wood , qemu-devel@nongnu.org, Alexander Graf The openpic emulation code maintains an allowable-CPU's bitmap ("destmask") for each IRQ source which is calculated from the IDR register value whenever the guest OS writes to it. However, if the guest OS relies on the system to set the IDR register to a default value at reset, and does not write IDR, then destmask does not get updated, and interrupts do not get propagated to the guest. Additionally, if an IRQ source is marked as critical, the source's internal "output" and "nomask" fields are not correctly reset when the PIC is reset. Fix both these issues by calling write_IRQreg_idr from within openpic_reset, instead of simply setting the IDR register to the specified idr_reset value. Signed-off-by: Paul Janzen --- hw/intc/openpic.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c index 81469ff..811db6f 100644 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@ -1435,8 +1435,6 @@ static void openpic_reset(DeviceState *d) /* Initialise IRQ sources */ for (i = 0; i < opp->max_irq; i++) { opp->src[i].ivpr = opp->ivpr_reset; - opp->src[i].idr = opp->idr_reset; - switch (opp->src[i].type) { case IRQ_TYPE_NORMAL: opp->src[i].level = !!(opp->ivpr_reset & IVPR_SENSE_MASK); @@ -1449,6 +1447,8 @@ static void openpic_reset(DeviceState *d) case IRQ_TYPE_FSLSPECIAL: break; } + + write_IRQreg_idr(opp, i, opp->idr_reset); } /* Initialise IRQ destinations */ for (i = 0; i < MAX_CPU; i++) { -- 1.7.1