From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2Ktl-0001ER-0x for qemu-devel@nongnu.org; Thu, 25 Jul 2013 08:44:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2Ktg-0005PP-S2 for qemu-devel@nongnu.org; Thu, 25 Jul 2013 08:44:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2Ktg-0005P3-Ki for qemu-devel@nongnu.org; Thu, 25 Jul 2013 08:43:56 -0400 Message-ID: <51F11D89.4090907@redhat.com> Date: Thu, 25 Jul 2013 14:43:53 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1374681580-17439-1-git-send-email-mst@redhat.com> <1374681580-17439-8-git-send-email-mst@redhat.com> <51F116B0.5030506@redhat.com> <20130725122854.GA367@redhat.com> In-Reply-To: <20130725122854.GA367@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 07/14] loader: support for unmapped ROM blobs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Michael Walle , qemu-devel@nongnu.org On 07/25/13 14:28, Michael S. Tsirkin wrote: > On Thu, Jul 25, 2013 at 02:14:40PM +0200, Gerd Hoffmann wrote: >> On 07/24/13 18:01, Michael S. Tsirkin wrote: >>> QTAILQ_FOREACH(rom, &roms, next) { >>> + if (rom->mr) { >>> + continue; >>> + } >>> if (rom->fw_file) { >>> continue; >>> } >>> if (rom->data == NULL) { >>> continue; >>> } >>> - cpu_physical_memory_write_rom(rom->addr, rom->data, rom->datasize); >>> + if (rom->mr) { >>> + void *host = memory_region_get_ram_ptr(rom->mr); >>> + memcpy(host, rom->data, rom->datasize); >> >> I think this code never ever runs ... >> >> cheers, >> Gerd >> > > > Could you be clearer please? This chunk is in rom_reset, > I think it runs on reset. You have the "if (rom->mr)" twice in the loop. The first does continue so the second will never ever evaluate to true, thereby making the memcpy dead code. cheers, Gerd