Thread (127 messages) 127 messages, 14 authors, 2022-12-01

Re: [PATCH 39/44] KVM: Drop kvm_count_lock and instead protect kvm_usage_count with kvm_lock

From: Sean Christopherson <seanjc@google.com>
Date: 2022-11-03 17:53:46
Also in: kvm, kvm-riscv, kvmarm, linux-arm-kernel, linux-mips, linux-riscv, linux-s390, lkml

On Thu, Nov 03, 2022, Paolo Bonzini wrote:
On 11/3/22 00:19, Sean Christopherson wrote:
quoted
+- kvm_lock is taken outside kvm->mmu_lock
Not surprising since one is a mutex and one is an rwlock. :)
Heh, 

  Signed-off-by: Captain Obvious [off-list ref]
You can drop this hunk as well as the "Opportunistically update KVM's locking
documentation" sentence in the commit message.
Will do.
quoted
  - vcpu->mutex is taken outside kvm->arch.hyperv.hv_lock
  - kvm->arch.mmu_lock is an rwlock.  kvm->arch.tdp_mmu_pages_lock and
@@ -216,15 +220,11 @@ time it will be set using the Dirty tracking mechanism described above.
  :Type:		mutex
  :Arch:		any
  :Protects:	- vm_list
-
-``kvm_count_lock``
-^^^^^^^^^^^^^^^^^^
-
-:Type:		raw_spinlock_t
-:Arch:		any
-:Protects:	- hardware virtualization enable/disable
-:Comment:	'raw' because hardware enabling/disabling must be atomic /wrt
-		migration.
+		- kvm_usage_count
+		- hardware virtualization enable/disable
+		- module probing (x86 only)
What do you mean exactly by "module probing"?  Is it anything else than what
is serialized by vendor_module_lock?
Ooh, I forgot to update this patch after switching to vendor_module_lock.  I
added the above after fixing the first deadlock between kvm_lock and cpu_hotplug_lock,
but later gave up on trying to use kvm_lock after deadlock #2, which is when I
when I realized piggybacking kvm_lock was going to be a maintainance nightmare due.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help