Subject: Re: [PATCH v4 32/36] irqchip/gic-v5: Check if impl is virt capable

From: Marc Zyngier <[email-masked]>
Date: Fri, 30 Jan 2026 11:14:11 +0000

On Wed, 28 Jan 2026 18:07:33 +0000,
Sascha Bischoff <[email-masked]> wrote:
> 
> Now that there is support for creating a GICv5-based guest with KVM,
> check that the hardware itself supports virtualisation, skipping the
> setting of struct gic_kvm_info if not.
> 
> Note: If native GICv5 virt is not supported, then nor is
> FEAT_GCIE_LEGACY, so we are able to skip altogether.
> 
> Signed-off-by: Sascha Bischoff <[email-masked]>
> Reviewed-by: Lorenzo Pieralisi <[email-masked]>
> Reviewed-by: Jonathan Cameron <[email-masked]>
> ---
>  drivers/irqchip/irq-gic-v5-irs.c   |  4 ++++
>  drivers/irqchip/irq-gic-v5.c       | 10 ++++++++++
>  include/linux/irqchip/arm-gic-v5.h |  4 ++++
>  3 files changed, 18 insertions(+)
> 
> diff --git a/drivers/irqchip/irq-gic-v5-irs.c b/drivers/irqchip/irq-gic-v5-irs.c
> index ce2732d649a3..eebf9f219ac8 100644
> --- a/drivers/irqchip/irq-gic-v5-irs.c
> +++ b/drivers/irqchip/irq-gic-v5-irs.c
> @@ -744,6 +744,10 @@ static int __init gicv5_irs_init(struct device_node *node)
>  	 */
>  	if (list_empty(&irs_nodes)) {
>  
> +		idr = irs_readl_relaxed(irs_data, GICV5_IRS_IDR0);
> +		gicv5_global_data.virt_capable =
> +			!!FIELD_GET(GICV5_IRS_IDR0_VIRT, idr);
> +

I'll tidy-up this while cherry-picking it (spurious newline before the
hunk, horrible split assignment...).

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.