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 6F42FC636D4 for ; Sat, 11 Feb 2023 00:57:57 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zYV6WWYjfJZmAI739qTqv6OpjjnmTh4Avyk4nuDCg64=; b=DDgMMjb4EtnWUr f5Xm7tcmw6tJPHQAVtJwG7QIGxRzzehUwQfSmPCALiy1u2vcnof7I4n6f1FFX1Y604NqjPy2T88HI 29HeACj5W4YLXCkw+hNzdWinVV/xXf2QiADPeQQkY8aPc0uicEDoAXnSQthocj7ngQi3DCqXA9Hnz 5ixnqXCfkrMqAx1c+SalxBlolQ3aTyFiXI2K7/FzCrCn5ggqc8wg7h3wjvqREQhcMFWPMD9Ky5zL5 4VlVW/4HYsnSfL9dvvlOpwCTXbjg/l7XPvrRGnP9SEJYhW1YcfWqVioVM9JEN2qiqcsYL1iCu/aK2 JpYC8qWLJEinJemmjNZw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQeCL-008AvE-Ow; Sat, 11 Feb 2023 00:57:01 +0000 Received: from out-131.mta1.migadu.com ([2001:41d0:203:375::83]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQeCI-008Ato-UT for linux-arm-kernel@lists.infradead.org; Sat, 11 Feb 2023 00:57:00 +0000 Date: Sat, 11 Feb 2023 00:56:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1676077007; 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: in-reply-to:in-reply-to:references:references; bh=CrZl5vUkAt4FS0BIHrg6dSLC9PKKZUVgtPkff++aKKU=; b=M1D3ha5CpjqEi4ic9S6kXv9kvH72O9KzzXQJ8BAclbXVM2fDAcqmCAbQQqwNH6Jj5Q49Uw m5guz0uEjl6e11QaufMuPnfdnybi7Mw43vV+cqZgSjuMEurSuF5xzYdx0ObOdogNKfMD0X c/NPsYkeY17ZQurvX9sBlCysJ7JcXPQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Jeremy Linton Cc: "linux-arm-kernel@lists.infradead.org" , kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, "linux-kernel@vger.kernel.org" , David Woodhouse , Marc Zyngier Subject: Re: Circular lockdep in kvm_reset_vcpu() ? Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230210_165659_145435_65A888E1 X-CRM114-Status: GOOD ( 12.01 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Jeremy, On Fri, Feb 10, 2023 at 11:46:36AM -0600, Jeremy Linton wrote: > Hi, > > I saw this pop yesterday: You and me both actually! Shame on me, I spoke off-list about this with Marc in passing. Thanks for sending along the report. > [ 78.333360] ====================================================== > [ 78.339541] WARNING: possible circular locking dependency detected > [ 78.345721] 6.2.0-rc7+ #19 Not tainted > [ 78.349470] ------------------------------------------------------ > [ 78.355647] qemu-system-aar/859 is trying to acquire lock: > [ 78.361130] ffff5aa69269eba0 (&host_kvm->lock){+.+.}-{3:3}, at: > kvm_reset_vcpu+0x34/0x274 > [ 78.369344] > [ 78.369344] but task is already holding lock: > [ 78.375182] ffff5aa68768c0b8 (&vcpu->mutex){+.+.}-{3:3}, at: > kvm_vcpu_ioctl+0x8c/0xba0 [...] > It appears to be triggered by the new commit 42a90008f890a ('KVM: Ensure > lockdep knows about kvm->lock vs. vcpu->mutex ordering rule') which is > detecting the vcpu lock grabbed by kvm_vcpu_ioctl() and then the kvm mutext > grabbed by kvm_reset_vcpu(). Right, this commit gave lockdep what it needed to smack us on the head for getting the locking wrong in the arm64 side. As gross as it might be, the right direction is likely to have our own lock in kvm_arch that we can acquire while holding the vcpu mutex. I'll throw a patch at the list once I get done testing it. -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel