[PATCH v2 13/16] KVM: arm64: gic-v5: Implement irq forwarding
Fuad Tabba
fuad.tabba at linux.dev
Tue Nov 3 07:29:53 PST 2026
On Mon, 02 Nov 2026 19:44:51 +0000, Sascha Bischoff
<sascha.bischoff at arm.com> wrote:
[...]
> diff --git a/arch/arm64/kvm/vgic/vgic-mmio.c b/arch/arm64/kvm/vgic/vgic-mmio.c
[...]
> @@ -1152,7 +1154,13 @@ bool vgic_supports_direct_msis(struct kvm *kvm)
> if (system_supports_direct_sgis() && !vgic_supports_direct_sgis(kvm))
> return false;
>
> - return kvm_vgic_global_state.has_gicv4 && vgic_has_its(kvm);
> + if (kvm_vgic_global_state.has_gicv4 && vgic_has_its(kvm))
> + return true;
> + if (kvm_vgic_global_state.type == VGIC_V5 && vgic_has_its(kvm) &&
> + dist->vgic_model == KVM_DEV_TYPE_ARM_VGIC_V5)
> + return true;
No GICv5 VM gets here, since every caller diverts v5 first. Could this
hunk, and patch 12, go? (Sashiko [1])
[...]
> diff --git a/arch/arm64/kvm/vgic/vgic-v5.c b/arch/arm64/kvm/vgic/vgic-v5.c
[...]
> +int kvm_vgic_v5_set_forwarding(struct kvm *kvm, int virq,
> + struct kvm_kernel_irq_routing_entry *irq_entry)
[...]
> + ret = gicv5_its_enable_direct_injection(virq, vgic_v5_vm_id(kvm),
> + vgic_v5_get_hwirq_id(irq->intid));
Before init this writes VM ID 0xffff into the ITTE. See my reply to patch 10.
[...]
> + /* Keep the host IRQ association so a later unforward can retry. */
> + ret = 0;
If the retry never succeeds, teardown still frees the VM ID while the
ITS may hold the cached ITTE. Could it keep the ID, as it does when
its own teardown fails? Only misbehaving hardware gets here (also
Sashiko).
[...]
> + } else {
> + ret = -EBUSY;
> + }
This is unreachable, as is the WARN_ON_ONCE() below (the only caller
holds irqbypass's mutex, and irq->hw was checked above). Could both
go?
Thanks!
/fuad
[1] https://lore.kernel.org/all/sashiko-outbox-194187@kernel.org/
More information about the linux-arm-kernel
mailing list