[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z_bQS63A2bd-LzgQ@google.com>
Date: Wed, 9 Apr 2025 12:53:47 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Maxim Levitsky <mlevitsk@...hat.com>
Cc: kvm@...r.kernel.org, Alexander Potapenko <glider@...gle.com>,
"H. Peter Anvin" <hpa@...or.com>, Suzuki K Poulose <suzuki.poulose@....com>, kvm-riscv@...ts.infradead.org,
Oliver Upton <oliver.upton@...ux.dev>, Dave Hansen <dave.hansen@...ux.intel.com>,
Jing Zhang <jingzhangos@...gle.com>, Waiman Long <longman@...hat.com>, x86@...nel.org,
Kunkun Jiang <jiangkunkun@...wei.com>, Boqun Feng <boqun.feng@...il.com>,
Anup Patel <anup@...infault.org>, Albert Ou <aou@...s.berkeley.edu>, kvmarm@...ts.linux.dev,
linux-kernel@...r.kernel.org, Zenghui Yu <yuzenghui@...wei.com>,
Borislav Petkov <bp@...en8.de>, Alexandre Ghiti <alex@...ti.fr>,
Keisuke Nishimura <keisuke.nishimura@...ia.fr>, Sebastian Ott <sebott@...hat.com>,
Paolo Bonzini <pbonzini@...hat.com>, Atish Patra <atishp@...shpatra.org>,
Paul Walmsley <paul.walmsley@...ive.com>, Randy Dunlap <rdunlap@...radead.org>,
Will Deacon <will@...nel.org>, Palmer Dabbelt <palmer@...belt.com>, linux-riscv@...ts.infradead.org,
Marc Zyngier <maz@...nel.org>, linux-arm-kernel@...ts.infradead.org,
Joey Gouly <joey.gouly@....com>, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>, Andre Przywara <andre.przywara@....com>,
Thomas Gleixner <tglx@...utronix.de>, Catalin Marinas <catalin.marinas@....com>,
Bjorn Helgaas <bhelgaas@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>
Subject: Re: [PATCH v2 0/4] KVM: extract lock_all_vcpus/unlock_all_vcpus
+Adrian
On Tue, Apr 08, 2025, Maxim Levitsky wrote:
> Implement Paolo's suggestion of reusing
Ha! I *knew* this felt familiar when I suggested extracting (un)lock_all_vcpus()
to common code in the context of the TDX series.
https://lore.kernel.org/all/Z-V0qyTn2bXdrPF7@google.com
> sev_lock/unlock_vcpus_for_migration in arm and riscv code
> for the purpose of taking vcpu->mutex of all vcpus of a VM.
>
> Because sev_lock/unlock_vcpus_for_migration already have a workaround
> for lockdep max lock depth, this fixes the lockdep warnings on arm
> which were the inspiration for this refactoring.
>
> This patch series was only compile tested on all 3 architectures.
>
> V2: added trylock option to kvm_lock_all_vcpus to be better compatible
> with the orginal code.
>
> Best regards,
> Maxim Levitsky
>
> Maxim Levitsky (4):
> locking/mutex: implement mutex_trylock_nested
> KVM: x86: move sev_lock/unlock_vcpus_for_migration to kvm_main.c
> KVM: arm64: switch to using kvm_lock/unlock_all_vcpus
> RISC-V: KVM: switch to kvm_lock/unlock_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 | 65 ++----------------------
> include/linux/kvm_host.h | 6 +++
> include/linux/mutex.h | 8 +++
> kernel/locking/mutex.c | 14 ++++--
> virt/kvm/kvm_main.c | 71 +++++++++++++++++++++++++++
> 12 files changed, 116 insertions(+), 156 deletions(-)
>
> --
> 2.26.3
>
>
Powered by blists - more mailing lists