Skip to content

KVM: lockdep improvements

Maxim Levitsky kvm kvm-riscv kvmarm linux-arm-kernel linux-riscv lkml 3 versions – Applied

Status from this message: Queued, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest6 patches 5 repliesApplied 6/6
  2. v45 patches 8 repliesSuperseded
  3. v34 patches 1 replySuperseded

Patches in v5 All 6 applied

#Subject and filesSizeRepliesApplied
1/6locking/mutex: implement mutex_trylock_nestedinclude/linux/mutex.h kernel/locking/mutex.c+26 -30 repliesApplied
2/6locking/mutex: implement mutex_lock_killable_nest_lockinclude/linux/mutex.h kernel/locking/mutex.c+17 -70 repliesApplied
3/6KVM: add kvm_lock_all_vcpus and kvm_trylock_all_vcpusinclude/linux/kvm_host.h virt/kvm/kvm_main.c+63 -01 replyApplied
4/6x86: KVM: SVM: use kvm_lock_all_vcpus instead of a custom implementationarch/x86/kvm/svm/sev.c+4 -680 repliesApplied
5/6KVM: arm64: use kvm_trylock_all_vcpus when locking all vCPUsarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/arch_timer.c arch/arm64/kvm/arm.c +3 more+14 -601 replyApplied
6/6RISC-V: KVM: use kvm_trylock_all_vcpus when locking all vCPUsarch/riscv/kvm/aia_device.c+2 -321 replyApplied

Reviews trailers per patch

3 of 6 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAnup PatelPeter Zijlstra (Intel)Marc Zyngier
SeriesA-b
1/6
2/6
3/6A-b
4/6
5/6A-b
6/6T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v5 thread

Cover letter [PATCH v5 0/6] KVM: lockdep improvements

This is a continuation of my 'extract lock_all_vcpus/unlock_all_vcpus'
patch series.

Implement the suggestion of using lockdep's "nest_lock" feature when locking all KVM vCPUs by adding mutex_trylock_nest_lock() and
mutex_lock_killable_nest_lock() and use these functions in the
implementation of the kvm_trylock_all_vcpus()/kvm_lock_all_vcpus()/kvm_unlock_all_vcpus().

Those changes allow removal of a custom workaround that was needed to silence the lockdep warning in the SEV code and also stop lockdep from complaining in case of ARM and RISC-V code which doesn't include the above mentioned workaround.

Finally, it's worth noting that this patch series removes a fair amount of duplicate code by implementing the logic in one place.

V5: addressed review feedback.

Best regards,
Maxim Levitsky

Maxim Levitsky (6):
locking/mutex: implement mutex_trylock_nested locking/mutex: implement mutex_lock_killable_nest_lock
KVM: add kvm_lock_all_vcpus and kvm_trylock_all_vcpus
x86: KVM: SVM: use kvm_lock_all_vcpus instead of a custom
implementation
KVM: arm64: use kvm_trylock_all_vcpus when locking all vCPUs
RISC-V: KVM: use kvm_trylock_all_vcpus when locking all vCPUs

 arch/arm64/include/asm/kvm_host.h     |  3 --
 arch/arm64/kvm/arch_timer.c           |  4 +-
 arch/arm64/kvm/arm.c                  | 43 ----------------
 arch/arm64/kvm/vgic/vgic-init.c       |  4 +-
 arch/arm64/kvm/vgic/vgic-its.c        |  8 +--
 arch/arm64/kvm/vgic/vgic-kvm-device.c | 12 ++---
 arch/riscv/kvm/aia_device.c           | 34 +------------
 arch/x86/kvm/svm/sev.c                | 72 ++-------------------------
 include/linux/kvm_host.h              |  4 ++
 include/linux/mutex.h                 | 32 ++++++++++--
 kernel/locking/mutex.c                | 21 +++++---
 virt/kvm/kvm_main.c                   | 59 ++++++++++++++++++++++
 12 files changed, 126 insertions(+), 170 deletions(-)
Signature · 1 line
2.46.0