[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] vga: abort instead of shrinking memory
From: |
Radim Krčmář |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] vga: abort instead of shrinking memory |
Date: |
Tue, 17 Feb 2015 11:48:02 +0100 |
2015-02-17 11:37+0100, Gerd Hoffmann:
> On Di, 2015-02-17 at 11:29 +0100, Radim Krčmář wrote:
> > 2015-02-17 09:00+0100, Gerd Hoffmann:
> > > On Mo, 2015-02-16 at 22:23 +0100, Radim Krčmář wrote:
> > > > Automatic shrinking of vram_size leads to a segfault, because other
> > > > variables depend on being smaller and don't get shrinked.
> > >
> > > --verbose please. Which other variables?
> >
> > I'm sorry, at least rom->surface0_area_size.
> > (It is sourced from qxl->vgamem_size.)
>
> Which command line triggers it?
The important subset is:
-vga qxl -global qxl-vga.vgamem_mb=512
The segfault can then be triggered by any operation that dirties the
memory (pause for example).
> In theory qxl_init_ramsize() *should* make sure this can't happen ...
>
> I'd like to find & fix the bug instead of plugging an assert into some
> random place.
The bug happened because the init code is ovewriting variables, which
made the code unmanageable. I added an assert, so we would fix the
callers.
Upper layers should also have no idea that our limit is 256, so we would
ideally return an error from vga_common_init() instead of silently
mangling sizes.