Re: [Qemu-devel] [PATCH 1/4] memory: add memory_region_flush_rom_device()

2019-01-23 Thread Stefan Hajnoczi
On Tue, Jan 22, 2019 at 04:36:36PM +, Peter Maydell wrote: > On Sun, 20 Jan 2019 at 14:35, Stefan Hajnoczi wrote: > > > > ROM devices go via MemoryRegionOps->write() callbacks for write > > operations and do not dirty/invalidate that memory. Device emulation > > must be able to mark memory ra

Re: [Qemu-devel] [PATCH 1/4] memory: add memory_region_flush_rom_device()

2019-01-23 Thread Peter Maydell
On Wed, 23 Jan 2019 at 21:07, Stefan Hajnoczi wrote: > > On Tue, Jan 22, 2019 at 04:36:36PM +, Peter Maydell wrote: > > API and implementation make sense to me, but better that Paolo reviews > > this I think. I guess we should add calls to this to the pflash device > > models too... > > Okay,

Re: [Qemu-devel] [PATCH 1/4] memory: add memory_region_flush_rom_device()

2019-01-22 Thread Paolo Bonzini
On 22/01/19 17:36, Peter Maydell wrote: >> +void memory_region_flush_rom_device(MemoryRegion *mr, hwaddr addr, hwaddr >> size) >> +{ >> +/* In principle this function would work on other memory region types >> too, >> + * but the ROM device use case is the only one where this operation is

Re: [Qemu-devel] [PATCH 1/4] memory: add memory_region_flush_rom_device()

2019-01-22 Thread Peter Maydell
On Sun, 20 Jan 2019 at 14:35, Stefan Hajnoczi wrote: > > ROM devices go via MemoryRegionOps->write() callbacks for write > operations and do not dirty/invalidate that memory. Device emulation > must be able to mark memory ranges that have been modified internally > (e.g. using memory_region_get_r

[Qemu-devel] [PATCH 1/4] memory: add memory_region_flush_rom_device()

2019-01-20 Thread Stefan Hajnoczi
ROM devices go via MemoryRegionOps->write() callbacks for write operations and do not dirty/invalidate that memory. Device emulation must be able to mark memory ranges that have been modified internally (e.g. using memory_region_get_ram_ptr()). Introduce the memory_region_flush_rom_device() API f