From: Marcelo Tosatti <mtosatti@redhat.com>
To: Jan Kiszka <jan.kiszka@web.de>, xming <xmingske@gmail.com>,
Gerd Hoffmann <kraxel@redhat.com>,
kvm@vger.kernel.org, qemu-devel <qemu-devel@nongnu.org>,
Paolo Bonzini <pbonzini@redhat.com>, Avi Kivity <avi@redhat.com>
Subject: [Qemu-devel] Re: kvm crashes with spice while loading qxl
Date: Mon, 7 Mar 2011 13:02:26 -0300 [thread overview]
Message-ID: <20110307160225.GA10021@amt.cnet> (raw)
In-Reply-To: <20110306103059.GL3222@playa.tlv.redhat.com>
On Sun, Mar 06, 2011 at 12:30:59PM +0200, Alon Levy wrote:
> On Sat, Mar 05, 2011 at 01:35:58PM -0300, Marcelo Tosatti wrote:
> > On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
> > > > at /var/tmp/portage/app-emulation/qemu-kvm-0.14.0/work/qemu-kvm-0.14.0/qemu-kvm.c:1466
> > > > #12 0x00007ffff77bb944 in start_thread () from /lib/libpthread.so.0
> > > > #13 0x00007ffff5e491dd in clone () from /lib/libc.so.6
> > > > (gdb)
> > >
> > > 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).
> > > - 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
> > > (I'm skeptic about the side effects of
> > > qemu_spice_vm_change_state_handler - why dropping the lock here?).
> > >
> > > 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).
> > >
> > > Jan
> > >
> >
> > Agree with the concern regarding spice.
> >
>
> What are the pros and cons of (re)introducing a spice specific lock?
> + simplicity. Only spice touches the spice lock.
> - ? what were the original reasons for Gerd dropping the spice lock?
>
> I have no problem reintroducing this lock, I'm just concerned that it's
> wasted effort because after I send that patch someone will jump and remind
> me why it was removed in the first place.
Well, can't comment on why it was done or a proper way to fix it.
Point is that dropping the global lock requires careful review to verify
safety, as Jan mentioned.
For example, a potential problem would be:
vcpu context iothread context
qxl pio write
drop lock
acquire lock
1) change state
drop lock
acquire lock
1) could be device hotunplug, system reset, etc.
next prev parent reply other threads:[~2011-03-07 16:17 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTint9-P-1jD5pbXstzPcYueLHQ68Rd0T_Chz6xRN@mail.gmail.com>
2011-02-26 12:29 ` [Qemu-devel] Re: kvm crashes with spice while loading qxl Jan Kiszka
2011-02-26 14:44 ` xming
2011-02-27 19:03 ` Alon Levy
2011-02-27 19:11 ` Jan Kiszka
2011-02-27 19:16 ` Alon Levy
2011-02-27 19:27 ` Jan Kiszka
2011-02-27 19:29 ` Alon Levy
2011-02-27 19:32 ` 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 11:34 ` Jan Kiszka
2011-03-02 12:32 ` Alon Levy
2011-02-28 12:56 ` xming
2011-03-01 3:56 ` Rick Vernam
2011-03-05 16:35 ` Marcelo Tosatti
2011-03-05 17:11 ` Paolo Bonzini
2011-03-06 10:30 ` Alon Levy
2011-03-07 16:02 ` Marcelo Tosatti [this message]
2011-03-06 10:38 ` Avi Kivity
2011-03-07 16:13 ` Marcelo Tosatti
2011-03-07 22:27 ` Paolo Bonzini
2011-03-08 9:17 ` Avi Kivity
2011-03-08 9:28 ` Paolo Bonzini
2011-03-08 9:32 ` Avi Kivity
2011-04-26 8:53 ` [Qemu-devel] " Gerd Hoffmann
2011-04-26 9:06 ` Jan Kiszka
2011-04-26 9:43 ` Gerd Hoffmann
2011-04-26 9:34 ` 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=20110307160225.GA10021@amt.cnet \
--to=mtosatti@redhat.com \
--cc=avi@redhat.com \
--cc=jan.kiszka@web.de \
--cc=kraxel@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--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 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).