From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNfhM-0002VV-GO for qemu-devel@nongnu.org; Tue, 17 Feb 2015 05:48:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNfhH-0004mw-Hg for qemu-devel@nongnu.org; Tue, 17 Feb 2015 05:48:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNfhH-0004ml-BS for qemu-devel@nongnu.org; Tue, 17 Feb 2015 05:48:07 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1HAm51s026714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 17 Feb 2015 05:48:06 -0500 Date: Tue, 17 Feb 2015 11:48:02 +0100 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Message-ID: <20150217104802.GC4562@potion.brq.redhat.com> References: <1424121788-24560-1-git-send-email-rkrcmar@redhat.com> <1424121788-24560-2-git-send-email-rkrcmar@redhat.com> <1424160049.6014.4.camel@nilsson.home.kraxel.org> <20150217102928.GB4562@potion.brq.redhat.com> <1424169456.6014.34.camel@nilsson.home.kraxel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1424169456.6014.34.camel@nilsson.home.kraxel.org> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/2] vga: abort instead of shrinking memory List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org 2015-02-17 11:37+0100, Gerd Hoffmann: > On Di, 2015-02-17 at 11:29 +0100, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > > 2015-02-17 09:00+0100, Gerd Hoffmann: > > > On Mo, 2015-02-16 at 22:23 +0100, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote= : > > > > Automatic shrinking of vram_size leads to a segfault, because oth= er > > > > variables depend on being smaller and don't get shrinked. > > >=20 > > > --verbose please. Which other variables? > >=20 > > I'm sorry, at least rom->surface0_area_size. > > (It is sourced from qxl->vgamem_size.) >=20 > Which command line triggers it? The important subset is: -vga qxl -global qxl-vga.vgamem_mb=3D512 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 ... >=20 > 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.