diff options
| author | Fuad Tabba <tabba@google.com> | 2026-02-02 08:57:19 +0000 |
|---|---|---|
| committer | Marc Zyngier <maz@kernel.org> | 2026-02-02 10:59:25 +0000 |
| commit | dcd79ed450934421158d81600f1be4c2e2af20bf (patch) | |
| tree | d4bf067bea4f8104bafe07e7b3076b10c981037e /rust/alloc/collections/git@git.tavy.me:linux.git | |
| parent | 9ace4753a5202b02191d54e9fdf7f9e3d02b85eb (diff) | |
KVM: arm64: Use standard seq_file iterator for idregs debugfs
The current implementation uses `idreg_debugfs_iter` in `struct
kvm_arch` to track the sequence position. This effectively makes the
iterator shared across all open file descriptors for the VM.
This approach has significant drawbacks:
- It enforces mutual exclusion, preventing concurrent reads of the
debugfs file (returning -EBUSY).
- It relies on storing transient iterator state in the long-lived VM
structure (`kvm_arch`).
- The use of `u8` for the iterator index imposes an implicit limit of
255 registers. While not currently exceeded, this is fragile against
future architectural growth. Switching to `loff_t` eliminates this
overflow risk.
Refactor the implementation to use the standard `seq_file` iterator.
Instead of storing state in `kvm_arch`, rely on the `pos` argument
passed to the `start` and `next` callbacks, which tracks the logical
index specific to the file descriptor.
This change enables concurrent access and eliminates the
`idreg_debugfs_iter` field from `struct kvm_arch`.
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260202085721.3954942-2-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'rust/alloc/collections/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions
