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 39BAFC369D9 for ; Wed, 30 Apr 2025 20:41:37 +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=eoN6ay98Q+xXbbunTi0ou75z/sl1HkAV8tEeLt6CXaU=; b=Bn66yag1fVqr6F rOrrEMKY84ezZ7P8QRbtHFltXiCXns7FLF4qAB/9QSE8dni+J506Hys8kM7Jd9VUmqDUWqjxB9mdm 0heWGUZ2pOMEzIrRXI+nYHy4WwWrD1jEkvmX+DUUQF0OA/QQ5UFeS6hlxhoWWZVx2MGytY6TKwQAI aAtXo/nyBrKNvbeVBLQDx96RpCLf8TaDrvNvmF37aR5TKRJYjGPhSk/KC1NYc9qbYb5qwKe6ua3ox rqvQZT3/UVAR+LZ3DBXYuYpK0dlTMEn2drlqVt5pYYutjv6/LfPAZfxOyxlyOaMUefHW7MxgFKSoI lZmGs/c9R9pyu51srHQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uAEFI-0000000Dwzs-2fay; Wed, 30 Apr 2025 20:41:32 +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 1uAE5A-0000000DvMS-1Aq2 for linux-riscv@bombadil.infradead.org; Wed, 30 Apr 2025 20:31:04 +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=aQUxr5K3/pNESmWjaoZBUh7F903MIT8w03jcc9M9AYg=; b=Ob2odvZxPeUceeTHBFlp1EIIUU sOrdAHjwf9KUo7IrNOrrD5OK0clXefpVBefUiB+LgtZo61G/4j8hKzNfJ16F3/bw4cI79mZF5RAU6 CoMsdJ12nXVYXfZJY+Fk5Xz/L2qCt5CLSoFIgwfnFejoZHMP1oJ3GbbVgzEsIYEk3hNUeZwJ5UBqT l0KKrj61JW/roMtzuMix2g27FPIkfD/O/jmgnky8fHchrEd4VvwQzkGNJuWEOdlkN4MtPw8fYOJeY 8SknY5Q8LieNkbHxTGRuedAnwcUF5y2OW7FhYph1ceJfzjRVhPb1SCjEw82QMg28crMLgZWXUwVM8 jxnca1NQ==; 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 1uAE4k-0000000Dpom-2vAf for linux-riscv@lists.infradead.org; Wed, 30 Apr 2025 20:31:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1746045031; 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=aQUxr5K3/pNESmWjaoZBUh7F903MIT8w03jcc9M9AYg=; b=daHOf39gfsCDMoAWLWbGjhHd1yG3lKAg+jPAfebXnU2tEz/skB6xP1k5jJM/hjUVJTUeGw 4HpnHW3TApJaYaqJQBuQ5mXLvEjY/X+U3SGDkQcwI7o2SoU2qnq/KSaZl+lFxOQPsgJ+O9 6Y58rqz8GH/2DAWIJo6ISfKdScUFcbU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1746045031; 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=aQUxr5K3/pNESmWjaoZBUh7F903MIT8w03jcc9M9AYg=; b=daHOf39gfsCDMoAWLWbGjhHd1yG3lKAg+jPAfebXnU2tEz/skB6xP1k5jJM/hjUVJTUeGw 4HpnHW3TApJaYaqJQBuQ5mXLvEjY/X+U3SGDkQcwI7o2SoU2qnq/KSaZl+lFxOQPsgJ+O9 6Y58rqz8GH/2DAWIJo6ISfKdScUFcbU= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-177-TqW5oqXPPQS0_3qrbhafRw-1; Wed, 30 Apr 2025 16:30:27 -0400 X-MC-Unique: TqW5oqXPPQS0_3qrbhafRw-1 X-Mimecast-MFC-AGG-ID: TqW5oqXPPQS0_3qrbhafRw_1746045022 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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 72CF7180098F; Wed, 30 Apr 2025 20:30:21 +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 99F381800871; Wed, 30 Apr 2025 20:30:14 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Cc: linux-riscv@lists.infradead.org, Kunkun Jiang , Waiman Long , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas , Bjorn Helgaas , Boqun Feng , Borislav Petkov , Albert Ou , Anup Patel , Paul Walmsley , Suzuki K Poulose , Palmer Dabbelt , Alexandre Ghiti , Alexander Potapenko , Oliver Upton , Andre Przywara , x86@kernel.org, Joey Gouly , Thomas Gleixner , kvm-riscv@lists.infradead.org, Atish Patra , Ingo Molnar , Jing Zhang , "H. Peter Anvin" , Dave Hansen , kvmarm@lists.linux.dev, Will Deacon , Keisuke Nishimura , Sebastian Ott , Peter Zijlstra , Shusen Li , Paolo Bonzini , Randy Dunlap , Marc Zyngier , Maxim Levitsky , Sean Christopherson , Zenghui Yu Subject: [PATCH v4 0/5] KVM: lockdep improvements Date: Wed, 30 Apr 2025 16:30:08 -0400 Message-ID: <20250430203013.366479-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_213100_309664_FCEC7367 X-CRM114-Status: UNSURE ( 9.59 ) X-CRM114-Notice: Please train this message. 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 (5): locking/mutex: implement mutex_trylock_nested arm64: KVM: use mutex_trylock_nest_lock when locking all vCPUs RISC-V: KVM: switch to kvm_trylock/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 | 32 ++++++++++-- kernel/locking/mutex.c | 21 +++++--- virt/kvm/kvm_main.c | 59 ++++++++++++++++++++++ 12 files changed, 126 insertions(+), 170 deletions(-) -- 2.46.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv