From: Oliver Upton <oliver.upton@linux.dev>
To: Jeremy Linton <jeremy.linton@arm.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
David Woodhouse <dwmw@amazon.co.uk>,
Marc Zyngier <marc.zyngier@arm.com>
Subject: Re: Circular lockdep in kvm_reset_vcpu() ?
Date: Sat, 11 Feb 2023 00:56:41 +0000 [thread overview]
Message-ID: <Y+bnybGEkMpZzm/y@linux.dev> (raw)
In-Reply-To: <f6452cdd-65ff-34b8-bab0-5c06416da5f6@arm.com>
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
next prev parent reply other threads:[~2023-02-11 0:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 17:46 Circular lockdep in kvm_reset_vcpu() ? Jeremy Linton
2023-02-11 0:56 ` Oliver Upton [this message]
2023-03-13 10:09 ` Cristian Marussi
2023-03-13 14:09 ` Marc Zyngier
2023-03-13 18:20 ` Cristian Marussi
[not found] ` <82978ec75c0b34203dd1df693e7adf83@kernel.org>
2023-03-14 11:04 ` Cristian Marussi
2023-03-14 11:42 ` Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y+bnybGEkMpZzm/y@linux.dev \
--to=oliver.upton@linux.dev \
--cc=dwmw@amazon.co.uk \
--cc=jeremy.linton@arm.com \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marc.zyngier@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).