[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250513114555.GF25763@noisy.programming.kicks-ass.net>
Date: Tue, 13 May 2025 13:45:55 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Maxim Levitsky <mlevitsk@...hat.com>
Cc: kvm@...r.kernel.org, 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>,
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, Ingo Molnar <mingo@...hat.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Albert Ou <aou@...s.berkeley.edu>
Subject: Re: [PATCH v5 0/6] KVM: lockdep improvements
On Mon, May 12, 2025 at 02:04:01PM -0400, Maxim Levitsky wrote:
> 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(-)
Acked-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Powered by blists - more mailing lists