Skip to content

KVM: PPC: Book3S: Fix potential deadlocks

Paul Mackerras kvm kvm-ppc 1 version In review

Get series with b4
b4 am 20190523063424.GB19655@blackberry

Versions newest first

  1. v1 Latest4 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: PPC: Book3S HV: Avoid touching arch.mmu_ready in XIVE release functionsarch/powerpc/kvm/book3s_xive.c arch/powerpc/kvm/book3s_xive_native.c+24 -320 replies
2/4KVM: PPC: Book3S HV: Use new mutex to synchronize MMU setuparch/powerpc/include/asm/kvm_host.h arch/powerpc/kvm/book3s_64_mmu_hv.c arch/powerpc/kvm/book3s_hv.c+42 -260 replies
3/4KVM: PPC: Book3S: Use new mutex to synchronize access to rtas token listarch/powerpc/include/asm/kvm_host.h arch/powerpc/kvm/book3s.c arch/powerpc/kvm/book3s_rtas.c+9 -72 replies
4/4KVM: PPC: Book3S HV: Don't take kvm->lock around kvm_for_each_vcpuarch/powerpc/kvm/book3s_hv.c+1 -81 reply

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchCédric Le Goater
1/4
2/4
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] KVM: PPC: Book3S: Fix potential deadlocks

Recent reports of lockdep splats in the HV KVM code revealed that it was taking the kvm->lock mutex in several contexts where a vcpu mutex was already held. Lockdep has only started warning since I added code to take the vcpu mutexes in the XIVE device release functions, but since Documentation/virtual/kvm/locking.txt specifies that the vcpu mutexes nest inside kvm->lock, it seems that the new code is correct and it is most of the old uses of kvm->lock that are wrong.

This series should fix the problems, by adding new mutexes that nest inside the vcpu mutexes and using them instead of kvm->lock.

Paul.