From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecY7W-0002pE-9v for qemu-devel@nongnu.org; Fri, 19 Jan 2018 09:58:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecY7V-0003mf-Fq for qemu-devel@nongnu.org; Fri, 19 Jan 2018 09:58:18 -0500 From: luc.michel@greensocs.com Date: Fri, 19 Jan 2018 15:57:55 +0100 Message-Id: <20180119145756.7629-5-luc.michel@greensocs.com> In-Reply-To: <20180119145756.7629-1-luc.michel@greensocs.com> References: <20180119145756.7629-1-luc.michel@greensocs.com> Subject: [Qemu-devel] [PATCH 3/4] hw/intc/arm_gic: Fix group priority computation for group 1 IRQs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Luc MICHEL , qemu-arm@nongnu.org, Peter Maydell , "Edgar E . Iglesias" , Alistair Francis From: Luc MICHEL When determining the group priority of a group 1 IRQ, if C_CTRL.CBPR is 0, the non-secure BPR value is used. However, this value must be incremented by one so that it matches the secure world number of implemented priority bits (NS world has one less priority bit compared to the Secure world). Signed-off-by: Luc MICHEL --- hw/intc/arm_gic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c index 713de3084f..d0a41a89ae 100644 --- a/hw/intc/arm_gic.c +++ b/hw/intc/arm_gic.c @@ -256,7 +256,7 @@ static int gic_get_group_priority(GICState *s, int cpu, int irq) if (gic_has_groups(s) && !(s->cpu_ctlr[cpu] & GICC_CTLR_CBPR) && GIC_TEST_GROUP(irq, (1 << cpu))) { - bpr = s->abpr[cpu]; + bpr = s->abpr[cpu] - 1; } else { bpr = s->bpr[cpu]; } -- 2.16.0