Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-03-02 Thread Jan Kiszka
On 2011-03-01 13:58, Alon Levy wrote:
 On Sun, Feb 27, 2011 at 08:11:26PM +0100, Jan Kiszka wrote:
 On 2011-02-27 20:03, Alon Levy wrote:
 On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
 On 2011-02-26 12:43, xming wrote:
 When trying to start X (and it loads qxl driver) the kvm process just 
 crashes.

 This is fixed by Gerd's attached patch (taken from rhel repository, don't 
 know
 why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list as 
 well (separate email).

 Patch looks OK on first glance, but the changelog is misleading: This
 was broken for _both_ trees, but upstream didn't detect the bug.
 
 So I didn't test with qemu not having this patch, but according to the 
 discussion in the
 launchpad bug the problem only happens with qemu-kvm. This doesn't rule out 
 it being a
 bug, perhaps it is just triggered much less frequently I guess.

Again: qemu-kvm has the instrumentation to detect the bug, qemu is
lacking this, but both trees will break subtly if cpu_current_env is not
properly restored.

Jan



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-03-02 Thread Alon Levy
On Wed, Mar 02, 2011 at 09:22:35AM +0100, Jan Kiszka wrote:
 On 2011-03-01 13:58, Alon Levy wrote:
  On Sun, Feb 27, 2011 at 08:11:26PM +0100, Jan Kiszka wrote:
  On 2011-02-27 20:03, Alon Levy wrote:
  On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
  On 2011-02-26 12:43, xming wrote:
  When trying to start X (and it loads qxl driver) the kvm process just 
  crashes.
 
  This is fixed by Gerd's attached patch (taken from rhel repository, don't 
  know
  why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list as 
  well (separate email).
 
  Patch looks OK on first glance, but the changelog is misleading: This
  was broken for _both_ trees, but upstream didn't detect the bug.
  
  So I didn't test with qemu not having this patch, but according to the 
  discussion in the
  launchpad bug the problem only happens with qemu-kvm. This doesn't rule out 
  it being a
  bug, perhaps it is just triggered much less frequently I guess.
 
 Again: qemu-kvm has the instrumentation to detect the bug, qemu is
 lacking this, but both trees will break subtly if cpu_current_env is not
 properly restored.

ok, so what do you want to be done further before this patch is applied?

 
 Jan
 


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-03-02 Thread Jan Kiszka
On 2011-03-02 11:56, Alon Levy wrote:
 On Wed, Mar 02, 2011 at 09:22:35AM +0100, Jan Kiszka wrote:
 On 2011-03-01 13:58, Alon Levy wrote:
 On Sun, Feb 27, 2011 at 08:11:26PM +0100, Jan Kiszka wrote:
 On 2011-02-27 20:03, Alon Levy wrote:
 On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
 On 2011-02-26 12:43, xming wrote:
 When trying to start X (and it loads qxl driver) the kvm process just 
 crashes.

 This is fixed by Gerd's attached patch (taken from rhel repository, don't 
 know
 why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list as 
 well (separate email).

 Patch looks OK on first glance, but the changelog is misleading: This
 was broken for _both_ trees, but upstream didn't detect the bug.

 So I didn't test with qemu not having this patch, but according to the 
 discussion in the
 launchpad bug the problem only happens with qemu-kvm. This doesn't rule out 
 it being a
 bug, perhaps it is just triggered much less frequently I guess.

 Again: qemu-kvm has the instrumentation to detect the bug, qemu is
 lacking this, but both trees will break subtly if cpu_current_env is not
 properly restored.
 
 ok, so what do you want to be done further before this patch is applied?

The patch posted to qemu-devel just requires a changelog that correctly
reflects what it addresses (and where).

Jan



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-03-02 Thread Alon Levy
On Wed, Mar 02, 2011 at 12:34:24PM +0100, Jan Kiszka wrote:
 On 2011-03-02 11:56, Alon Levy wrote:
  On Wed, Mar 02, 2011 at 09:22:35AM +0100, Jan Kiszka wrote:
  On 2011-03-01 13:58, Alon Levy wrote:
  On Sun, Feb 27, 2011 at 08:11:26PM +0100, Jan Kiszka wrote:
  On 2011-02-27 20:03, Alon Levy wrote:
  On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
  On 2011-02-26 12:43, xming wrote:
  When trying to start X (and it loads qxl driver) the kvm process just 
  crashes.
 
  This is fixed by Gerd's attached patch (taken from rhel repository, 
  don't know
  why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list as 
  well (separate email).
 
  Patch looks OK on first glance, but the changelog is misleading: This
  was broken for _both_ trees, but upstream didn't detect the bug.
 
  So I didn't test with qemu not having this patch, but according to the 
  discussion in the
  launchpad bug the problem only happens with qemu-kvm. This doesn't rule 
  out it being a
  bug, perhaps it is just triggered much less frequently I guess.
 
  Again: qemu-kvm has the instrumentation to detect the bug, qemu is
  lacking this, but both trees will break subtly if cpu_current_env is not
  properly restored.
  
  ok, so what do you want to be done further before this patch is applied?
 
 The patch posted to qemu-devel just requires a changelog that correctly
 reflects what it addresses (and where).

Just sent,

Alon

 
 Jan
 


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-03-01 Thread Alon Levy
On Sun, Feb 27, 2011 at 08:11:26PM +0100, Jan Kiszka wrote:
 On 2011-02-27 20:03, Alon Levy wrote:
  On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
  On 2011-02-26 12:43, xming wrote:
  When trying to start X (and it loads qxl driver) the kvm process just 
  crashes.
  
  This is fixed by Gerd's attached patch (taken from rhel repository, don't 
  know
  why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list as 
  well (separate email).
 
 Patch looks OK on first glance, but the changelog is misleading: This
 was broken for _both_ trees, but upstream didn't detect the bug.

So I didn't test with qemu not having this patch, but according to the 
discussion in the
launchpad bug the problem only happens with qemu-kvm. This doesn't rule out it 
being a
bug, perhaps it is just triggered much less frequently I guess.

 
 My concerns regarding other side effects of juggling with global mutex
 in spice code remain.
 
 Jan
 


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-02-28 Thread xming
On Sun, Feb 27, 2011 at 8:03 PM, Alon Levy al...@redhat.com wrote:
 On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
 On 2011-02-26 12:43, xming wrote:
  When trying to start X (and it loads qxl driver) the kvm process just 
  crashes.

 This is fixed by Gerd's attached patch (taken from rhel repository, don't know
 why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list as well 
 (separate email).

I can confirm that this patch fixes the issue, thanks a lot

cheers
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-02-28 Thread Rick Vernam
On Sunday 27 February 2011 13:03:14 Alon Levy wrote:
 On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
  On 2011-02-26 12:43, xming wrote:
   When trying to start X (and it loads qxl driver) the kvm process just
   crashes.
 
 This is fixed by Gerd's attached patch (taken from rhel repository, don't
 know why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list
 as well (separate email).
 

This patch also fixed
https://bugs.launchpad.net/bugs/723871
I created the bug report on launchpad, but I suppose it should be left open 
until the patch hits qemu-kvm?

-Rick
--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-02-27 Thread Alon Levy
On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
 On 2011-02-26 12:43, xming wrote:
  When trying to start X (and it loads qxl driver) the kvm process just 
  crashes.

This is fixed by Gerd's attached patch (taken from rhel repository, don't know
why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list as well 
(separate email).

  
  qemu-kvm 0.14
  
  startup line
  
  /usr/bin/kvm -name spaceball,process=spaceball -m 1024 -kernel
  /boot/bzImage-2.6.37.2-guest -append root=/dev/vda ro -smp 1 -netdev
  type=tap,id=spaceball0,script=kvm-ifup-brloc,vhost=on -device
  virtio-net-pci,netdev=spaceball0,mac=00:16:3e:00:08:01 -drive
  file=/dev/volume01/G-spaceball,if=virtio -vga qxl -spice
  port=5957,disable-ticketing -monitor
  telnet:192.168.0.254:10007,server,nowait,nodelay -pidfile
  /var/run/kvm/spaceball.pid
  
  host is running vanilla 2.6.37.1 on amd64.
  
  Here is the bt
  
  # gdb /usr/bin/qemu-system-x86_64
  GNU gdb (Gentoo 7.2 p1) 7.2
  Copyright (C) 2010 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later 
  http://gnu.org/licenses/gpl.html
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type show copying
  and show warranty for details.
  This GDB was configured as x86_64-pc-linux-gnu.
  For bug reporting instructions, please see:
  http://bugs.gentoo.org/...
  Reading symbols from /usr/bin/qemu-system-x86_64...done.
  (gdb) set args -name spaceball,process=spaceball -m 1024 -kernel
  /boot/bzImage-2.6.37.2-guest -append root=/dev/vda ro -smp 1 -netdev
  type=tap,id=spaceball0,script=kvm-ifup-brloc,vhost=on -device
  virtio-net-pci,netdev=spaceball0,mac=00:16:3e:00:08:01 -drive
  file=/dev/volume01/G-spaceball,if=virtio -vga qxl -spice
  port=5957,disable-ticketing -monitor
  telnet:192.168.0.254:10007,server,nowait,nodelay -pidfile
  /var/run/kvm/spaceball.pid
  (gdb) run
  Starting program: /usr/bin/qemu-system-x86_64 -name
  spaceball,process=spaceball -m 1024 -kernel
  /boot/bzImage-2.6.37.2-guest -append root=/dev/vda ro -smp 1 -netdev
  type=tap,id=spaceball0,script=kvm-ifup-brloc,vhost=on -device
  virtio-net-pci,netdev=spaceball0,mac=00:16:3e:00:08:01 -drive
  file=/dev/volume01/G-spaceball,if=virtio -vga qxl -spice
  port=5957,disable-ticketing -monitor
  telnet:192.168.0.254:10007,server,nowait,nodelay -pidfile
  /var/run/kvm/spaceball.pid
  [Thread debugging using libthread_db enabled]
  do_spice_init: starting 0.6.0
  spice_server_add_interface: SPICE_INTERFACE_KEYBOARD
  spice_server_add_interface: SPICE_INTERFACE_MOUSE
  [New Thread 0x74802710 (LWP 30294)]
  spice_server_add_interface: SPICE_INTERFACE_QXL
  [New Thread 0x7fffaacae710 (LWP 30295)]
  red_worker_main: begin
  handle_dev_destroy_surfaces:
  handle_dev_destroy_surfaces:
  handle_dev_input: start
  [New Thread 0x7fffaa4ad710 (LWP 30298)]
  [New Thread 0x7fffa9cac710 (LWP 30299)]
  [New Thread 0x7fffa94ab710 (LWP 30300)]
  [New Thread 0x7fffa8caa710 (LWP 30301)]
  [New Thread 0x7fffa3fff710 (LWP 30302)]
  [New Thread 0x7fffa37fe710 (LWP 30303)]
  [New Thread 0x7fffa2ffd710 (LWP 30304)]
  [New Thread 0x7fffa27fc710 (LWP 30305)]
  [New Thread 0x7fffa1ffb710 (LWP 30306)]
  [New Thread 0x7fffa17fa710 (LWP 30307)]
  reds_handle_main_link:
  reds_show_new_channel: channel 1:0, connected successfully, over Non Secure 
  link
  reds_main_handle_message: net test: latency 5.636000 ms, bitrate
  11027768 bps (10.516899 Mbps)
  reds_show_new_channel: channel 2:0, connected successfully, over Non Secure 
  link
  red_dispatcher_set_peer:
  handle_dev_input: connect
  handle_new_display_channel: jpeg disabled
  handle_new_display_channel: zlib-over-glz disabled
  reds_show_new_channel: channel 4:0, connected successfully, over Non Secure 
  link
  red_dispatcher_set_cursor_peer:
  handle_dev_input: cursor connect
  reds_show_new_channel: channel 3:0, connected successfully, over Non Secure 
  link
  inputs_link:
  [New Thread 0x7fffa07f8710 (LWP 30312)]
  [New Thread 0x7fff9fff7710 (LWP 30313)]
  [New Thread 0x7fff9f7f6710 (LWP 30314)]
  [New Thread 0x7fff9eff5710 (LWP 30315)]
  [New Thread 0x7fff9e7f4710 (LWP 30316)]
  [New Thread 0x7fff9dff3710 (LWP 30317)]
  [New Thread 0x7fff9d7f2710 (LWP 30318)]
  qemu-system-x86_64:
  /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.
  
  Program received signal SIGABRT, Aborted.
  [Switching to Thread 0x74802710 (LWP 30294)]
  0x75daa165 in raise () from /lib/libc.so.6
  (gdb)
  (gdb)
  (gdb)
  (gdb)
  (gdb) bt
  #0  0x75daa165 in raise () from /lib/libc.so.6
  #1  0x75dab580 in abort () from /lib/libc.so.6
  #2  0x75da3201 in __assert_fail () from /lib/libc.so.6
  #3  0x00436f7e in kvm_mutex_unlock ()
  at 
  /var/tmp/portage/app-emulation/qemu-kvm-0.14.0/work/qemu-kvm-0.14.0/qemu-kvm.c:1724
  #4  qemu_mutex_unlock_iothread ()

Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-02-27 Thread Jan Kiszka
On 2011-02-27 20:03, Alon Levy wrote:
 On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
 On 2011-02-26 12:43, xming wrote:
 When trying to start X (and it loads qxl driver) the kvm process just 
 crashes.
 
 This is fixed by Gerd's attached patch (taken from rhel repository, don't know
 why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list as well 
 (separate email).

Patch looks OK on first glance, but the changelog is misleading: This
was broken for _both_ trees, but upstream didn't detect the bug.

My concerns regarding other side effects of juggling with global mutex
in spice code remain.

Jan



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-02-27 Thread Alon Levy
On Sun, Feb 27, 2011 at 08:11:26PM +0100, Jan Kiszka wrote:
 On 2011-02-27 20:03, Alon Levy wrote:
  On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
  On 2011-02-26 12:43, xming wrote:
  When trying to start X (and it loads qxl driver) the kvm process just 
  crashes.
  
  This is fixed by Gerd's attached patch (taken from rhel repository, don't 
  know
  why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list as 
  well (separate email).
 
 Patch looks OK on first glance, but the changelog is misleading: This
 was broken for _both_ trees, but upstream didn't detect the bug.
 

The trees the patch commit message refers to are qemu and qemu-kvm. qemu 
doesn't even
have cpu_single_env. It didn't talk about two qemu-kvm trees.

 My concerns regarding other side effects of juggling with global mutex
 in spice code remain.

I know there used to be a mutex in spice code and during the upstreaming 
process it
got ditched in favor of the qemu global io mutex. I would have rather deferred 
this
to Gerd since he wrote this, but he is not available atm.

 
 Jan
 


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-02-27 Thread Jan Kiszka
On 2011-02-27 20:16, Alon Levy wrote:
 On Sun, Feb 27, 2011 at 08:11:26PM +0100, Jan Kiszka wrote:
 On 2011-02-27 20:03, Alon Levy wrote:
 On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
 On 2011-02-26 12:43, xming wrote:
 When trying to start X (and it loads qxl driver) the kvm process just 
 crashes.

 This is fixed by Gerd's attached patch (taken from rhel repository, don't 
 know
 why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list as 
 well (separate email).

 Patch looks OK on first glance, but the changelog is misleading: This
 was broken for _both_ trees, but upstream didn't detect the bug.

 
 The trees the patch commit message refers to are qemu and qemu-kvm.

The same did I.

 qemu doesn't even have cpu_single_env.

Really? Check again. :)

 It didn't talk about two qemu-kvm trees.
 
 My concerns regarding other side effects of juggling with global mutex
 in spice code remain.
 
 I know there used to be a mutex in spice code and during the upstreaming 
 process it
 got ditched in favor of the qemu global io mutex. I would have rather 
 deferred this
 to Gerd since he wrote this, but he is not available atm.

It's not necessarily bad to drop the io mutex, but it is more tricky
than it may appear on first glance.

Jan



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-02-27 Thread Alon Levy
On Sun, Feb 27, 2011 at 08:27:01PM +0100, Jan Kiszka wrote:
 On 2011-02-27 20:16, Alon Levy wrote:
  On Sun, Feb 27, 2011 at 08:11:26PM +0100, Jan Kiszka wrote:
  On 2011-02-27 20:03, Alon Levy wrote:
  On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
  On 2011-02-26 12:43, xming wrote:
  When trying to start X (and it loads qxl driver) the kvm process just 
  crashes.
 
  This is fixed by Gerd's attached patch (taken from rhel repository, don't 
  know
  why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list as 
  well (separate email).
 
  Patch looks OK on first glance, but the changelog is misleading: This
  was broken for _both_ trees, but upstream didn't detect the bug.
 
  
  The trees the patch commit message refers to are qemu and qemu-kvm.
 
 The same did I.
 
  qemu doesn't even have cpu_single_env.
 
 Really? Check again. :)

Sorry, grepped the wrong repo. I'll send this to qemu-devel too then.

 
  It didn't talk about two qemu-kvm trees.
  
  My concerns regarding other side effects of juggling with global mutex
  in spice code remain.
  
  I know there used to be a mutex in spice code and during the upstreaming 
  process it
  got ditched in favor of the qemu global io mutex. I would have rather 
  deferred this
  to Gerd since he wrote this, but he is not available atm.
 
 It's not necessarily bad to drop the io mutex, but it is more tricky
 than it may appear on first glance.
 
 Jan
 


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Qemu-devel] Re: kvm crashes with spice while loading qxl

2011-02-27 Thread Alon Levy
On Sun, Feb 27, 2011 at 08:27:01PM +0100, Jan Kiszka wrote:
 On 2011-02-27 20:16, Alon Levy wrote:
  On Sun, Feb 27, 2011 at 08:11:26PM +0100, Jan Kiszka wrote:
  On 2011-02-27 20:03, Alon Levy wrote:
  On Sat, Feb 26, 2011 at 01:29:01PM +0100, Jan Kiszka wrote:
  On 2011-02-26 12:43, xming wrote:
  When trying to start X (and it loads qxl driver) the kvm process just 
  crashes.
 
  This is fixed by Gerd's attached patch (taken from rhel repository, don't 
  know
  why it wasn't pushed to qemu-kvm upstream). I'll send it to kvm list as 
  well (separate email).
 
  Patch looks OK on first glance, but the changelog is misleading: This
  was broken for _both_ trees, but upstream didn't detect the bug.
 
  
  The trees the patch commit message refers to are qemu and qemu-kvm.
 
 The same did I.
 
  qemu doesn't even have cpu_single_env.
 
 Really? Check again. :)
 
  It didn't talk about two qemu-kvm trees.
  
  My concerns regarding other side effects of juggling with global mutex
  in spice code remain.
  
  I know there used to be a mutex in spice code and during the upstreaming 
  process it
  got ditched in favor of the qemu global io mutex. I would have rather 
  deferred this
  to Gerd since he wrote this, but he is not available atm.
 
 It's not necessarily bad to drop the io mutex, but it is more tricky
 than it may appear on first glance.

The problem with not dropping it is that we may be in vga mode and create
updates synthtically (i.e. qemu created and not driver created) that access the
framebuffer and need to be locked so the framebuffer isn't updated at the same
time. We drop the mutex only when we are about to call the dispatcher, which 
basically
waits on red_worker (a libspice-server thread) to do some work. red_worker may
in turn callback into qxl in qemu, which may try to acquire the lock. (the
many may's here are just reflections of the codepaths).

 
 Jan
 


--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html