[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/4] hw/intc/arm_gic: Fix group priority computa
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 3/4] hw/intc/arm_gic: Fix group priority computation for group 1 IRQs |
Date: |
Mon, 22 Jan 2018 15:25:16 +0000 |
On 19 January 2018 at 14:57, <address@hidden> wrote:
> From: Luc MICHEL <address@hidden>
>
> 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 <address@hidden>
> ---
> 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;
I would suggest an "assert(bpr >= 0);" here. (We have a similar
assert for GICv3 in icv_gprio_mask() and icc_gprio_mask() in
arm_gicv3_cpuif.c.)
> } else {
> bpr = s->bpr[cpu];
> }
> --
> 2.16.0
thanks
-- PMM
- [Qemu-devel] [PATCH 0/4] arm_gic: Various fixes, luc . michel, 2018/01/19
- [Qemu-devel] [PATCH 4/4] hw/intc/arm_gic: Fix the NS view of C_BPR when C_CTRL.CBPR is 1, luc . michel, 2018/01/19
- [Qemu-devel] [PATCH 2/4] hw/intc/arm_gic: Fix C_RPR value on idle priority, luc . michel, 2018/01/19
- [Qemu-devel] [PATCH 1/4] hw/intc/arm_gic: Prevent the GIC from signaling an IRQ when it's "active and pending", luc . michel, 2018/01/19
- [Qemu-devel] [PATCH 3/4] hw/intc/arm_gic: Fix group priority computation for group 1 IRQs, luc . michel, 2018/01/19
- Re: [Qemu-devel] [PATCH 3/4] hw/intc/arm_gic: Fix group priority computation for group 1 IRQs,
Peter Maydell <=
- Re: [Qemu-devel] [PATCH 0/4] arm_gic: Various fixes, Peter Maydell, 2018/01/22