Skip to content

Commit e9611bf

Browse files
committed
Documentation: kvm: fixes for locking.rst
Separate the various locks clearly, and include the new names of blocked_vcpu_on_cpu_lock and blocked_vcpu_on_cpu. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20220322110720.222499-2-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 07ea4ab commit e9611bf

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

Documentation/virt/kvm/locking.rst

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -210,32 +210,41 @@ time it will be set using the Dirty tracking mechanism described above.
210210
3. Reference
211211
------------
212212

213-
:Name: kvm_lock
213+
``kvm_lock``
214+
^^^^^^^^^^^^
215+
214216
:Type: mutex
215217
:Arch: any
216218
:Protects: - vm_list
217219

218-
:Name: kvm_count_lock
220+
``kvm_count_lock``
221+
^^^^^^^^^^^^^^^^^^
222+
219223
:Type: raw_spinlock_t
220224
:Arch: any
221225
:Protects: - hardware virtualization enable/disable
222226
:Comment: 'raw' because hardware enabling/disabling must be atomic /wrt
223227
migration.
224228

225-
:Name: kvm_arch::tsc_write_lock
226-
:Type: raw_spinlock
229+
230+
``kvm_arch::tsc_write_lock``
231+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
232+
233+
:Type: raw_spinlock_t
227234
:Arch: x86
228235
:Protects: - kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset}
229236
- tsc offset in vmcb
230237
:Comment: 'raw' because updating the tsc offsets must not be preempted.
231238

232-
:Name: kvm->mmu_lock
233-
:Type: spinlock_t
239+
``kvm->mmu_lock``
240+
^^^^^^^^^^^^^^^^^
241+
:Type: spinlock_t or rwlock_t
234242
:Arch: any
235243
:Protects: -shadow page/shadow tlb entry
236244
:Comment: it is a spinlock since it is used in mmu notifier.
237245

238-
:Name: kvm->srcu
246+
``kvm->srcu``
247+
^^^^^^^^^^^^^
239248
:Type: srcu lock
240249
:Arch: any
241250
:Protects: - kvm->memslots
@@ -246,10 +255,11 @@ time it will be set using the Dirty tracking mechanism described above.
246255
The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
247256
if it is needed by multiple functions.
248257

249-
:Name: blocked_vcpu_on_cpu_lock
258+
``wakeup_vcpus_on_cpu_lock``
259+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
250260
:Type: spinlock_t
251261
:Arch: x86
252-
:Protects: blocked_vcpu_on_cpu
262+
:Protects: wakeup_vcpus_on_cpu
253263
:Comment: This is a per-CPU lock and it is used for VT-d posted-interrupts.
254264
When VT-d posted-interrupts is supported and the VM has assigned
255265
devices, we put the blocked vCPU on the list blocked_vcpu_on_cpu

0 commit comments

Comments
 (0)