From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rjct7-0004F7-1h for qemu-devel@nongnu.org; Sat, 07 Jan 2012 15:29:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rjct5-0003vy-EX for qemu-devel@nongnu.org; Sat, 07 Jan 2012 15:29:13 -0500 Received: from hall.aurel32.net ([88.191.126.93]:44003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rjct5-0003vu-5t for qemu-devel@nongnu.org; Sat, 07 Jan 2012 15:29:11 -0500 Date: Sat, 7 Jan 2012 21:29:08 +0100 From: Aurelien Jarno Message-ID: <20120107202908.GD20302@volta.aurel32.net> References: <1325934826-23870-1-git-send-email-sw@weilnetz.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1325934826-23870-1-git-send-email-sw@weilnetz.de> Subject: Re: [Qemu-devel] [PATCH] memory: Fix assertion for flash devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: qemu-devel@nongnu.org, Avi Kivity On Sat, Jan 07, 2012 at 12:13:46PM +0100, Stefan Weil wrote: > There is a regression since commit c5705a7728b4a6bc9e4f2d35911adbaf28042b25 > or some other recent change. > > System emulation with a flash device raises an assertion in function > qemu_ram_set_idstr because no new_block is found at the requested addr. > > The address of the memory region (mr->ram_addr) is set by > memory_region_init_rom_device: > > mr->ram_addr = qemu_ram_alloc(size, mr); > mr->ram_addr |= cpu_register_io_memory(mr); > > The 2nd line adds a small offset to mr->ram_addr, and this offset > makes ram_set_idstr fail with an assertion. > > Masking mr->ram_addr with the target's page mask removes the small > offset and makes flash devices work again. > > Cc: Avi Kivity > Signed-off-by: Stefan Weil > --- > memory.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > I can't confirm the patch is correct, but at least I can confirm it fix the breakage. Tested-by: Aurelien Jarno -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net