[PATCH v2 11/16] irqchip/gic-v5: Enable direct injection in ITS

Wei-Lin Chang weilin.chang at arm.com
Sat Nov 14 16:17:19 PST 2026


On Mon, Nov 02, 2026 at 07:44:49PM +0000, Sascha Bischoff wrote:
> Allow KVM to replace a host ITTE with a virtual translation that
> directly injects an interrupt into a guest. Add an irq_chip callback to
> install and remove the virtual translation, and disable lazy masking
> while the interrupt is forwarded. The KVM caller is added later.
> 
> The ITS writes the ITTE before invalidating its cache. If invalidation
> times out, hardware may still use the virtual translation even though
> setup failed. Allow disable to restore the host ITTE when the forwarded
> flag is clear, and retain retryable state if restoration also times
> out. Keep lazy masking disabled until the host mapping is restored.
> 
> Co-authored-by: Timothy Hayes <timothy.hayes at arm.com>
> Signed-off-by: Sascha Bischoff <sascha.bischoff at arm.com>
> ---
>  drivers/irqchip/irq-gic-v5-its.c   | 141 +++++++++++++++++++++++++++++
>  include/linux/irqchip/arm-gic-v5.h |   8 ++
>  2 files changed, 149 insertions(+)
> 
> diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c
> index 28e39b065de0e..d91f4ea1ef440 100644
> --- a/drivers/irqchip/irq-gic-v5-its.c
> +++ b/drivers/irqchip/irq-gic-v5-its.c
> @@ -61,6 +61,48 @@ static void its_writeq_relaxed(struct gicv5_its_chip_data *its_node, const u64 v
>  	writeq_relaxed(val, its_node->its_base + reg_offset);
>  }
>  

[...]

> +
>  static const struct irq_chip gicv5_its_irq_chip = {
>  	.name			= "GICv5-ITS-MSI",
>  	.irq_mask		= irq_chip_mask_parent,

We should also update gicv5_its_irq_chip.irq_mask/irq_unmask to consider
direct injected vLPIs right?

Thanks,
Wei-Lin Chang

> @@ -732,6 +870,9 @@ static const struct irq_chip gicv5_its_irq_chip = {
>  	.irq_get_irqchip_state	= irq_chip_get_parent_state,
>  	.irq_set_irqchip_state	= irq_chip_set_parent_state,
>  	.irq_compose_msi_msg	= gicv5_its_compose_msi_msg,
> +#ifdef CONFIG_KVM
> +	.irq_set_vcpu_affinity	= gicv5_its_set_vcpu_affinity,
> +#endif /* CONFIG_KVM */
>  };
>  

[...]



More information about the linux-arm-kernel mailing list