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

Fuad Tabba tabba at google.com
Mon Feb 2 00:57:18 PST 2026


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
-- 
2.53.0.rc1.225.gd81095ad13-goog




More information about the linux-arm-kernel mailing list