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

Re: [PATCH] xen/arm: gic-v3: Fix redistributor wakeup polling


  • To: Luca Fancellu <luca.fancellu@xxxxxxx>
  • From: Mykola Kvach <xakep.amatop@xxxxxxxxx>
  • Date: Mon, 18 May 2026 10:29:57 +0300
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=GbB0xIaK2vd2KM7jae/EfM0r1j2c34jEMfjm9Ap3LFY=; fh=VmRYTqrYqQr1nP/EHKOetkoKt+mAJtoUveNvQ+rA8II=; b=imK8sLAAt5rPBiBgkvSyqvAV8L72CwCvg59I89KGuyOQTk7KAsPkIvXbrE7zQUpZ4g 7vc0ZS7f1wi4LmXPw2ZJgWT1xzoKguFs8z4UxYyxEl5K3FdmK/rMgVA2Hm6futMxeiXG vtql7NAVkn7WZ3LQO1sz2PRTOZJsYIuhQ7XNSbza+UNndUi6fw0C3ZwltfWvinh4v/ej 63WeyaSLxT3fKNbF+DPucO5SbTq/bikH4/VG0ogfF0D+zwvbT1+lzqYIxsp2SrEPXETR WnSSCWfFhXra+Q42FFXmVoOutKaELHSCmZt0dCEWLAVQXSQz6gNGwwprHJmVQBp79ni8 55cg==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1779089408; cv=none; d=google.com; s=arc-20240605; b=hBGSJVl5LvazBOsbTK7APQI+aS20slzk864eIxSIYPy9gw85awyR3wWjvfNnwlPwlT EAJFr4xLLhqtBrL4fV7EfT5s5VWQtSJF5xGqHJF++hbXFijJy9xPMqKsyqoqV3cbZR+i G70Bl8FEt5mcOBgm4/gcOzjesq5v03A1q2YwfdZYZJoU6AfgR54qkyaI6pkvSp8t3p1w oFy6SL5AmkUknP+RNSrdsPjmoVkEBegL2msUEzU0CIW72P06JDIdO2j1cf9J+b4/9H0K tRvSbmUNYHKqXaeGbtNi/Var2l1CY8YI2Shn360L24xc46lk+VQ6Eg/9LoOC5WTcE7DQ TSwA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References:MIME-Version"
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 18 May 2026 07:30:23 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, May 18, 2026 at 10:05 AM Luca Fancellu <luca.fancellu@xxxxxxx> wrote:
>
> gicv3_enable_redist() clears GICR_WAKER.ProcessorSleep and then waits for
> GICR_WAKER.ChildrenAsleep to clear, as required after waking a
> redistributor.
>
> However, the polling loop currently uses "while ( timeout )". Since
> timeout is initially false, the loop runs only once unless the timeout
> path has already been reached. As a result, Xen can continue before the
> redistributor has completed wakeup.
>
> Use an unconditional loop, matching the surrounding timeout/break pattern,
> so the code polls until either ChildrenAsleep is clear or the deadline is
> reached.
>
> While there, also fix the timeout message. This path polls
> GICR_WAKER.ChildrenAsleep, not an RWP bit, so "RWP timeout" is misleading.
>
> Fixes: bc183a0235e0 ("xen/arm: Add support for GIC v3")
> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
> ---
>  xen/arch/arm/gic-v3.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
> index 7f365cdbe9df..bb946dc11375 100644
> --- a/xen/arch/arm/gic-v3.c
> +++ b/xen/arch/arm/gic-v3.c
> @@ -828,11 +828,11 @@ static int gicv3_enable_redist(void)
>          }
>          cpu_relax();
>          udelay(1);
> -    } while ( timeout );
> +    } while ( 1 );
>
>      if ( timeout )
>      {
> -        dprintk(XENLOG_ERR, "GICv3: Redist enable RWP timeout\n");
> +        dprintk(XENLOG_ERR, "GICv3: Redist wakeup timeout\n");
>          return 1;
>      }
>
> --
> 2.34.1
>
>

Reviewed-by: Mykola Kvach <mykola_kvach@xxxxxxxx>

Best regards,
Mykola



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.