diff options
author | Beata Michalska <beata.michalska@linaro.org> | 2019-11-21 00:08:41 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2019-12-16 10:46:35 +0000 |
commit | 61c490e25e081af39ff40556f6c1229b8b011585 (patch) | |
tree | a05523934595b80768e7060a982fbc89041bfa08 /memory.c | |
parent | 9e70492b4389d4355ae9c9ee2ba6286cfdadc257 (diff) | |
download | qemu-61c490e25e081af39ff40556f6c1229b8b011585.zip qemu-61c490e25e081af39ff40556f6c1229b8b011585.tar.gz qemu-61c490e25e081af39ff40556f6c1229b8b011585.tar.bz2 |
Memory: Enable writeback for given memory region
Add an option to trigger memory writeback to sync given memory region
with the corresponding backing store, case one is available.
This extends the support for persistent memory, allowing syncing on-demand.
Signed-off-by: Beata Michalska <beata.michalska@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20191121000843.24844-3-beata.michalska@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -2207,6 +2207,18 @@ void memory_region_ram_resize(MemoryRegion *mr, ram_addr_t newsize, Error **errp qemu_ram_resize(mr->ram_block, newsize, errp); } + +void memory_region_do_writeback(MemoryRegion *mr, hwaddr addr, hwaddr size) +{ + /* + * Might be extended case needed to cover + * different types of memory regions + */ + if (mr->ram_block && mr->dirty_log_mask) { + qemu_ram_writeback(mr->ram_block, addr, size); + } +} + /* * Call proper memory listeners about the change on the newly * added/removed CoalescedMemoryRange. |