Re: [PATCH] KVM: arm64: nv: Fix s_cpu_if->vgic_lr[] indexing in vgic_v3_put_nested()

From: Oliver Upton
Date: Mon Jun 16 2025 - 01:55:42 EST


On Sat, Jun 14, 2025 at 10:57:21PM +0800, Wei-Lin Chang wrote:
> s_cpu_if->vgic_lr[] is filled continuously from index 0 to
> s_cpu_if->used_lrs - 1, but vgic_v3_put_nested() is indexing it using
> the positions of the set bits in shadow_if->lr_map. So correct it.

The changelog is a bit too mechanical and doesn't actually add anything
to the diff. Maybe:

Shadow LRs may exist at different indices from the corresponding LRs
in the guest hypervisor's vgic, as the shadow LRs are populated
contiguously in vgic_v3_create_shadow_lr().

Use the correct shadow LR index when forwarding vIRQ state back to the
guest hypervisor's vgic in vgic_v3_put_nested().

Diff itself LGTM.

Reviewed-by: Oliver Upton <oliver.upton@xxxxxxxxx>

Thanks,
Oliver