qemu-e2k/softmmu
David Hildenbrand 1d44ff586f softmmu/physmem: Warn with ram_block_discard_range() on MAP_PRIVATE file mapping
ram_block_discard_range() cannot possibly do the right thing in
MAP_PRIVATE file mappings in the general case.

To achieve the documented semantics, we also have to punch a hole into
the file, possibly messing with other MAP_PRIVATE/MAP_SHARED mappings
of such a file.

For example, using VM templating -- see commit b17fbbe55c ("migration:
allow private destination ram with x-ignore-shared") -- in combination with
any mechanism that relies on discarding of RAM is problematic. This
includes:
* Postcopy live migration
* virtio-balloon inflation/deflation or free-page-reporting
* virtio-mem

So at least warn that there is something possibly dangerous is going on
when using ram_block_discard_range() in these cases.

Message-ID: <20230706075612.67404-2-david@redhat.com>
Acked-by: Peter Xu <peterx@redhat.com>
Tested-by: Mario Casquero <mcasquer@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
2023-07-12 09:25:37 +02:00
..
arch_init.c
balloon.c
bootdevice.c
cpu-throttle.c
cpu-timers.c
cpus.c atomics: eliminate mb_read/mb_set 2023-06-06 09:42:14 +02:00
datadir.c
device_tree.c
dirtylimit.c
dma-helpers.c
globals.c
icount.c icount: don't adjust virtual time backwards after warp 2023-06-27 09:00:13 +02:00
ioport.c softmmu/ioport.c: make MemoryRegionPortioList owner of portio_list MemoryRegions 2023-05-25 10:18:33 +02:00
main.c
memory_mapping.c
memory.c hostmem-file: add offset option 2023-05-23 16:47:03 +02:00
meson.build meson: Replace softmmu_ss -> system_ss 2023-06-20 10:01:30 +02:00
physmem.c softmmu/physmem: Warn with ram_block_discard_range() on MAP_PRIVATE file mapping 2023-07-12 09:25:37 +02:00
qdev-monitor.c bulk: Remove pointless QOM casts 2023-06-05 20:48:34 +02:00
qemu-seccomp.c
qtest.c
rtc.c
runstate-action.c
runstate-hmp-cmds.c
runstate.c qemu_cleanup: begin drained section after vm_shutdown() 2023-07-07 12:49:22 +02:00
timers-state.h
tpm-hmp-cmds.c
tpm.c
trace-events
trace.h
vl.c
watchpoint.c