linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/6] KVM: lockdep improvements
@ 2025-05-12 18:04 Maxim Levitsky
  2025-05-12 18:04 ` [PATCH v5 1/6] locking/mutex: implement mutex_trylock_nested Maxim Levitsky
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Maxim Levitsky @ 2025-05-12 18:04 UTC (permalink / raw)
  To: kvm
  Cc: Suzuki K Poulose, Jing Zhang, H. Peter Anvin, Sebastian Ott,
	Shusen Li, Waiman Long, Thomas Gleixner, linux-arm-kernel,
	Bjorn Helgaas, Borislav Petkov, Anup Patel, Will Deacon,
	Palmer Dabbelt, Alexander Potapenko, kvmarm, Keisuke Nishimura,
	Zenghui Yu, Peter Zijlstra, Atish Patra, Joey Gouly, x86,
	Marc Zyngier, Sean Christopherson, Andre Przywara, Kunkun Jiang,
	linux-riscv, Randy Dunlap, Paolo Bonzini, Boqun Feng,
	Catalin Marinas, Alexandre Ghiti, linux-kernel, Dave Hansen,
	Oliver Upton, kvm-riscv, Maxim Levitsky, Ingo Molnar,
	Paul Walmsley, Albert Ou

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(-)

-- 
2.46.0




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-06-10 19:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-12 18:04 [PATCH v5 0/6] KVM: lockdep improvements Maxim Levitsky
2025-05-12 18:04 ` [PATCH v5 1/6] locking/mutex: implement mutex_trylock_nested Maxim Levitsky
2025-05-12 18:04 ` [PATCH v5 2/6] locking/mutex: implement mutex_lock_killable_nest_lock Maxim Levitsky
2025-05-12 18:04 ` [PATCH v5 3/6] KVM: add kvm_lock_all_vcpus and kvm_trylock_all_vcpus Maxim Levitsky
2025-05-14  9:33   ` Marc Zyngier
2025-05-12 18:04 ` [PATCH v5 4/6] x86: KVM: SVM: use kvm_lock_all_vcpus instead of a custom implementation Maxim Levitsky
2025-05-12 18:04 ` [PATCH v5 5/6] KVM: arm64: use kvm_trylock_all_vcpus when locking all vCPUs Maxim Levitsky
2025-05-14  9:35   ` Marc Zyngier
2025-05-12 18:04 ` [PATCH v5 6/6] RISC-V: KVM: " Maxim Levitsky
2025-05-13 11:18   ` Anup Patel
2025-05-13 11:45 ` [PATCH v5 0/6] KVM: lockdep improvements Peter Zijlstra
2025-06-10 16:28 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).