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

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.

Best regards,
	Maxim Levitsky

Maxim Levitsky (5):
  locking/mutex: implement mutex_trylock_nested
  arm64: KVM: use mutex_trylock_nest_lock when locking all vCPUs
  RISC-V: KVM: switch to kvm_trylock/unlock_all_vcpus
  locking/mutex: implement mutex_lock_killable_nest_lock
  x86: KVM: SEV: implement kvm_lock_all_vcpus and use it

 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] 14+ messages in thread

end of thread, other threads:[~2025-05-03 10:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-30 20:30 [PATCH v4 0/5] KVM: lockdep improvements Maxim Levitsky
2025-04-30 20:30 ` [PATCH v4 1/5] locking/mutex: implement mutex_trylock_nested Maxim Levitsky
2025-04-30 20:30 ` [PATCH v4 2/5] arm64: KVM: use mutex_trylock_nest_lock when locking all vCPUs Maxim Levitsky
2025-05-01  8:24   ` Marc Zyngier
2025-05-01 11:15     ` Peter Zijlstra
2025-05-01 12:44       ` Marc Zyngier
2025-05-01 13:41         ` Peter Zijlstra
2025-05-01 13:55           ` Marc Zyngier
2025-05-02 20:58     ` Sean Christopherson
2025-04-30 20:30 ` [PATCH v4 3/5] RISC-V: KVM: switch to kvm_trylock/unlock_all_vcpus Maxim Levitsky
2025-04-30 20:30 ` [PATCH v4 4/5] locking/mutex: implement mutex_lock_killable_nest_lock Maxim Levitsky
2025-04-30 20:30 ` [PATCH v4 5/5] x86: KVM: SEV: implement kvm_lock_all_vcpus and use it Maxim Levitsky
2025-05-02 20:57   ` Sean Christopherson
2025-05-03 10:08     ` Peter Zijlstra

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