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 4C81DC369DC for ; Wed, 30 Apr 2025 20:33:44 +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:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=jwui+DV8oEf1Mz2wCzfJwjx/NJtLgYAsj5i/g2/gasA=; b=PwOG9kfNNFl/5V aZIZMLYW3dt+F9GOvpT58/EFPBLwXteWvBEbEozDNkJfHPIOmq7Y+jnvkcVv/hLeRYUS43r277hIf doHx4hJn1gxHwh9oRDjH4cRVc65fef3bp95s508VRrjviSvyCRG6irRyk+P0NMgr6zbxu4/BFz0sn 8MBSKK0msJIdwqPAiK4U6NQrHYM6VSY2vyN10gVk/pWbqFFmc+SWPuP4A+wgk7r9ofWqXynny03IP fX6+YL3MLRm/8BDdCWZ6Zu7FlR/pMRX4vaVQytd3G9gZKR+FhyDLyCF0rMvCyKyB+X3+VR1V6NmSG h0CAU2MNAV3K4Nkvetyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uAE7c-0000000DveB-44c8; Wed, 30 Apr 2025 20:33:36 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uAE0S-0000000DuiN-0g6Y for linux-riscv@bombadil.infradead.org; Wed, 30 Apr 2025 20:26:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :Content-Type:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=ueORBRSdk8dfevMNCiszlxJFROHE0iUZRTzx7EwVQFc=; b=K58RzlLwbgPvlRRRcXcGbB0lal fV+/eSloUMII5bKTvb/JoyrJLxlfzbzit4AFAcTPSfqWkC+WtZG0hYE5deLk+4IQqgX16bFAzdAft jzscxvH1ltIOUDTsWxZ9dYttKXuCjhG8uNru3FGlndvjDuT1XbRRC8BfeRCH9PRF95GcASbrm923u Ov7/+WTlJEc8v0CxWR7RymzBF8Yl04riAGLe5yWV9ECQj5vJGTgpJ8lHpC4GS9P9ileK+Vo2PXsnY Ym3vS14lJOa+A6lxZTxmS88cNcYmzUHacl/ntIvvChToYGqr0zwcWBUymdTi//rLI37+de0TU+PHr Yj5BiqVQ==; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by desiato.infradead.org with esmtps (Exim 4.98.1 #2 (Red Hat Linux)) id 1uAE0K-0000000Dpjt-3ak9 for linux-riscv@lists.infradead.org; Wed, 30 Apr 2025 20:26:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1746044761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ueORBRSdk8dfevMNCiszlxJFROHE0iUZRTzx7EwVQFc=; b=FzsBjqovf5Em61qZWv5oBil6LnEmGcZ2waXVAar5dliMhUzKoGjwFkYSW0KFVEC3mekN3V Q/sHdqssgBkmCmWbr1AdEsEnU4nU8hQIHVqL44f9PYJk/ocxlz11S9AEEE4FwGymFyOumS Nbk6vHiWC2QmZ8rGl2qYN3rQWHeoEqc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1746044762; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ueORBRSdk8dfevMNCiszlxJFROHE0iUZRTzx7EwVQFc=; b=OO9uBjn52HmXLMLcvVrrS4QWi/WzIgdlgn8Uh5c+5wKLmtHP0yXyMC9sXb8ABG1MfMuW+x RA6ky6WtYSWEEszJsQhZsmga+xBo5+iNfCxQjfaIzdD+v9EtS3Vxa9GeyfhRmzsH2ERXgh 1c70S07zLJKei4RyNQ/JDKOgOi+tvQo= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-343-Y91AxpyiOD2kIYc-u3Pg8Q-1; Wed, 30 Apr 2025 16:23:34 -0400 X-MC-Unique: Y91AxpyiOD2kIYc-u3Pg8Q-1 X-Mimecast-MFC-AGG-ID: Y91AxpyiOD2kIYc-u3Pg8Q_1746044610 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5EAD11955D77; Wed, 30 Apr 2025 20:23:22 +0000 (UTC) Received: from intellaptop.lan (unknown [10.22.80.5]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E1C381800365; Wed, 30 Apr 2025 20:23:11 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Cc: "H. Peter Anvin" , x86@kernel.org, Maxim Levitsky , Randy Dunlap , Paolo Bonzini , Will Deacon , Oliver Upton , Kunkun Jiang , Jing Zhang , Albert Ou , Keisuke Nishimura , Anup Patel , Catalin Marinas , Atish Patra , kvmarm@lists.linux.dev, Waiman Long , Boqun Feng , linux-arm-kernel@lists.infradead.org, Peter Zijlstra , Dave Hansen , Paul Walmsley , Suzuki K Poulose , Zenghui Yu , Sebastian Ott , Andre Przywara , Ingo Molnar , Alexandre Ghiti , Bjorn Helgaas , Palmer Dabbelt , Joey Gouly , Borislav Petkov , Sean Christopherson , Marc Zyngier , Alexander Potapenko , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Shusen Li , kvm-riscv@lists.infradead.org Subject: [PATCH v3 0/4] KVM: lockdep improvements Date: Wed, 30 Apr 2025 16:23:07 -0400 Message-ID: <20250430202311.364641-1-mlevitsk@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250430_212606_194752_E928A854 X-CRM114-Status: GOOD ( 10.05 ) 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 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 (4): arm64: KVM: use mutex_trylock_nest_lock when locking all vCPUs RISC-V: KVM: switch to kvm_lock/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 | 17 +++++-- kernel/locking/mutex.c | 7 +-- virt/kvm/kvm_main.c | 59 ++++++++++++++++++++++ 12 files changed, 100 insertions(+), 167 deletions(-) -- 2.46.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv