From: Jan Kiszka <jan.kiszka@siemens.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: xming <xmingske@gmail.com>,
kvm@vger.kernel.org, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: kvm crashes with spice while loading qxl
Date: Tue, 26 Apr 2011 11:06:13 +0200 [thread overview]
Message-ID: <4DB68B05.1090600@siemens.com> (raw)
In-Reply-To: <4DB687F0.20605@redhat.com>
On 2011-04-26 10:53, Gerd Hoffmann wrote:
> Hi,
>
> [ ... back online now ... ]
>
>>> /var/tmp/portage/app-emulation/qemu-kvm-0.14.0/work/qemu-kvm-0.14.0/qemu-kvm.c:1724:
>>>
>>> kvm_mutex_unlock: Assertion `!cpu_single_env' failed.
>
>> That's a spice bug. In fact, there are a lot of
>> qemu_mutex_lock/unlock_iothread in that subsystem. I bet at least a few
>> of them can cause even more subtle problems.
>>
>> Two general issues with dropping the global mutex like this:
>> - The caller of mutex_unlock is responsible for maintaining
>> cpu_single_env across the unlocked phase (that's related to the
>> abort above).
>
> This is true for qemu-kvm only, right?
Nope, this applies to both implementations.
>
> qemu-kvm specific patches which add the cpu_single_env tracking (not
> polished yet) are here:
>
> http://cgit.freedesktop.org/spice/qemu/log/?h=spice.kvm.v28
Cannot spot that quickly: In which way are they specific to qemu-kvm?
If they are, try to focus on upstream first. The qemu-kvm differences
are virtually deprecated, and I hope we can remove them really soon now
(my patches are all ready).
>
>> - Dropping the lock in the middle of a callback is risky. That may
>> enable re-entrances of code sections that weren't designed for this
>
> Hmm, indeed.
>
>> Spice requires a careful review regarding such issues. Or it should
>> pioneer with introducing its own lock so that we can handle at least
>> related I/O activities over the VCPUs without holding the global mutex
>> (but I bet it's not the simplest candidate for such a new scheme).
>
> spice/qxl used to have its own locking scheme. That didn't work out
> though. spice server is threaded and calls back into qxl from spice
> thread context, and some of these callbacks need access to qemu data
> structures (display surface) and thus lock protection which covers more
> than just the spice subsystem.
>
> I'll look hard again whenever I can find a way out of this (preferably
> drop the need for the global lock somehow). For now I'm pretty busy
> with the email backlog though ...
Yeah, I can imagine...
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
WARNING: multiple messages have this Message-ID (diff)
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: xming <xmingske@gmail.com>, qemu-devel <qemu-devel@nongnu.org>,
kvm@vger.kernel.org
Subject: Re: [Qemu-devel] kvm crashes with spice while loading qxl
Date: Tue, 26 Apr 2011 11:06:13 +0200 [thread overview]
Message-ID: <4DB68B05.1090600@siemens.com> (raw)
In-Reply-To: <4DB687F0.20605@redhat.com>
On 2011-04-26 10:53, Gerd Hoffmann wrote:
> Hi,
>
> [ ... back online now ... ]
>
>>> /var/tmp/portage/app-emulation/qemu-kvm-0.14.0/work/qemu-kvm-0.14.0/qemu-kvm.c:1724:
>>>
>>> kvm_mutex_unlock: Assertion `!cpu_single_env' failed.
>
>> That's a spice bug. In fact, there are a lot of
>> qemu_mutex_lock/unlock_iothread in that subsystem. I bet at least a few
>> of them can cause even more subtle problems.
>>
>> Two general issues with dropping the global mutex like this:
>> - The caller of mutex_unlock is responsible for maintaining
>> cpu_single_env across the unlocked phase (that's related to the
>> abort above).
>
> This is true for qemu-kvm only, right?
Nope, this applies to both implementations.
>
> qemu-kvm specific patches which add the cpu_single_env tracking (not
> polished yet) are here:
>
> http://cgit.freedesktop.org/spice/qemu/log/?h=spice.kvm.v28
Cannot spot that quickly: In which way are they specific to qemu-kvm?
If they are, try to focus on upstream first. The qemu-kvm differences
are virtually deprecated, and I hope we can remove them really soon now
(my patches are all ready).
>
>> - Dropping the lock in the middle of a callback is risky. That may
>> enable re-entrances of code sections that weren't designed for this
>
> Hmm, indeed.
>
>> Spice requires a careful review regarding such issues. Or it should
>> pioneer with introducing its own lock so that we can handle at least
>> related I/O activities over the VCPUs without holding the global mutex
>> (but I bet it's not the simplest candidate for such a new scheme).
>
> spice/qxl used to have its own locking scheme. That didn't work out
> though. spice server is threaded and calls back into qxl from spice
> thread context, and some of these callbacks need access to qemu data
> structures (display surface) and thus lock protection which covers more
> than just the spice subsystem.
>
> I'll look hard again whenever I can find a way out of this (preferably
> drop the need for the global lock somehow). For now I'm pretty busy
> with the email backlog though ...
Yeah, I can imagine...
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2011-04-26 9:06 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-26 11:43 kvm crashes with spice while loading qxl xming
2011-02-26 12:29 ` Jan Kiszka
2011-02-26 12:29 ` [Qemu-devel] " Jan Kiszka
2011-02-26 14:44 ` xming
2011-02-26 14:44 ` [Qemu-devel] " xming
2011-02-27 19:03 ` Alon Levy
2011-02-27 19:03 ` Alon Levy
2011-02-27 19:11 ` Jan Kiszka
2011-02-27 19:11 ` Jan Kiszka
2011-02-27 19:16 ` Alon Levy
2011-02-27 19:16 ` Alon Levy
2011-02-27 19:27 ` Jan Kiszka
2011-02-27 19:27 ` Jan Kiszka
2011-02-27 19:29 ` Alon Levy
2011-02-27 19:29 ` Alon Levy
2011-02-27 19:32 ` Alon Levy
2011-02-27 19:32 ` Alon Levy
2011-03-01 12:58 ` Alon Levy
2011-03-01 12:58 ` Alon Levy
2011-03-02 8:22 ` Jan Kiszka
2011-03-02 10:56 ` Alon Levy
2011-03-02 10:56 ` Alon Levy
2011-03-02 11:34 ` Jan Kiszka
2011-03-02 12:32 ` Alon Levy
2011-03-02 12:32 ` Alon Levy
2011-02-28 12:56 ` xming
2011-03-01 3:56 ` Rick Vernam
2011-03-01 3:56 ` [Qemu-devel] " Rick Vernam
2011-03-05 16:35 ` Marcelo Tosatti
2011-03-05 16:35 ` [Qemu-devel] " Marcelo Tosatti
2011-03-05 17:11 ` Paolo Bonzini
2011-03-05 17:11 ` [Qemu-devel] " Paolo Bonzini
2011-03-06 10:30 ` Alon Levy
2011-03-06 10:30 ` [Qemu-devel] " Alon Levy
2011-03-07 16:02 ` Marcelo Tosatti
2011-03-07 16:02 ` [Qemu-devel] " Marcelo Tosatti
2011-03-06 10:38 ` Avi Kivity
2011-03-06 10:38 ` [Qemu-devel] " Avi Kivity
2011-03-07 16:13 ` Marcelo Tosatti
2011-03-07 16:13 ` [Qemu-devel] " Marcelo Tosatti
2011-03-07 22:27 ` Paolo Bonzini
2011-03-07 22:27 ` [Qemu-devel] " Paolo Bonzini
2011-03-08 9:17 ` Avi Kivity
2011-03-08 9:17 ` [Qemu-devel] " Avi Kivity
2011-03-08 9:28 ` Paolo Bonzini
2011-03-08 9:28 ` [Qemu-devel] " Paolo Bonzini
2011-03-08 9:32 ` Avi Kivity
2011-03-08 9:32 ` [Qemu-devel] " Avi Kivity
2011-04-26 8:53 ` Gerd Hoffmann
2011-04-26 8:53 ` [Qemu-devel] " Gerd Hoffmann
2011-04-26 9:06 ` Jan Kiszka [this message]
2011-04-26 9:06 ` Jan Kiszka
2011-04-26 9:43 ` Gerd Hoffmann
2011-04-26 9:43 ` [Qemu-devel] " Gerd Hoffmann
2011-04-26 9:34 ` Alon Levy
2011-04-26 9:34 ` [Qemu-devel] " Alon Levy
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=4DB68B05.1090600@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=xmingske@gmail.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.