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