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