qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] arm_gicv3_kvm: increase clroffset according


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 1/2] arm_gicv3_kvm: increase clroffset accordingly
Date: Mon, 19 Mar 2018 16:24:25 +0000

On 19 March 2018 at 14:36, Shannon Zhao <address@hidden> wrote:
> It forgot to increase clroffset during the loop. So it only clear the
> first 4 bytes.
>
> Signed-off-by: Shannon Zhao <address@hidden>
> ---
>  hw/intc/arm_gicv3_kvm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
> index ec37177..7000716 100644
> --- a/hw/intc/arm_gicv3_kvm.c
> +++ b/hw/intc/arm_gicv3_kvm.c
> @@ -232,9 +232,10 @@ static void kvm_dist_getbmp(GICv3State *s, uint32_t 
> offset, uint32_t *bmp)
>  static void kvm_dist_putbmp(GICv3State *s, uint32_t offset,
>                              uint32_t clroffset, uint32_t *bmp)
>  {
> -    uint32_t reg;
> +    uint32_t reg, clroffset_index;
>      int irq;
>
> +    clroffset_index = clroffset;
>      for_each_dist_irq_reg(irq, s->num_irq, 1) {
>          /* If this bitmap is a set/clear register pair, first write to the
>           * clear-reg to clear all bits before using the set-reg to write
> @@ -242,7 +243,8 @@ static void kvm_dist_putbmp(GICv3State *s, uint32_t 
> offset,
>           */
>          if (clroffset != 0) {
>              reg = 0;
> -            kvm_gicd_access(s, clroffset, &reg, true);
> +            kvm_gicd_access(s, clroffset_index, &reg, true);
> +            clroffset_index += 4;
>          }
>          reg = *gic_bmp_ptr32(bmp, irq);
>          kvm_gicd_access(s, offset, &reg, true);

You might as well just use 'clroffset' directly rather than
creating a new clroffset_index variable, I think.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]