|author||Paolo Bonzini <email@example.com>||2016-12-12 10:12:53 +0100|
|committer||Paolo Bonzini <firstname.lastname@example.org>||2016-12-16 17:53:38 +0100|
KVM: hyperv: fix locking of struct kvm_hv fields
Introduce a new mutex to avoid an AB-BA deadlock between kvm->lock and vcpu->mutex. Protect accesses in kvm_hv_setup_tsc_page too, as suggested by Roman. Reported-by: Dmitry Vyukov <email@example.com> Reviewed-by: Roman Kagan <firstname.lastname@example.org> Signed-off-by: Paolo Bonzini <email@example.com>
Diffstat (limited to 'Documentation')
1 files changed, 6 insertions, 2 deletions
diff --git a/Documentation/virtual/kvm/locking.txt b/Documentation/virtual/kvm/locking.txt
index e5dd9f4d6100..fd013bf4115b 100644
@@ -13,8 +13,12 @@ The acquisition orders for mutexes are as follows:
- kvm->slots_lock is taken outside kvm->irq_lock, though acquiring
them together is quite rare.
-For spinlocks, kvm_lock is taken outside kvm->mmu_lock. Everything
-else is a leaf: no other lock is taken inside the critical sections.
+On x86, vcpu->mutex is taken outside kvm->arch.hyperv.hv_lock.
+For spinlocks, kvm_lock is taken outside kvm->mmu_lock.
+Everything else is a leaf: no other lock is taken inside the critical