All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Glauber <jan.glauber@caviumnetworks.com>
To: kvmarm@lists.cs.columbia.edu
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	Christoffer Dall <christoffer.dall@arm.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Potential deadlock in vgic
Date: Fri, 4 May 2018 13:03:44 +0200	[thread overview]
Message-ID: <20180504110343.GA10968@hc> (raw)

Hi all,

enabling lockdep I see the following reported in the host when I start a kvm guest:

[12399.954245]        CPU0                    CPU1
[12399.958762]        ----                    ----
[12399.963279]   lock(&(&dist->lpi_list_lock)->rlock);
[12399.968146]                                local_irq_disable();
[12399.974052]                                lock(&(&vgic_cpu->ap_list_lock)->rlock);
[12399.981696]                                lock(&(&dist->lpi_list_lock)->rlock);
[12399.989081]   <Interrupt>
[12399.991688]     lock(&(&vgic_cpu->ap_list_lock)->rlock);
[12399.996989]
                *** DEADLOCK ***

[12400.002897] 2 locks held by qemu-system-aar/5597:
[12400.007587]  #0: 0000000042beb9dc (&vcpu->mutex){+.+.}, at: kvm_vcpu_ioctl+0x7c/0xa68
[12400.015411]  #1: 00000000c45d644a (&(&vgic_cpu->ap_list_lock)->rlock){-.-.}, at: kvm_vgic_sync_hwstate+0x8c/0x328


There is nothing unusual in my config or qemu parameters, I can upload these
if needed. I see this on ThunderX and ThunderX2 and also with older kernels
(4.13+ distribution kernel).

I tried making the lpi_list_lock irq safe but that just leads to different
warnings. The locking here seems to be quite sophisticated and I'm not familiar
with it.

Full dmesg: https://paste.ubuntu.com/p/BZ5QTg62Ym/

--Jan

WARNING: multiple messages have this Message-ID (diff)
From: jan.glauber@caviumnetworks.com (Jan Glauber)
To: linux-arm-kernel@lists.infradead.org
Subject: Potential deadlock in vgic
Date: Fri, 4 May 2018 13:03:44 +0200	[thread overview]
Message-ID: <20180504110343.GA10968@hc> (raw)

Hi all,

enabling lockdep I see the following reported in the host when I start a kvm guest:

[12399.954245]        CPU0                    CPU1
[12399.958762]        ----                    ----
[12399.963279]   lock(&(&dist->lpi_list_lock)->rlock);
[12399.968146]                                local_irq_disable();
[12399.974052]                                lock(&(&vgic_cpu->ap_list_lock)->rlock);
[12399.981696]                                lock(&(&dist->lpi_list_lock)->rlock);
[12399.989081]   <Interrupt>
[12399.991688]     lock(&(&vgic_cpu->ap_list_lock)->rlock);
[12399.996989]
                *** DEADLOCK ***

[12400.002897] 2 locks held by qemu-system-aar/5597:
[12400.007587]  #0: 0000000042beb9dc (&vcpu->mutex){+.+.}, at: kvm_vcpu_ioctl+0x7c/0xa68
[12400.015411]  #1: 00000000c45d644a (&(&vgic_cpu->ap_list_lock)->rlock){-.-.}, at: kvm_vgic_sync_hwstate+0x8c/0x328


There is nothing unusual in my config or qemu parameters, I can upload these
if needed. I see this on ThunderX and ThunderX2 and also with older kernels
(4.13+ distribution kernel).

I tried making the lpi_list_lock irq safe but that just leads to different
warnings. The locking here seems to be quite sophisticated and I'm not familiar
with it.

Full dmesg: https://paste.ubuntu.com/p/BZ5QTg62Ym/

--Jan

             reply	other threads:[~2018-05-04 11:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 11:03 Jan Glauber [this message]
2018-05-04 11:03 ` Potential deadlock in vgic Jan Glauber
2018-05-04 12:47 ` Christoffer Dall
2018-05-04 12:47   ` Christoffer Dall
2018-05-04 13:08   ` Jan Glauber
2018-05-04 13:08     ` Jan Glauber
2018-05-04 13:41     ` Marc Zyngier
2018-05-04 13:41       ` Marc Zyngier
2018-05-04 14:51     ` Andre Przywara
2018-05-04 14:51       ` Andre Przywara
2018-05-04 15:17     ` Andre Przywara
2018-05-04 15:17       ` Andre Przywara
2018-05-04 16:26       ` Jan Glauber
2018-05-04 16:26         ` Jan Glauber
2018-05-04 16:29         ` Andre Przywara
2018-05-04 16:29           ` Andre Przywara
2018-05-04 16:31       ` Jan Glauber
2018-05-04 16:31         ` Jan Glauber
2018-05-11 14:29         ` Andre Przywara
2018-05-11 14:29           ` Andre Przywara
2018-05-15 11:54           ` Jan Glauber
2018-05-15 11:54             ` Jan Glauber

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=20180504110343.GA10968@hc \
    --to=jan.glauber@caviumnetworks.com \
    --cc=christoffer.dall@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.