From: Zenghui Yu <yuzenghui@xxxxxxxxxx> commit 2240a50e6294214de791729e9dcba6880fa7e44e upstream. If there were LPIs being mapped behind our back (i.e., between .start() and .stop()), we would put them at iter_unmark_lpis() without checking if they were actually *marked*, which is obviously not good. Switch to use the xa_for_each_marked() iterator to fix it. Cc: stable@xxxxxxxxxxxxxxx Fixes: 85d3ccc8b75b ("KVM: arm64: vgic-debug: Use an xarray mark for debug iterator") Signed-off-by: Zenghui Yu <yuzenghui@xxxxxxxxxx> Reviewed-by: Marc Zyngier <maz@xxxxxxxxxx> Link: https://lore.kernel.org/r/20240817101541.1664-1-yuzenghui@xxxxxxxxxx Signed-off-by: Oliver Upton <oliver.upton@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/arm64/kvm/vgic/vgic-debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm64/kvm/vgic/vgic-debug.c +++ b/arch/arm64/kvm/vgic/vgic-debug.c @@ -84,7 +84,7 @@ static void iter_unmark_lpis(struct kvm struct vgic_irq *irq; unsigned long intid; - xa_for_each(&dist->lpi_xa, intid, irq) { + xa_for_each_marked(&dist->lpi_xa, intid, irq, LPI_XA_MARK_DEBUG_ITER) { xa_clear_mark(&dist->lpi_xa, intid, LPI_XA_MARK_DEBUG_ITER); vgic_put_irq(kvm, irq); } Patches currently in stable-queue which might be from yuzenghui@xxxxxxxxxx are queue-6.10/kvm-arm64-vgic-debug-don-t-put-unmarked-lpis.patch