From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UynVf-0007ZG-Kw for qemu-devel@nongnu.org; Mon, 15 Jul 2013 14:28:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UynVc-0007gw-Ps for qemu-devel@nongnu.org; Mon, 15 Jul 2013 14:28:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UynVc-0007gr-IW for qemu-devel@nongnu.org; Mon, 15 Jul 2013 14:28:28 -0400 Message-ID: <51E43FDB.5080200@redhat.com> Date: Mon, 15 Jul 2013 20:30:51 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <1373464153-18979-1-git-send-email-mst@redhat.com> <1373464153-18979-7-git-send-email-mst@redhat.com> <51E3F799.7050803@redhat.com> <20130715160337.GA5432@redhat.com> In-Reply-To: <20130715160337.GA5432@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: "Michael S. Tsirkin" Cc: Michael Walle , qemu-devel@nongnu.org On 07/15/13 18:03, Michael S. Tsirkin wrote: > 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. Thanks, that's what I wanted to hear :) Laszlo