From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2LLc-0001WY-CN for qemu-devel@nongnu.org; Thu, 25 Jul 2013 09:12:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2LB4-0003pU-OP for qemu-devel@nongnu.org; Thu, 25 Jul 2013 09:02:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2LB4-0003pF-EI for qemu-devel@nongnu.org; Thu, 25 Jul 2013 09:01:54 -0400 Date: Thu, 25 Jul 2013 16:03:11 +0300 From: "Michael S. Tsirkin" Message-ID: <20130725130311.GA2060@redhat.com> 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> <51F11D89.4090907@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51F11D89.4090907@redhat.com> 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: Gerd Hoffmann Cc: Michael Walle , qemu-devel@nongnu.org On Thu, Jul 25, 2013 at 02:43:53PM +0200, Gerd Hoffmann wrote: > 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 Hmm that's a bugt I think. Thanks!