From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57021) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UylEG-0001l6-3D for qemu-devel@nongnu.org; Mon, 15 Jul 2013 12:02:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UylEC-0005oV-K3 for qemu-devel@nongnu.org; Mon, 15 Jul 2013 12:02:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UylEC-0005oN-Dg for qemu-devel@nongnu.org; Mon, 15 Jul 2013 12:02:20 -0400 Date: Mon, 15 Jul 2013 19:03:37 +0300 From: "Michael S. Tsirkin" Message-ID: <20130715160337.GA5432@redhat.com> References: <1373464153-18979-1-git-send-email-mst@redhat.com> <1373464153-18979-7-git-send-email-mst@redhat.com> <51E3F799.7050803@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51E3F799.7050803@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 repost 6/9] loader: support for unmapped ROM blobs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: Michael Walle , qemu-devel@nongnu.org On Mon, Jul 15, 2013 at 03:22:33PM +0200, Laszlo Ersek wrote: > On 07/10/13 15:51, Michael S. Tsirkin wrote: > > > @@ -697,7 +703,12 @@ static void rom_reset(void *unused) > > 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); > > + } else { > > + cpu_physical_memory_write_rom(rom->addr, rom->data, rom->datasize); > > + } > > if (rom->isrom) { > > /* rom needs to be written only once */ > > g_free(rom->data); > > Can you please explain the difference? > > Thanks > Laszlo Could you please clarify the question? If the ROM is not mapped into guest memory, it can't be accessed with cpu_physical_memory_write_rom. -- MST