Skip to content

KVM: arm64: Standardize debugfs iterators

Fuad Tabba kvm kvmarm linux-arm-kernel 1 version Applied

Status from this message: Applied to next, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3KVM: arm64: Use standard seq_file iterator for idregs debugfsarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/sys_regs.c+8 -450 replies
2/3KVM: arm64: Reimplement vgic-debug XArray iterationarch/arm64/kvm/vgic/vgic-debug.c include/kvm/arm_vgic.h+20 -490 replies
3/3KVM: arm64: Use standard seq_file iterator for vgic-debug debugfsarch/arm64/kvm/vgic/vgic-debug.c include/kvm/arm_vgic.h+12 -310 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1 0/3] KVM: arm64: Standardize debugfs iterators

This series refactors the debugfs implementations for idregs and vgic-state to use standard seq_file iterator patterns.

The existing implementations relied on storing iterator state within global VM structures (kvm_arch and vgic_dist). This approach prevented concurrent reads of the debugfs files (returning -EBUSY) and created improper dependencies between transient file operations and long-lived VM state.

The vgic-debug implementation relied on an XArray marking mechanism to snapshot LPIs during iteration. This modified global state during read operations and could lead to reference counting leaks in certain edge cases.

Note that vgic-its-debug (for ITS tables) also uses a custom iterator pattern, but it is not addressed in this series. Unlike vgic-state, the ITS debug interface iterates over linked lists (device_list and itt_head) which require holding the its_lock for safety. Converting it to a lockless iterator would require a more invasive refactoring of the ITS data structures (e.g., to RCU or XArray), which is outside the scope of this cleanup.

Based on Linux 6.19-rc7.

Cheers,
/fuad

Fuad Tabba (3):
KVM: arm64: Use standard seq_file iterator for idregs debugfs
KVM: arm64: Reimplement vgic-debug XArray iteration
KVM: arm64: Use standard seq_file iterator for vgic-debug debugfs

 arch/arm64/include/asm/kvm_host.h |   3 -
 arch/arm64/kvm/sys_regs.c         |  50 +++-----------
 arch/arm64/kvm/vgic/vgic-debug.c  | 108 +++++++++---------------------
 include/kvm/arm_vgic.h            |   4 --
 4 files changed, 40 insertions(+), 125 deletions(-)

base-commit: 63804fed149a6750ffd28610c5c1c98cce6bd377

Signature · 1 line
2.53.0.rc1.225.gd81095ad13-goog