Commit fb21cb0
KVM: arm64: Use standard seq_file iterator for vgic-debug debugfs
The current implementation uses `vgic_state_iter` in `struct
vgic_dist` 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 (`vgic_dist`).
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
`vgic_state_iter` field from `struct vgic_dist`.
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260202085721.3954942-4-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>1 parent 5ab2496 commit fb21cb0
2 files changed
Lines changed: 12 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 107 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 108 | + | |
| 109 | + | |
119 | 110 | | |
120 | 111 | | |
121 | | - | |
122 | 112 | | |
123 | | - | |
| 113 | + | |
| 114 | + | |
124 | 115 | | |
125 | | - | |
126 | | - | |
| 116 | + | |
| 117 | + | |
127 | 118 | | |
128 | 119 | | |
129 | 120 | | |
130 | 121 | | |
131 | 122 | | |
132 | 123 | | |
133 | | - | |
| 124 | + | |
134 | 125 | | |
135 | 126 | | |
136 | 127 | | |
137 | | - | |
| 128 | + | |
| 129 | + | |
138 | 130 | | |
| 131 | + | |
139 | 132 | | |
140 | 133 | | |
141 | 134 | | |
142 | 135 | | |
143 | 136 | | |
144 | | - | |
145 | | - | |
| 137 | + | |
146 | 138 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 139 | + | |
152 | 140 | | |
153 | 141 | | |
154 | | - | |
155 | | - | |
156 | 142 | | |
157 | | - | |
158 | | - | |
159 | 143 | | |
160 | 144 | | |
161 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | 305 | | |
309 | 306 | | |
310 | 307 | | |
| |||
0 commit comments