Commit e9611bf9 authored by Paolo Bonzini's avatar Paolo Bonzini

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: default avatarPaolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220322110720.222499-2-pbonzini@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 07ea4ab1
...@@ -210,32 +210,41 @@ time it will be set using the Dirty tracking mechanism described above. ...@@ -210,32 +210,41 @@ time it will be set using the Dirty tracking mechanism described above.
3. Reference 3. Reference
------------ ------------
:Name: kvm_lock ``kvm_lock``
^^^^^^^^^^^^
:Type: mutex :Type: mutex
:Arch: any :Arch: any
:Protects: - vm_list :Protects: - vm_list
:Name: kvm_count_lock ``kvm_count_lock``
^^^^^^^^^^^^^^^^^^
:Type: raw_spinlock_t :Type: raw_spinlock_t
:Arch: any :Arch: any
:Protects: - hardware virtualization enable/disable :Protects: - hardware virtualization enable/disable
:Comment: 'raw' because hardware enabling/disabling must be atomic /wrt :Comment: 'raw' because hardware enabling/disabling must be atomic /wrt
migration. migration.
:Name: kvm_arch::tsc_write_lock
:Type: raw_spinlock ``kvm_arch::tsc_write_lock``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:Type: raw_spinlock_t
:Arch: x86 :Arch: x86
:Protects: - kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset} :Protects: - kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset}
- tsc offset in vmcb - tsc offset in vmcb
:Comment: 'raw' because updating the tsc offsets must not be preempted. :Comment: 'raw' because updating the tsc offsets must not be preempted.
:Name: kvm->mmu_lock ``kvm->mmu_lock``
:Type: spinlock_t ^^^^^^^^^^^^^^^^^
:Type: spinlock_t or rwlock_t
:Arch: any :Arch: any
:Protects: -shadow page/shadow tlb entry :Protects: -shadow page/shadow tlb entry
:Comment: it is a spinlock since it is used in mmu notifier. :Comment: it is a spinlock since it is used in mmu notifier.
:Name: kvm->srcu ``kvm->srcu``
^^^^^^^^^^^^^
:Type: srcu lock :Type: srcu lock
:Arch: any :Arch: any
:Protects: - kvm->memslots :Protects: - kvm->memslots
...@@ -246,10 +255,11 @@ time it will be set using the Dirty tracking mechanism described above. ...@@ -246,10 +255,11 @@ time it will be set using the Dirty tracking mechanism described above.
The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
if it is needed by multiple functions. if it is needed by multiple functions.
:Name: blocked_vcpu_on_cpu_lock ``wakeup_vcpus_on_cpu_lock``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:Type: spinlock_t :Type: spinlock_t
:Arch: x86 :Arch: x86
:Protects: blocked_vcpu_on_cpu :Protects: wakeup_vcpus_on_cpu
:Comment: This is a per-CPU lock and it is used for VT-d posted-interrupts. :Comment: This is a per-CPU lock and it is used for VT-d posted-interrupts.
When VT-d posted-interrupts is supported and the VM has assigned When VT-d posted-interrupts is supported and the VM has assigned
devices, we put the blocked vCPU on the list blocked_vcpu_on_cpu devices, we put the blocked vCPU on the list blocked_vcpu_on_cpu
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment