All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qxl: Fix QXLRam initialisation.
@ 2013-06-17 16:38 Anthony PERARD
  2013-06-18  3:01 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
  2013-06-19  7:45 ` Michael Tokarev
  0 siblings, 2 replies; 5+ messages in thread
From: Anthony PERARD @ 2013-06-17 16:38 UTC (permalink / raw)
  To: QEMU-devel; +Cc: qemu-trivial, Anthony PERARD, Gerd Hoffmann

The qxl driver expect NULL for QXLRam.memory_configs, but this is never
initialized.

If memory is set to 0xc2c2.., it leads to a spice-critical error when
trying to start qxl.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 hw/display/qxl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index c475cb1..937a402 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -387,6 +387,7 @@ static void init_qxl_ram(PCIQXLDevice *d)
     d->ram->int_pending = cpu_to_le32(0);
     d->ram->int_mask    = cpu_to_le32(0);
     d->ram->update_surface = 0;
+    d->ram->monitors_config = 0;
     SPICE_RING_INIT(&d->ram->cmd_ring);
     SPICE_RING_INIT(&d->ram->cursor_ring);
     SPICE_RING_INIT(&d->ram->release_ring);
-- 
Anthony PERARD

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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] qxl: Fix QXLRam initialisation.
  2013-06-17 16:38 [Qemu-devel] [PATCH] qxl: Fix QXLRam initialisation Anthony PERARD
@ 2013-06-18  3:01 ` Michael Tokarev
  2013-06-18  5:37   ` Gerd Hoffmann
  2013-06-19  7:45 ` Michael Tokarev
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Tokarev @ 2013-06-18  3:01 UTC (permalink / raw)
  To: Anthony PERARD
  Cc: qemu-trivial, qemu-stable, Alon Levy, QEMU-devel, Gerd Hoffmann

17.06.2013 20:38, Anthony PERARD wrote:
> The qxl driver expect NULL for QXLRam.memory_configs, but this is never
> initialized.
> 
> If memory is set to 0xc2c2.., it leads to a spice-critical error when
> trying to start qxl.

This bug has been introduced by:

 commit 020af1c45fec664d5d4cf3b8e5117f8bc1d691f2
 Author: Alon Levy <alevy@redhat.com>
 Date:   Wed Aug 22 11:16:25 2012 +0300

    qxl: add QXL_IO_MONITORS_CONFIG_ASYNC

which went in past 1.2.0, so it might be a good candidate for -stable
as well.

The issue looks real indeed, and is a good catch.

But maybe instead of doing it this way, we should just memset the
whole thing to 0, to avoid similar bugs in the future?  Are there
any arches out there which have cpu_to_le32(0) != 0 ?

Thanks,

/mjt

> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>  hw/display/qxl.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/display/qxl.c b/hw/display/qxl.c
> index c475cb1..937a402 100644
> --- a/hw/display/qxl.c
> +++ b/hw/display/qxl.c
> @@ -387,6 +387,7 @@ static void init_qxl_ram(PCIQXLDevice *d)
>      d->ram->int_pending = cpu_to_le32(0);
>      d->ram->int_mask    = cpu_to_le32(0);
>      d->ram->update_surface = 0;
> +    d->ram->monitors_config = 0;
>      SPICE_RING_INIT(&d->ram->cmd_ring);
>      SPICE_RING_INIT(&d->ram->cursor_ring);
>      SPICE_RING_INIT(&d->ram->release_ring);
> 

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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] qxl: Fix QXLRam initialisation.
  2013-06-18  3:01 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
@ 2013-06-18  5:37   ` Gerd Hoffmann
  2013-06-18 12:42     ` Anthony PERARD
  0 siblings, 1 reply; 5+ messages in thread
From: Gerd Hoffmann @ 2013-06-18  5:37 UTC (permalink / raw)
  To: Michael Tokarev
  Cc: Anthony PERARD, qemu-trivial, Alon Levy, QEMU-devel, qemu-stable

  Hi,

>> If memory is set to 0xc2c2.., it leads to a spice-critical error when
>> trying to start qxl.

> But maybe instead of doing it this way, we should just memset the
> whole thing to 0, to avoid similar bugs in the future?  Are there
> any arches out there which have cpu_to_le32(0) != 0 ?

On qemu + kvm guest memory (including pci device memory where this lives
in) _is_ zero initialized.

IIRC xen has a debug mode where it fills memory with non-zero values
instead, for debugging / testing purposes, and this is where things blow up.

So while the fix is clearly correct, the patch isn't as critical as it
initially looks like.

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>

cheers,
  Gerd

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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] qxl: Fix QXLRam initialisation.
  2013-06-18  5:37   ` Gerd Hoffmann
@ 2013-06-18 12:42     ` Anthony PERARD
  0 siblings, 0 replies; 5+ messages in thread
From: Anthony PERARD @ 2013-06-18 12:42 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: qemu-trivial, Alon Levy, Michael Tokarev, QEMU-devel, qemu-stable

Hi,

On 18/06/13 06:37, Gerd Hoffmann wrote:
> IIRC xen has a debug mode where it fills memory with non-zero values
> instead, for debugging / testing purposes, and this is where things blow up.
>
> So while the fix is clearly correct, the patch isn't as critical as it
> initially looks like.

Indeed, it's not critical. There is other issue with Xen before to get
QXL running.

Regards,

-- 
Anthony PERARD

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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] qxl: Fix QXLRam initialisation.
  2013-06-17 16:38 [Qemu-devel] [PATCH] qxl: Fix QXLRam initialisation Anthony PERARD
  2013-06-18  3:01 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
@ 2013-06-19  7:45 ` Michael Tokarev
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Tokarev @ 2013-06-19  7:45 UTC (permalink / raw)
  To: Anthony PERARD; +Cc: qemu-trivial, QEMU-devel, Gerd Hoffmann

17.06.2013 20:38, Anthony PERARD wrote:> The qxl driver expect NULL for QXLRam.memory_configs, but this is never
> initialized.

Thanks, applied to the trivial patches queue.

/mjt

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

end of thread, other threads:[~2013-06-19  7:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-17 16:38 [Qemu-devel] [PATCH] qxl: Fix QXLRam initialisation Anthony PERARD
2013-06-18  3:01 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
2013-06-18  5:37   ` Gerd Hoffmann
2013-06-18 12:42     ` Anthony PERARD
2013-06-19  7:45 ` Michael Tokarev

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.