From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5A678C3ABD8 for ; Wed, 14 May 2025 12:18:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RUp1ZK/RDdg1LIdYHCiYNheliseCThEZxYGRWsDDWzs=; b=wgL4csypx50Fep tLzBZjz47aA6BEkm6GI1vBwMYPjZszil3gO8jxfO6EzSMpx2JJZCbey3hdex86PeDPhRAp7x8xxSM 5kWuqdUP9qN6mEwg7M7TtiqI8KfFI1cqE5u3NTFpbqT0Tnkm+ZXfyJoEa+OqXAY9SaDBZtC8YtZ+S 4J95KUgqobGElsej3YUuOJ1N1M/meJDSksXRPcYc0ClQp9AuzeV45pGlZhrx4PTB+AO4T7Mwl9Ch6 Ms5sZ+UFvf07ug6T864adCVaFC7aeuH0rKbo83NCvqixqxbbebxrKJh3ZahdyQ2eTmxMgpwuv8Qn9 IYxpzRLP/dPiGj52m3/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uFB4M-0000000F1BZ-1ZBA; Wed, 14 May 2025 12:18:42 +0000 Received: from nyc.source.kernel.org ([147.75.193.91]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uF8Wa-0000000Egbd-28Ef; Wed, 14 May 2025 09:35:41 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id A1AEEA4C7E5; Wed, 14 May 2025 09:35:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CEC1C4CEE9; Wed, 14 May 2025 09:35:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747215339; bh=N2PyXM6FROVcSjSIaLYgCMb3dTsbrl7AJSDQN1U1u04=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=sdb0oWYGPRGVW14S3qNFZmDkY9UlrzgIiVO2KW3FIHise3aozpuClrVvg29x5PCuh sA8kwGptwEpyb7KayZQCIuStyDbL/xBbLe3pxmOPlZwWD6odYjxty0XwWKh+8un3LZ hVtwNKNkiPlVRZbFvrsa6Vg9WmK5sutPdaUztj/YtaRfyjDglPrnoLqtbB4+uL4/XA kffcDcNjRtEIwbIaA5yQU28F4FHBTdKqRG93lwktG1yguWMZl0Zrl8ig4FMknu9NFm a/rZx8I2ciedLFbT9r4p43cQCag6PXZlU6X1NpHcANKW/DWt2RkaWLgydaGgQMHMjN 9R4o4hpyLrVmw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1uF8WW-00Ens4-VE; Wed, 14 May 2025 10:35:37 +0100 Date: Wed, 14 May 2025 10:35:36 +0100 Message-ID: <86msbffsbb.wl-maz@kernel.org> From: Marc Zyngier To: Maxim Levitsky Cc: kvm@vger.kernel.org, Suzuki K Poulose , Jing Zhang , "H. Peter Anvin" , Sebastian Ott , Shusen Li , Waiman Long , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Bjorn Helgaas , Borislav Petkov , Anup Patel , Will Deacon , Palmer Dabbelt , Alexander Potapenko , kvmarm@lists.linux.dev, Keisuke Nishimura , Zenghui Yu , Peter Zijlstra , Atish Patra , Joey Gouly , x86@kernel.org, Sean Christopherson , Andre Przywara , Kunkun Jiang , linux-riscv@lists.infradead.org, Randy Dunlap , Paolo Bonzini , Boqun Feng , Catalin Marinas , Alexandre Ghiti , linux-kernel@vger.kernel.org, Dave Hansen , Oliver Upton , kvm-riscv@lists.infradead.org, Ingo Molnar , Paul Walmsley , Albert Ou Subject: Re: [PATCH v5 5/6] KVM: arm64: use kvm_trylock_all_vcpus when locking all vCPUs In-Reply-To: <20250512180407.659015-6-mlevitsk@redhat.com> References: <20250512180407.659015-1-mlevitsk@redhat.com> <20250512180407.659015-6-mlevitsk@redhat.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/30.1 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: mlevitsk@redhat.com, kvm@vger.kernel.org, suzuki.poulose@arm.com, jingzhangos@google.com, hpa@zytor.com, sebott@redhat.com, lishusen2@huawei.com, longman@redhat.com, tglx@linutronix.de, linux-arm-kernel@lists.infradead.org, bhelgaas@google.com, bp@alien8.de, anup@brainfault.org, will@kernel.org, palmer@dabbelt.com, glider@google.com, kvmarm@lists.linux.dev, keisuke.nishimura@inria.fr, yuzenghui@huawei.com, peterz@infradead.org, atishp@atishpatra.org, joey.gouly@arm.com, x86@kernel.org, seanjc@google.com, andre.przywara@arm.com, jiangkunkun@huawei.com, linux-riscv@lists.infradead.org, rdunlap@infradead.org, pbonzini@redhat.com, boqun.feng@gmail.com, catalin.marinas@arm.com, alex@ghiti.fr, linux-kernel@vger.kernel.org, dave.hansen@linux.intel.com, oliver.upton@linux.dev, kvm-riscv@lists.infradead.org, mingo@redhat.com, paul.walmsley@sifive.com, aou@eecs.berkeley.edu X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250514_023540_682162_39FF3E3B X-CRM114-Status: GOOD ( 16.96 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Mon, 12 May 2025 19:04:06 +0100, Maxim Levitsky wrote: > > Use kvm_trylock_all_vcpus instead of a custom implementation when locking > all vCPUs of a VM, to avoid triggering a lockdep warning, in the case in > which the VM is configured to have more than MAX_LOCK_DEPTH vCPUs. > > This fixes the following false lockdep warning: > > [ 328.171264] BUG: MAX_LOCK_DEPTH too low! > [ 328.175227] turning off the locking correctness validator. > [ 328.180726] Please attach the output of /proc/lock_stat to the bug report > [ 328.187531] depth: 48 max: 48! > [ 328.190678] 48 locks held by qemu-kvm/11664: > [ 328.194957] #0: ffff800086de5ba0 (&kvm->lock){+.+.}-{3:3}, at: kvm_ioctl_create_device+0x174/0x5b0 > [ 328.204048] #1: ffff0800e78800b8 (&vcpu->mutex){+.+.}-{3:3}, at: lock_all_vcpus+0x16c/0x2a0 > [ 328.212521] #2: ffff07ffeee51e98 (&vcpu->mutex){+.+.}-{3:3}, at: lock_all_vcpus+0x16c/0x2a0 > [ 328.220991] #3: ffff0800dc7d80b8 (&vcpu->mutex){+.+.}-{3:3}, at: lock_all_vcpus+0x16c/0x2a0 > [ 328.229463] #4: ffff07ffe0c980b8 (&vcpu->mutex){+.+.}-{3:3}, at: lock_all_vcpus+0x16c/0x2a0 > [ 328.237934] #5: ffff0800a3883c78 (&vcpu->mutex){+.+.}-{3:3}, at: lock_all_vcpus+0x16c/0x2a0 > [ 328.246405] #6: ffff07fffbe480b8 (&vcpu->mutex){+.+.}-{3:3}, at: lock_all_vcpus+0x16c/0x2a0 > > Suggested-by: Paolo Bonzini > Signed-off-by: Maxim Levitsky Acked-by: Marc Zyngier Paolo: if you are queuing this for 6.16, please put it on a stable branch so that I can merge it back in case of conflicts. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv