On 07/05/20 12:04, Stefan Hajnoczi wrote: >>> (NVME_PMRCAP_PMRWBM(n->bar.pmrcap) & 0x02)) { >>> - qemu_ram_writeback(n->pmrdev->mr.ram_block, >>> - 0, n->pmrdev->size); >>> + memory_region_do_writeback(&n->pmrdev->mr, 0, n->pmrdev->size); > qemu_ram_write() is being called because we need to msync or persist > pmem here. > > The memory_region_do_writeback() API is not equivalent, its purpose is > for dirty write logging (which we don't care about here because the > writes themselves will already have been logged when the guest performed > them). > > I think qemu_ram_writeback() should just be made common so that this > code isn't target-specific. Maybe it should be renamed to > qemu_ram_msync() to avoid confusion with dirty write APIs.
Yes, we can add qemu_ram_msync and memory_region_msync. Paolo
signature.asc
Description: OpenPGP digital signature