From patchwork Fri Sep 23 07:15:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 673928 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sgQdv29lcz9t0v for ; Fri, 23 Sep 2016 17:55:47 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.b=n4iGCPk3; dkim-atps=neutral Received: from localhost ([::1]:41817 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnLKi-0002Zk-PR for incoming@patchwork.ozlabs.org; Fri, 23 Sep 2016 03:55:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnKim-0005o2-Rb for qemu-devel@nongnu.org; Fri, 23 Sep 2016 03:16:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bnKik-00088b-J5 for qemu-devel@nongnu.org; Fri, 23 Sep 2016 03:16:31 -0400 Received: from ozlabs.org ([103.22.144.67]:41494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bnKik-0007uj-63; Fri, 23 Sep 2016 03:16:30 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3sgPlW2H9Xz9vF9; Fri, 23 Sep 2016 17:15:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1474614935; bh=g+mm7mGqUvp5PLNqD5lcNA7cUAODORGztUWpdd8b8rk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n4iGCPk3YGY/t1tlMwI8H5Arz+cMmWrgnM2leajjPLpdGuBjjNHPLOF0WTH01Wx1C RWsqrgW3ktTxw5oPr2YSHx89/t+o0tHmwgjejlJMnK5ygNm2CtQuc410WFCGWlKpAf A7DK2rq7t0DWvZQJT0aBfrSObmMnAkAU5Et3vmSA= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 23 Sep 2016 17:15:16 +1000 Message-Id: <1474614921-2221-41-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1474614921-2221-1-git-send-email-david@gibson.dropbear.id.au> References: <1474614921-2221-1-git-send-email-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PULL 40/45] ppc/xics: account correct irq status X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Gibson , qemu-ppc@nongnu.org, agraf@suse.de, Nikunj A Dadhania , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Nikunj A Dadhania Fix inconsistent irq status, because of this in the trace logs, for e.g. LSI status was 0x7, i.e. XICS_STATUS_ASSERTED, XICS_STATUS_SENT and XICS_STATUS_REJECTED all set, which did not make sense. So the REJECTED would have been set in earlier interrupt cycle, and then asserted and sent in this current one. Signed-off-by: Nikunj A Dadhania Signed-off-by: David Gibson --- hw/intc/xics.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/intc/xics.c b/hw/intc/xics.c index cd48f42..69162f0 100644 --- a/hw/intc/xics.c +++ b/hw/intc/xics.c @@ -505,8 +505,11 @@ static void ics_reject(ICSState *ics, int nr) ICSIRQState *irq = ics->irqs + nr - ics->offset; trace_xics_ics_reject(nr, nr - ics->offset); - irq->status |= XICS_STATUS_REJECTED; /* Irrelevant but harmless for LSI */ - irq->status &= ~XICS_STATUS_SENT; /* Irrelevant but harmless for MSI */ + if (irq->flags & XICS_FLAGS_IRQ_MSI) { + irq->status |= XICS_STATUS_REJECTED; + } else if (irq->flags & XICS_FLAGS_IRQ_LSI) { + irq->status &= ~XICS_STATUS_SENT; + } } static void ics_resend(ICSState *ics)