qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1.1] vga: Initialise VRAM with 0


From: Stefano Stabellini
Subject: Re: [Qemu-devel] [PATCH 1.1] vga: Initialise VRAM with 0
Date: Thu, 24 May 2012 12:18:30 +0100
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

On Wed, 23 May 2012, Stefan Weil wrote:
> The VNC code reads this memory before it is written by BIOS or
> other code. Avoid random values by setting the VRAM to 0.
> 
> This bug was reported by Valgrind.

Please do not apply this patch: it breaks VGA restore on Xen: the
videoram is saved and restored by the hypervisor as part of the main
memory of the VM, so at this point at restore time we would be resetting
useful data (the current state of the videoram).

Can we ignore the Valgrind warning? Or can we add:

if (not_migrate)
    memset

instead? Or if worst comes to worst:

if (not_xen)
    memset



> Signed-off-by: Stefan Weil <address@hidden>
> ---
>  hw/vga.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/vga.c b/hw/vga.c
> index 1469680..80b8ec3 100644
> --- a/hw/vga.c
> +++ b/hw/vga.c
> @@ -2283,6 +2283,7 @@ void vga_common_init(VGACommonState *s, int 
> vga_ram_size)
>          s->update_retrace_info = vga_precise_update_retrace_info;
>          break;
>      }
> +    memset(s->vram_ptr, 0, s->vram_size);
>      vga_dirty_log_start(s);
>  }
>  
> -- 
> 1.7.10
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]