[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250430203013.366479-1-mlevitsk@redhat.com>
Date: Wed, 30 Apr 2025 16:30:08 -0400
From: Maxim Levitsky <mlevitsk@...hat.com>
To: kvm@...r.kernel.org
Cc: linux-riscv@...ts.infradead.org,
Kunkun Jiang <jiangkunkun@...wei.com>,
Waiman Long <longman@...hat.com>,
linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Catalin Marinas <catalin.marinas@....com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Boqun Feng <boqun.feng@...il.com>,
Borislav Petkov <bp@...en8.de>,
Albert Ou <aou@...s.berkeley.edu>,
Anup Patel <anup@...infault.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Palmer Dabbelt <palmer@...belt.com>,
Alexandre Ghiti <alex@...ti.fr>,
Alexander Potapenko <glider@...gle.com>,
Oliver Upton <oliver.upton@...ux.dev>,
Andre Przywara <andre.przywara@....com>,
x86@...nel.org,
Joey Gouly <joey.gouly@....com>,
Thomas Gleixner <tglx@...utronix.de>,
kvm-riscv@...ts.infradead.org,
Atish Patra <atishp@...shpatra.org>,
Ingo Molnar <mingo@...hat.com>,
Jing Zhang <jingzhangos@...gle.com>,
"H. Peter Anvin" <hpa@...or.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
kvmarm@...ts.linux.dev,
Will Deacon <will@...nel.org>,
Keisuke Nishimura <keisuke.nishimura@...ia.fr>,
Sebastian Ott <sebott@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Shusen Li <lishusen2@...wei.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Randy Dunlap <rdunlap@...radead.org>,
Marc Zyngier <maz@...nel.org>,
Maxim Levitsky <mlevitsk@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Zenghui Yu <yuzenghui@...wei.com>
Subject: [PATCH v4 0/5] 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.
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
Powered by blists - more mailing lists