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

Re: [RFC PATCH 16/19] arm/gic: Fix LR group handling for GICv4


  • To: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • From: Mykola Kvach <xakep.amatop@xxxxxxxxx>
  • Date: Wed, 18 Feb 2026 23:00:00 +0200
  • 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=TaaWYpn9TK4SHYazChCG6RzaF2w9QYkdXnL0D4nykk8=; fh=S1TgsMYO/ju21WOcmYTQxMlAU8ImCjuw50drwKkfBt8=; b=idnOncmPoDr6yNgtA1xLCHv+f/LFIQS4y93ig95eLFkqXcIEXdZa2MU+dt7cPz5Bs3 HVjZ6epNwZB8VHAOkKyOOCy5zBbKTBSIIKIizmLyCia7Wm9Yw2J5FeWKGyf3IKaVs/X1 nCqhfZvHRL4C+c59WBR2cJRCOSzP8ea3qRQ6cG7nJlPTEi/AUSozB1QDYgKAgywdk83v 03LjeIzovhxcTXkWQ8kSIM8XPMag00AbvoulH5O3pNB7PTrvXEC14k4NQBGALvOyiFac tsofsOGHrnm9Hln1fFePTlT25NKc7cvTqIhai3V9sF3yZ532PQHsNj7ZuM9s3uhiirdG DyDQ==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1771448512; cv=none; d=google.com; s=arc-20240605; b=EFO8xb18msWKMfGrRiUDonQeAz0i8Sje14oTGnbQGVn8VWnTls/Z2ZW0jsyrSyFcUq nNwBlzFRBcabJRzTIn8siomQiDglEbwCTAxGAErWI7WCXHoDebMfGamzTlvw5u6af8tf J+qmmM55ljc9jGMecPyyNFgzV7SFyLKME/jIWJipVT9fm4bO9wt0Zh57pJEu4OYUlImZ uid4H/6KjGsElGMTpep540iN5rKhF56OuH7FkRichryBxtVAANq+v7ai1/DrXXXMb9H5 nzhMQd8ed4HbGSxR5n2gp98Dl1E2qUytkKuxJeHdrk46xhD16byOXynihIQARBxwJJhz kxZg==
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <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: Wed, 18 Feb 2026 21:01:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This commit can likely be dropped if we apply the approach from the
review of the previous one (i.e. do not introduce per-domain GIC_V4/V4_1
versions in the domctl ABI and keep guests on XEN_DOMCTL_CONFIG_GIC_V3).

In that case current->domain->arch.vgic.version would remain GIC_V3 for
v4-capable systems too, so the existing checks (== GIC_V3) already cover
the intended behaviour.

If we keep v4/v4.1 as distinct internal values, then using >= GIC_V3 is
fine, but please avoid relying on numeric ordering of enums unless that
ordering is explicitly guaranteed.


Thanks,
Mykola

On Mon, Feb 2, 2026 at 6:14 PM Mykyta Poturai <Mykyta_Poturai@xxxxxxxx> wrote:
>
> Extend the check to mark interrupts as Group1 for all GIC versions >= 3
>
> Signed-off-by: Mykyta Poturai <mykyta_poturai@xxxxxxxx>
> ---
>  xen/arch/arm/gic-v3.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
> index 07736179db..1cb3169b72 100644
> --- a/xen/arch/arm/gic-v3.c
> +++ b/xen/arch/arm/gic-v3.c
> @@ -1366,10 +1366,10 @@ static void gicv3_update_lr(int lr, unsigned int 
> virq, uint8_t priority,
>      val =  (((uint64_t)state & 0x3) << ICH_LR_STATE_SHIFT);
>
>      /*
> -     * When the guest is GICv3, all guest IRQs are Group 1, as Group0
> -     * would result in a FIQ in the guest, which it wouldn't expect
> +     * When the guest is GICv3/GICv4/GICv4.1, all guest IRQs are Group 1, as
> +     * Group0 would result in a FIQ in the guest, which it wouldn't expect
>       */
> -    if ( current->domain->arch.vgic.version == GIC_V3 )
> +    if ( current->domain->arch.vgic.version >= GIC_V3 )
>          val |= ICH_LR_GRP1;
>
>      val |= (uint64_t)priority << ICH_LR_PRIORITY_SHIFT;
> @@ -1455,10 +1455,10 @@ static void gicv3_write_lr(int lr, const struct 
> gic_lr *lr_reg)
>      }
>
>      /*
> -     * When the guest is using vGICv3, all the IRQs are Group 1. Group 0
> -     * would result in a FIQ, which will not be expected by the guest OS.
> +     * When the guest is using vGICv3/vGICv4/vGICv4.1, all the IRQs are 
> Group 1.
> +     * Group 0 would result in a FIQ, which will not be expected by the 
> guest OS.
>       */
> -    if ( vgic_version == GIC_V3 )
> +    if ( vgic_version >= GIC_V3 )
>          lrv |= ICH_LR_GRP1;
>
>      gicv3_ich_write_lr(lr, lrv);
> --
> 2.51.2



 


Rackspace

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