Skip to content

KVM: extract lock_all_vcpus/unlock_all_vcpus

Maxim Levitsky kvm kvm-riscv kvmarm linux-arm-kernel linux-riscv lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 8 repliesIn review
  2. v13 patches 2 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4locking/mutex: implement mutex_trylock_nestedinclude/linux/mutex.h kernel/locking/mutex.c+19 -31 reply
2/4KVM: x86: move sev_lock/unlock_vcpus_for_migration to kvm_main.carch/x86/kvm/svm/sev.c include/linux/kvm_host.h virt/kvm/kvm_main.c+81 -616 replies
3/4KVM: arm64: switch to using kvm_lock/unlock_all_vcpusarch/arm64/include/asm/kvm_host.h arch/arm64/kvm/arch_timer.c arch/arm64/kvm/arm.c +3 more+14 -600 replies
4/4RISC-V: KVM: switch to kvm_lock/unlock_all_vcpusarch/riscv/kvm/aia_device.c+2 -320 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] KVM: extract lock_all_vcpus/unlock_all_vcpus

Implement Paolo's suggestion of reusing sev_lock/unlock_vcpus_for_migration in arm and riscv code for the purpose of taking vcpu->mutex of all vcpus of a VM.

Because sev_lock/unlock_vcpus_for_migration already have a workaround for lockdep max lock depth, this fixes the lockdep warnings on arm which were the inspiration for this refactoring.

This patch series was only compile tested on all 3 architectures.

V2: added trylock option to kvm_lock_all_vcpus to be better compatible with the orginal code.

Best regards,
Maxim Levitsky

Maxim Levitsky (4):
locking/mutex: implement mutex_trylock_nested
KVM: x86: move sev_lock/unlock_vcpus_for_migration to kvm_main.c
KVM: arm64: switch to using kvm_lock/unlock_all_vcpus
RISC-V: KVM: switch to kvm_lock/unlock_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                | 65 ++----------------------
 include/linux/kvm_host.h              |  6 +++
 include/linux/mutex.h                 |  8 +++
 kernel/locking/mutex.c                | 14 ++++--
 virt/kvm/kvm_main.c                   | 71 +++++++++++++++++++++++++++
 12 files changed, 116 insertions(+), 156 deletions(-)
Signature · 1 line
2.26.3