qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for 2.10?] qxl: call qemu_spice_display_init_common for secondary devices
@ 2017-08-14 23:15 Paolo Bonzini
  2017-08-15  0:07 ` Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Paolo Bonzini @ 2017-08-14 23:15 UTC (permalink / raw)
  To: qemu-devel; +Cc: ademaria, peter.maydell, kraxel

Fixes this 2.10 regression:

  $ qemu-system-x86_64  -cpu host -m 6144 -vga qxl -device qxl
  qemu-system-x86_64: util/qemu-thread-posix.c:64: qemu_mutex_lock: Assertion `mutex->initialized' failed.

Reported-by: ademaria@redhat.com
Cc: kraxel@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/display/qxl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 7f8c73b56d..ae3677fd1e 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -2054,6 +2054,7 @@ static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp)
     uint32_t pci_device_rev;
     uint32_t io_size;
 
+    qemu_spice_display_init_common(&qxl->ssd);
     qxl->mode = QXL_MODE_UNDEFINED;
     qxl->generation = 1;
     qxl->num_memslots = NUM_MEMSLOTS;
@@ -2176,7 +2177,6 @@ static void qxl_realize_primary(PCIDevice *dev, Error **errp)
     portio_list_add(&qxl->vga_port_list, pci_address_space_io(dev), 0x3b0);
 
     vga->con = graphic_console_init(DEVICE(dev), 0, &qxl_ops, qxl);
-    qemu_spice_display_init_common(&qxl->ssd);
 
     qxl_realize_common(qxl, &local_err);
     if (local_err) {
-- 
2.13.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for 2.10?] qxl: call qemu_spice_display_init_common for secondary devices
  2017-08-14 23:15 [Qemu-devel] [PATCH for 2.10?] qxl: call qemu_spice_display_init_common for secondary devices Paolo Bonzini
@ 2017-08-15  0:07 ` Paolo Bonzini
  2017-08-15 13:39 ` Daniel P. Berrange
  2017-08-15 13:39 ` Stefan Hajnoczi
  2 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2017-08-15  0:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, ademaria, kraxel, Marc-André Lureau

On 15/08/2017 01:15, Paolo Bonzini wrote:
> Fixes this 2.10 regression:
> 
>   $ qemu-system-x86_64  -cpu host -m 6144 -vga qxl -device qxl
>   qemu-system-x86_64: util/qemu-thread-posix.c:64: qemu_mutex_lock: Assertion `mutex->initialized' failed.
> 
> Reported-by: ademaria@redhat.com
> Cc: kraxel@redhat.com
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Hmm, Gerd is on vacation but perhaps Marc-André can ack it?  Or just
revert the mutex->initialized patch for 2.10 (commit c096358e74,
"qemu-thread: Assert locks are initialized before using", 2017-07-04).

Paolo

> ---
>  hw/display/qxl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index 7f8c73b56d..ae3677fd1e 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -2054,6 +2054,7 @@ static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp)
>      uint32_t pci_device_rev;
>      uint32_t io_size;
>  
> +    qemu_spice_display_init_common(&qxl->ssd);
>      qxl->mode = QXL_MODE_UNDEFINED;
>      qxl->generation = 1;
>      qxl->num_memslots = NUM_MEMSLOTS;
> @@ -2176,7 +2177,6 @@ static void qxl_realize_primary(PCIDevice *dev, Error **errp)
>      portio_list_add(&qxl->vga_port_list, pci_address_space_io(dev), 0x3b0);
>  
>      vga->con = graphic_console_init(DEVICE(dev), 0, &qxl_ops, qxl);
> -    qemu_spice_display_init_common(&qxl->ssd);
>  
>      qxl_realize_common(qxl, &local_err);
>      if (local_err) {
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for 2.10?] qxl: call qemu_spice_display_init_common for secondary devices
  2017-08-14 23:15 [Qemu-devel] [PATCH for 2.10?] qxl: call qemu_spice_display_init_common for secondary devices Paolo Bonzini
  2017-08-15  0:07 ` Paolo Bonzini
@ 2017-08-15 13:39 ` Daniel P. Berrange
  2017-08-15 13:39 ` Stefan Hajnoczi
  2 siblings, 0 replies; 5+ messages in thread
From: Daniel P. Berrange @ 2017-08-15 13:39 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, peter.maydell, ademaria, kraxel

On Tue, Aug 15, 2017 at 01:15:52AM +0200, Paolo Bonzini wrote:
> Fixes this 2.10 regression:
> 
>   $ qemu-system-x86_64  -cpu host -m 6144 -vga qxl -device qxl
>   qemu-system-x86_64: util/qemu-thread-posix.c:64: qemu_mutex_lock: Assertion `mutex->initialized' failed.
> 
> Reported-by: ademaria@redhat.com
> Cc: kraxel@redhat.com
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/display/qxl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index 7f8c73b56d..ae3677fd1e 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -2054,6 +2054,7 @@ static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp)
>      uint32_t pci_device_rev;
>      uint32_t io_size;
>  
> +    qemu_spice_display_init_common(&qxl->ssd);
>      qxl->mode = QXL_MODE_UNDEFINED;
>      qxl->generation = 1;
>      qxl->num_memslots = NUM_MEMSLOTS;
> @@ -2176,7 +2177,6 @@ static void qxl_realize_primary(PCIDevice *dev, Error **errp)
>      portio_list_add(&qxl->vga_port_list, pci_address_space_io(dev), 0x3b0);
>  
>      vga->con = graphic_console_init(DEVICE(dev), 0, &qxl_ops, qxl);
> -    qemu_spice_display_init_common(&qxl->ssd);
>  
>      qxl_realize_common(qxl, &local_err);
>      if (local_err) {

IIUC, we hit the abort because we have 2 QXL devices, and only
qxl_realize_primary() is calling  qemu_spice_display_init_common().
By moving the qemu_spice_display_init_common() call upto into
the qxl_realize_common() method, it also gets triggered by
qxl_realize_secondary(). It makes that we need to initialize the
'ssd' field for both primary and secondary displays

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for 2.10?] qxl: call qemu_spice_display_init_common for secondary devices
  2017-08-14 23:15 [Qemu-devel] [PATCH for 2.10?] qxl: call qemu_spice_display_init_common for secondary devices Paolo Bonzini
  2017-08-15  0:07 ` Paolo Bonzini
  2017-08-15 13:39 ` Daniel P. Berrange
@ 2017-08-15 13:39 ` Stefan Hajnoczi
  2017-08-15 14:39   ` Peter Maydell
  2 siblings, 1 reply; 5+ messages in thread
From: Stefan Hajnoczi @ 2017-08-15 13:39 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: qemu-devel, peter.maydell, ademaria, kraxel

[-- Attachment #1: Type: text/plain, Size: 617 bytes --]

On Tue, Aug 15, 2017 at 01:15:52AM +0200, Paolo Bonzini wrote:
> Fixes this 2.10 regression:
> 
>   $ qemu-system-x86_64  -cpu host -m 6144 -vga qxl -device qxl
>   qemu-system-x86_64: util/qemu-thread-posix.c:64: qemu_mutex_lock: Assertion `mutex->initialized' failed.
> 
> Reported-by: ademaria@redhat.com
> Cc: kraxel@redhat.com
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  hw/display/qxl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I have audited the code and cannot see any bad side-effects.  Looks good
to me!

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH for 2.10?] qxl: call qemu_spice_display_init_common for secondary devices
  2017-08-15 13:39 ` Stefan Hajnoczi
@ 2017-08-15 14:39   ` Peter Maydell
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2017-08-15 14:39 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Paolo Bonzini, QEMU Developers, ademaria, Gerd Hoffmann

On 15 August 2017 at 14:39, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Tue, Aug 15, 2017 at 01:15:52AM +0200, Paolo Bonzini wrote:
>> Fixes this 2.10 regression:
>>
>>   $ qemu-system-x86_64  -cpu host -m 6144 -vga qxl -device qxl
>>   qemu-system-x86_64: util/qemu-thread-posix.c:64: qemu_mutex_lock: Assertion `mutex->initialized' failed.
>>
>> Reported-by: ademaria@redhat.com
>> Cc: kraxel@redhat.com
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>  hw/display/qxl.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> I have audited the code and cannot see any bad side-effects.  Looks good
> to me!
>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

Thanks; applied to master.

-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-08-15 14:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-14 23:15 [Qemu-devel] [PATCH for 2.10?] qxl: call qemu_spice_display_init_common for secondary devices Paolo Bonzini
2017-08-15  0:07 ` Paolo Bonzini
2017-08-15 13:39 ` Daniel P. Berrange
2017-08-15 13:39 ` Stefan Hajnoczi
2017-08-15 14:39   ` Peter Maydell

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).